4
top_srcdir = @top_srcdir@
11
INSTALL_PROGRAM = @INSTALL_PROGRAM@
12
INSTALL_DATA = @INSTALL_DATA@
18
ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS)
29
$(CC) -c $(ALL_CFLAGS) $< -o $@
31
OBJS= pwgen.o pw_phonemes.o pw_rand.o randnum.o
33
SRCS= pwgen.c pw_phonemes.c pw_rand.c randnum.c
37
$(CC) -o pwgen $(OBJS)
39
install: pwgen pwgen.1
40
mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(prefix)/man/man1
41
$(INSTALL_PROGRAM) pwgen $(DESTDIR)$(prefix)/bin/pwgen
42
$(INSTALL_DATA) $(srcdir)/pwgen.1 $(DESTDIR)$(mandir)/man1/pwgen.1
45
$(RM) -f $(OBJS) pwgen *~
48
$(RM) -f config.status config.log config.cache Makefile \
49
$(srcdir)/Makefile.in.old $(srcdir)/.exclude-file
53
# Build source tar ball...
56
SRCROOT = pwgen-$(PWGEN_VERSION)
58
$(srcdir)/.exclude-file:
60
(cd $(srcdir)/.. && find src \( -name \*~ -o -name \*.orig \
61
-o -name CVS -o -name \*.rej \
62
-o -name TAGS -o -name \*.old -o -name \*.gmo \
63
-o -name changed-files -o -name .#\* \) \
64
-print) | sed -e "s/src/$$a/" > $(srcdir)/.exclude-file
65
echo "$(SRCROOT)/build" >> $(srcdir)/.exclude-file
66
echo "$(SRCROOT)/rpm.log" >> $(srcdir)/.exclude-file
67
echo "$(SRCROOT)/TODO" >> $(srcdir)/.exclude-file
68
echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
69
>> $(srcdir)/.exclude-file
71
source_tar_file: $(srcdir)/.exclude-file
72
cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf src $$a ; \
73
$(TAR) -c -h -v -f - \
74
-X $$a/.exclude-file $$a | \
75
gzip -9 > pwgen-$(PWGEN_VERSION).tar.gz
76
rm -f $(srcdir)/.exclude-file
81
$(top_builddir)/config.status: $(top_srcdir)/configure
82
cd $(top_builddir); ./config.status --recheck
84
Makefile: $(srcdir)/Makefile.in $(DEP_MAKEFILE) $(top_builddir)/config.status
85
cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
87
$(top_srcdir)/configure: $(top_srcdir)/configure.in
88
cd $(top_srcdir) && autoconf
91
# Make depend magic...
94
.depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
95
if test -n "$(SRCS)" ; then \
96
$(CC) -M $(ALL_CFLAGS) $(SRCS) | \
97
$(SED) -f $(top_srcdir)/depfix.sed \
98
-e 's; $(srcdir)/; $$(srcdir)/;g' \
99
-e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
100
-e 's; $(top_builddir)/; $$(top_builddir)/;g' \
103
$(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
107
if test -n "$(SRCS)" ; then \
108
sed -e '/^# +++ Dependency line eater +++/,$$d' \
109
< $(srcdir)/Makefile.in | cat - .depend \
110
> $(srcdir)/Makefile.in.new; \
111
if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
112
$(RM) $(srcdir)/Makefile.in.new ; \
114
$(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
115
$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
118
# +++ Dependency line eater +++
120
# Makefile dependencies follow. This must be the last section in
121
# the Makefile.in file
123
pwgen.o: pwgen.c pwgen.h
124
pw_phonemes.o: pw_phonemes.c pwgen.h
125
pw_rand.o: pw_rand.c pwgen.h
126
randnum.o: randnum.c pwgen.h