xref: /netbsd-src/external/ibm-public/postfix/dist/Makefile.in (revision 200d779b75dbeafa7bc01fd0f60bc61185f6967b)
1SHELL	= /bin/sh
2WARN    = -Wmissing-prototypes -Wformat -Wno-comment
3OPTS	= 'CC=$(CC)'
4DIRS	= src/util src/global src/dns src/tls src/xsasl src/milter src/master \
5	src/postfix src/fsstone src/smtpstone \
6	src/sendmail src/error src/pickup src/cleanup src/smtpd src/local \
7	src/trivial-rewrite src/qmgr src/oqmgr src/smtp src/bounce \
8	src/pipe src/showq src/postalias src/postcat src/postconf src/postdrop \
9	src/postkick src/postlock src/postlog src/postmap src/postqueue \
10	src/postsuper src/qmqpd src/spawn src/flush src/verify \
11	src/virtual src/proxymap src/anvil src/scache src/discard src/tlsmgr \
12	src/postmulti src/postscreen src/dnsblog src/tlsproxy \
13	src/posttls-finger
14MANDIRS	= proto man html
15LIBEXEC	= libexec/post-install libexec/postfix-files libexec/postfix-script \
16	libexec/postfix-wrapper libexec/main.cf libexec/master.cf \
17	libexec/postmulti-script
18
19default: update
20
21makefiles Makefiles:
22	(echo "# Do not edit -- this file documents how Postfix was built for your machine."; $(SHELL) makedefs) >makedefs.tmp
23	set +e; if cmp makedefs.tmp conf/makedefs.out; then rm makedefs.tmp; \
24	else mv makedefs.tmp conf/makedefs.out; fi >/dev/null 2>/dev/null
25	set -e; for i in $(DIRS); do \
26	 (set -e; echo "[$$i]"; cd $$i; rm -f Makefile; \
27	 $(MAKE) -f Makefile.in Makefile MAKELEVEL=) || exit 1; \
28	done;
29	rm -f Makefile; (cat conf/makedefs.out Makefile.in) >Makefile
30
31update printfck tests root_tests:
32	set -e; for i in $(DIRS); do \
33	 (set -e; echo "[$$i]"; cd $$i; $(MAKE) $(OPTS) $@ MAKELEVEL=) || exit 1; \
34	done
35
36update: $(LIBEXEC)
37
38libexec/post-install: conf/post-install
39	rm -f $@ && ln -f $? $@
40
41libexec/postfix-files: conf/postfix-files
42	rm -f $@ && ln -f $? $@
43
44libexec/postfix-script: conf/postfix-script
45	rm -f $@ && ln -f $? $@
46
47libexec/postfix-wrapper: conf/postfix-wrapper
48	rm -f $@ && ln -f $? $@
49
50libexec/main.cf: conf/main.cf
51	rm -f $@ && ln -f $? $@
52
53libexec/master.cf: conf/master.cf
54	rm -f $@ && ln -f $? $@
55
56libexec/postmulti-script: conf/postmulti-script
57	rm -f $@ && ln -f $? $@
58
59manpages:
60	set -e; for i in $(MANDIRS); do \
61	 (set -e; echo "[$$i]"; cd $$i; $(MAKE) -f Makefile.in $(OPTS) MAKELEVEL=) || exit 1; \
62	done </dev/null
63
64printfck: update
65
66install: update
67	$(SHELL) postfix-install
68
69package: update
70	$(SHELL) postfix-install -package
71
72upgrade: update
73	$(SHELL) postfix-install -non-interactive
74
75non-interactive-package: update
76	$(SHELL) postfix-install -non-interactive -package
77
78depend clean:
79	set -e; for i in $(DIRS); do \
80	 (set -e; echo "[$$i]"; cd $$i; $(MAKE) $@) || exit 1; \
81	done
82
83depend_update:
84	set -e; for i in $(DIRS); do \
85	 (set -e; echo "[$$i]"; cd $$i; $(MAKE) depend && $(MAKE) $(OPTS) update) \
86	    || exit 1; \
87	done
88
89tidy:	clean
90	rm -f Makefile */Makefile src/*/Makefile
91	cp Makefile.init Makefile
92	rm -f README_FILES/RELEASE_NOTES
93	ln -s ../RELEASE_NOTES README_FILES
94	rm -f bin/[!CRS]* lib/[!CRS]* include/[!CRS]* libexec/[!CRS]* \
95	    junk */junk */*/junk \
96	    *core */*core */*/*core \
97	    .nfs* */.nfs* */*/.nfs* \
98	    .pure */.pure */*/.pure \
99	    *.out */*.out */*/*.out \
100	    *.tmp */*.tmp */*/*.tmp \
101	    *.a */*.a */*/*.a \
102	    *~ */*~ */*/*~ \
103	    *- */*- */*/*- \
104	    *.orig */*.orig */*/*.orig \
105	    *.bak */*.bak */*/*.bak \
106	    make.err */make.err */*/make.err \
107	    *.gmon */*.gmon */*/*.gmon \
108	    conf/main.cf.default conf/bounce.cf.default
109	find . -type s -print | xargs rm -f
110	find . -type d -print | xargs chmod 755
111	find . -type f -print | xargs chmod a+r
112