blob: 9ff12d8e05d5b536fae8e3dd4a707981b0ed5756 [file] [log] [blame]
# You can do "make SUB=blah" to make only a few, or edit here, or both
# You can also run make directly in the subdirs you want.
SUB = lib common tftp tftpd
%.build: MCONFIG aconfig.h version.h
$(MAKE) -C $(patsubst %.build, %, $@)
%.install: MCONFIG aconfig.h version.h
$(MAKE) -C $(patsubst %.install, %, $@) install
%.clean:
$(MAKE) -C $(patsubst %.clean, %, $@) clean
%.distclean:
$(MAKE) -C $(patsubst %.distclean, %, $@) distclean
all: MCONFIG $(patsubst %, %.build, $(SUB))
tftp.build: lib.build common.build
tftpd.build: lib.build common.build
install: MCONFIG $(patsubst %, %.install, $(SUB))
clean: localclean $(patsubst %, %.clean, $(SUB))
localclean:
rm -f version.h
distclean: localdistclean $(patsubst %, %.distclean, $(SUB))
localdistclean: localclean
rm -f MCONFIG config.status config.log aconfig.h *~ \#*
rm -rf *.cache
find . -type f \( -name \*.orig -o -name \*.rej \) | xargs rm -f
spotless: distclean
rm -f configure aconfig.h.in tftp.spec
autoconf: configure aconfig.h.in
config: MCONFIG aconfig.h
release:
$(MAKE) autoconf
$(MAKE) tftp.spec
$(MAKE) distclean
MCONFIG: configure MCONFIG.in aconfig.h.in
if test -x config.status; then \
./config.status --recheck && ./config.status ; \
else \
./configure ; \
fi
aconfig.h: MCONFIG
: Generated by side effect
# Adding "configure" to the dependencies serializes this with running
# autoconf, because there are apparently race conditions between
# autoconf and autoheader.
aconfig.h.in: configure.in configure aclocal.m4
rm -f aconfig.h.in aconfig.h
autoheader
configure: configure.in aclocal.m4
rm -rf MCONFIG configure config.log aconfig.h *.cache
autoconf
version.h: version
echo \#define VERSION \"tftp-hpa `cat version`\" > version.h
tftp.spec: tftp.spec.in version
sed -e "s/@@VERSION@@/`cat version`/g" < $< > $@ || rm -f $@