Add EditorConfig support
[tftp-hpa.git] / Makefile
blob8c779d32fce6caf8746a83e46d2aa93b0fc5c90a
1 # You can do "make SUB=blah" to make only a few, or edit here, or both
2 # You can also run make directly in the subdirs you want.
4 SUB = lib common tftp tftpd
6 %.build: MCONFIG aconfig.h version.h
7 $(MAKE) -C $(patsubst %.build, %, $@)
9 %.install: MCONFIG aconfig.h version.h
10 $(MAKE) -C $(patsubst %.install, %, $@) install
12 %.clean:
13 $(MAKE) -C $(patsubst %.clean, %, $@) clean
15 %.distclean:
16 $(MAKE) -C $(patsubst %.distclean, %, $@) distclean
18 all: MCONFIG $(patsubst %, %.build, $(SUB))
20 tftp.build: lib.build common.build
21 tftpd.build: lib.build common.build
23 install: MCONFIG $(patsubst %, %.install, $(SUB))
25 clean: localclean $(patsubst %, %.clean, $(SUB))
27 localclean:
28 rm -f version.h
30 distclean: localdistclean $(patsubst %, %.distclean, $(SUB))
32 localdistclean: localclean
33 rm -f MCONFIG config.status config.log aconfig.h *~ \#*
34 rm -rf *.cache
35 find . -type f \( -name \*.orig -o -name \*.rej \) | xargs rm -f
37 spotless: distclean
38 rm -f configure aconfig.h.in tftp.spec
40 autoconf: configure aconfig.h.in
42 config: MCONFIG aconfig.h
44 release:
45 $(MAKE) autoconf
46 $(MAKE) tftp.spec
47 $(MAKE) distclean
49 MCONFIG: configure MCONFIG.in aconfig.h.in
50 if test -x config.status; then \
51 ./config.status --recheck && ./config.status ; \
52 else \
53 ./configure ; \
56 aconfig.h: MCONFIG
57 : Generated by side effect
59 # Adding "configure" to the dependencies serializes this with running
60 # autoconf, because there are apparently race conditions between
61 # autoconf and autoheader. And worse than that, even when autoconf
62 # cleanly returns first, autoheader will truncate the timestamp of
63 # aconfig.h.in to second resolution, so on a filesystem with subsecond
64 # resolution it can appear older than configure (which isn't truncated).
65 # So make it an order-only prerequisite to avoid looping regenerating it.
66 aconfig.h.in: configure.ac aclocal.m4 | configure
67 rm -f aconfig.h.in aconfig.h
68 autoheader
70 configure: configure.ac aclocal.m4
71 rm -rf MCONFIG configure config.log aconfig.h *.cache
72 autoconf
74 version.h: version
75 echo \#define VERSION \"tftp-hpa `cat version`\" > version.h
77 tftp.spec: tftp.spec.in version
78 sed -e "s/@@VERSION@@/`cat version`/g" < $< > $@ || rm -f $@