mirror of
https://github.com/tytso/pwgen.git
synced 2026-09-14 11:06:19 +05:00
143 lines
3.8 KiB
Makefile
143 lines
3.8 KiB
Makefile
PWGEN_VERSION=2.08
|
|
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@
|
|
VPATH = @srcdir@
|
|
datarootdir = @datarootdir@
|
|
top_builddir = .
|
|
my_dir = .
|
|
prefix = @prefix@
|
|
mandir = @mandir@
|
|
INSTALL = @INSTALL@
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
INSTALL_DATA = @INSTALL_DATA@
|
|
|
|
WALL_OPTS = -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
|
-Wshadow -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align \
|
|
-pedantic
|
|
CC = @CC@
|
|
DEFS = @DEFS@
|
|
CFLAGS = @CFLAGS@ $(WALL_OPTS)
|
|
CPPFLAGS = @CPPFLAGS@
|
|
ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS)
|
|
LDFLAGS = @LDFLAGS@
|
|
RM = @RM@
|
|
MV = @MV@
|
|
SED = @SED@
|
|
PERL = @PERL@
|
|
TAR = tar
|
|
|
|
all:: pwgen
|
|
|
|
.c.o:
|
|
$(CC) -c $(ALL_CFLAGS) $< -o $@
|
|
|
|
OBJS= pwgen.o \
|
|
pw_phonemes.o \
|
|
pw_rand.o \
|
|
randnum.o \
|
|
sha1.o \
|
|
sha1num.o
|
|
|
|
SRCS= $(srcdir)/pwgen.c \
|
|
$(srcdir)/pw_phonemes.c \
|
|
$(srcdir)/pw_rand.c \
|
|
$(srcdir)/randnum.c \
|
|
$(srcdir)/sha1.c \
|
|
$(srcdir)/sha1num.c
|
|
|
|
|
|
pwgen: $(OBJS)
|
|
$(CC) $(LDFLAGS) -o pwgen $(OBJS)
|
|
|
|
install: pwgen pwgen.1
|
|
mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(mandir)/man1
|
|
$(INSTALL_PROGRAM) pwgen $(DESTDIR)$(prefix)/bin/pwgen
|
|
$(INSTALL_DATA) $(srcdir)/pwgen.1 $(DESTDIR)$(mandir)/man1/pwgen.1
|
|
|
|
clean:
|
|
$(RM) -f $(OBJS) pwgen *~
|
|
|
|
distclean: clean
|
|
$(RM) -rf config.status config.log config.cache Makefile \
|
|
$(srcdir)/Makefile.in.old $(srcdir)/.exclude-file \
|
|
$(srcdir)/autom4te.cache
|
|
|
|
#
|
|
# Build source tar ball...
|
|
#
|
|
|
|
SRCROOT = pwgen-$(PWGEN_VERSION)
|
|
|
|
$(srcdir)/.exclude-file:
|
|
a=$(SRCROOT); \
|
|
(cd $(srcdir) && find . \( -name \*~ -o -name \*.orig \
|
|
-o -name .git -o -name \*.rej \
|
|
-o -name TAGS -o -name \*.old -o -name \*.gmo \
|
|
-o -name config.log -o -name config.cache \
|
|
-o -name config.status -o -name Makefile \
|
|
-o -name build -o -name autom4te.cache \
|
|
-o -name changed-files -o -name .#\* \) \
|
|
-print) | sed -e "s/^./$$a/" > $(srcdir)/.exclude-file
|
|
echo "$(SRCROOT)/.exclude-file" >> $(srcdir)/.exclude-file
|
|
>> $(srcdir)/.exclude-file
|
|
|
|
source_tar_file: $(srcdir)/.exclude-file
|
|
cd $(srcdir)/.. && a=$(SRCROOT); rm -f $$a ; ln -sf pwgen $$a ; \
|
|
$(TAR) -c -h -v -f - \
|
|
-X $$a/.exclude-file $$a | \
|
|
gzip -9 > pwgen-$(PWGEN_VERSION).tar.gz
|
|
rm -f $(srcdir)/.exclude-file $(srcdir)/../$(SRCROOT)
|
|
#
|
|
# Autoconf magic...
|
|
#
|
|
|
|
$(top_builddir)/config.status: $(top_srcdir)/configure
|
|
cd $(top_builddir); ./config.status --recheck
|
|
|
|
Makefile: $(srcdir)/Makefile.in $(DEP_MAKEFILE) $(top_builddir)/config.status
|
|
cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
|
|
|
|
$(top_srcdir)/configure: $(top_srcdir)/configure.ac
|
|
cd $(top_srcdir) && autoconf
|
|
|
|
#
|
|
# Make depend magic...
|
|
#
|
|
|
|
.depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
|
|
if test -n "$(SRCS)" ; then \
|
|
$(CC) -M $(ALL_CFLAGS) $(SRCS) | \
|
|
$(SED) -f $(top_srcdir)/depfix.sed \
|
|
-e 's; $(srcdir)/; $$(srcdir)/;g' \
|
|
-e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
|
|
-e 's; $(top_builddir)/; $$(top_builddir)/;g' \
|
|
-e 's; \./; ;g' \
|
|
-e '/^ *\\$$/d' | \
|
|
$(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
|
|
else :; fi
|
|
|
|
depend:: .depend
|
|
if test -n "$(SRCS)" ; then \
|
|
sed -e '/^# +++ Dependency line eater +++/,$$d' \
|
|
< $(srcdir)/Makefile.in | cat - .depend \
|
|
> $(srcdir)/Makefile.in.new; \
|
|
if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
|
|
$(RM) $(srcdir)/Makefile.in.new ; \
|
|
else \
|
|
$(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
|
|
$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
|
|
fi ; else :; fi
|
|
|
|
# +++ Dependency line eater +++
|
|
#
|
|
# Makefile dependencies follow. This must be the last section in
|
|
# the Makefile.in file
|
|
#
|
|
pwgen.o: $(srcdir)/pwgen.c $(srcdir)/pwgen.h
|
|
pw_phonemes.o: $(srcdir)/pw_phonemes.c $(srcdir)/pwgen.h
|
|
pw_rand.o: $(srcdir)/pw_rand.c $(srcdir)/pwgen.h
|
|
randnum.o: $(srcdir)/randnum.c $(srcdir)/pwgen.h
|
|
sha1.o: $(srcdir)/sha1.c $(srcdir)/sha1.h
|
|
sha1num.o: $(srcdir)/sha1num.c $(srcdir)/pwgen.h $(srcdir)/sha1.h
|