File: Makefile

package info (click to toggle)
zmailer 2.99.55-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 19,516 kB
  • ctags: 9,694
  • sloc: ansic: 120,953; sh: 3,862; makefile: 3,166; perl: 2,695; python: 115; awk: 22
file content (348 lines) | stat: -rw-r--r-- 11,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# Generated automatically from Makefile.in by configure.
# Master Makefile for the ZMailer

MAJORVERSION =	2
MINORVERSION =	99
PATCHLEVEL =	55

srcdir = .


ZCONFIG = /etc/zmailer/zmailer.conf
ZCONF   = ./zmailer.Config
#ZDEPEND = Dependencies
CPPDEP  =  gcc -MM
MKDIR   =  mkdir -p
MAILBIN =  $(prefix)/usr/lib/zmailer

SHELL = /bin/sh

DISTFILES = COPYING COPYING.LIB ChangeLog Makefile.in README INSTALL \
NEWS configure configure.in config.h.in mkinstalldirs install-sh \
stamp-h.in acconfig.h

# Redundant stuff for making only selected programs.
PROGS	= router/router scheduler/scheduler			\
	scheduler/mailq smtpserver/smtpserver transports/-ok	\
	compat/rmail/rmail compat/sendmail/sendmail		\
	utils/vacation/vacation utils/makedb/makedb

# Subdirectories to run make in for the primary targets.
SUBDIRS =   smtpserver router scheduler transports compat utils
# Subdirectories where to run 'make clean'
MOREDIRS = libs lib libc libsh libident libmalloc libresolv ssl \
	   proto doc man sfio
# Files to remove in cleanup
CLEANFILES = include/rfc822.entry $(ZCONF) version.c

DISTCLEANFILES = include/mail.h SiteConfig bin/mklibdeb bin/mkdeb	\
		utils/zmailer.init.sh	proto/cf/SMTP+UUCP.cf	\
		proto/cf/TELE-FI.cf	proto/cf/UTdefault.cf	\
		proto/db/aliases				\
		man/Makefile		proto/db/Makefile	\
		bin/mkdep		bin/mklibdep

#.SUFFIXES:

all: config.h Makefile rfc822.entry $(ZCONF) SiteConfig \
     libs/libtag include/sfio.h
	#rm -f libs/libtag
	for subdir in $(SUBDIRS); do \
		echo making $@ in $$subdir; \
		(cd $$subdir && $(MAKE) $(MFLAGS) $@) || exit 1; \
	done

#	If need be, "make libs" at the top-level will remake all libraries

include/sfio.h libs/libtag libs: force
	cd libs && $(MAKE) $(MFLAGS) all


info dvi:
	cd doc && $(MAKE) $@

check:
installcheck:


rfc822.entry: include/rfc822.entry

include/rfc822.entry:
	cd router ; $(MAKE) $(MFLAGS) rfc822.entry

install-cf:	# all
	@. $(ZCONF) ; if [ -f $$ZCONFIG ] ; then	\
	 cmp -s $(ZCONF) $(prefix)$$ZCONFIG ||		\
	   echo "**" && echo "** Please consider copying $(ZCONF) to $(prefix)$$ZCONFIG !" && echo "**";\
	else						\
		cp $(ZCONF) $(prefix)$$ZCONFIG; chmod 644 $(prefix)$$ZCONFIG; \
	fi
	cd proto ;	$(MAKE) $(MFLAGS) cf

install-bin:	# all
	. $(ZCONF) ; zdir=`echo $$ZCONFIG|sed -e 's!\(.*\)/\([^/]*\)!\1/!'`; $(MKDIR) $(prefix)$$zdir
	@. $(ZCONF) ; if [ -f $$ZCONFIG ] ; then	\
	 cmp -s $(ZCONF) $(prefix)$$ZCONFIG ||		\
	   echo "**" && echo "** Please consider copying $(ZCONF) to $(prefix)$$ZCONFIG !" && echo "**";\
	else						\
		cp $(ZCONF) $(prefix)$$ZCONFIG; chmod 644 $(prefix)$$ZCONFIG; \
	fi
	@. $(ZCONF) ; cp $(srcdir)/ChangeLog $(prefix)$$MAILSHARE/ChangeLog ; chmod 644 $(prefix)$$MAILSHARE/ChangeLog
	@. $(ZCONF) ; cp ./config.status $(prefix)$$MAILSHARE/config.status ; chmod 644 $(prefix)$$MAILSHARE/config.status
	cd proto ;      $(MAKE) $(MFLAGS) install-bin  PZCONFIG="../$(ZCONF)"
	cd compat ;     $(MAKE) $(MFLAGS) install
	cd router ;     $(MAKE) $(MFLAGS) install
	cd scheduler ;  $(MAKE) $(MFLAGS) install
	cd smtpserver ; $(MAKE) $(MFLAGS) install
	cd transports ; $(MAKE) $(MFLAGS) install
	cd libc ;       $(MAKE) $(MFLAGS) install
	cd utils ;      $(MAKE) $(MFLAGS) install
	@. $(ZCONF) ; if [ -f $$ZCONFIG ] ; then	\
	 cmp -s $(ZCONF) $(prefix)$$ZCONFIG ||		\
	   echo "**" && echo "** Please consider copying $(ZCONF) to $(prefix)$$ZCONFIG !" && echo "**";\
	else						\
		cp $(ZCONF) $(prefix)$$ZCONFIG; chmod 644 $(prefix)$$ZCONFIG; \
	fi
	@echo ">>>> "
	@echo ">>>> Please do run $(MAILBIN)/post-install"
	@echo ">>>> "

dirs:
	@cd proto ; $(MAKE) $(MFLAGS) dirs PZCONFIG="../$(ZCONF)"

install:	dirs # all
	@. $(ZCONF) ; zdir=`echo $$ZCONFIG|sed -e 's!\(.*\)/\([^/]*\)!\1/!'`; $(MKDIR) $(prefix)$$zdir
	@. $(ZCONF) ; cp $(ZCONF) $(prefix)$$ZCONFIG ; chmod 644 $(prefix)$$ZCONFIG
	@. $(ZCONF) ; cp $(srcdir)/ChangeLog $(prefix)$$MAILSHARE/ChangeLog ; chmod 644 $(prefix)$$MAILSHARE/ChangeLog
	@. $(ZCONF) ; cp ./config.status $(prefix)$$MAILSHARE/config.status ; chmod 644 $(prefix)$$MAILSHARE/config.status
	@cd proto ;      $(MAKE) $(MFLAGS) install  PZCONFIG="../$(ZCONF)"
	@cd compat ;     $(MAKE) $(MFLAGS) install
	@cd router ;     $(MAKE) $(MFLAGS) install
	@cd scheduler ;  $(MAKE) $(MFLAGS) install
	@cd smtpserver ; $(MAKE) $(MFLAGS) install
	@cd transports ; $(MAKE) $(MFLAGS) install
	@cd libc  ;      $(MAKE) $(MFLAGS) install
	@cd utils ;      $(MAKE) $(MFLAGS) install
	@echo ">>>> "
	@echo ">>>> Please do run $(MAILBIN)/post-install"
	@echo ">>>> "

router/router:
	cd router ; $(MAKE) $(MFLAGS) router-a

scheduler/scheduler:
	cd scheduler ; $(MAKE) $(MFLAGS) all

scheduler-old/scheduler-old:
	cd scheduler-old ; $(MAKE) $(MFLAGS) all

scheduler/mailq:
	cd scheduler ; $(MAKE) $(MFLAGS) all

smtpserver/smtpserver:
	cd smtpserver ; $(MAKE) $(MFLAGS) smtpserver-a

compat/rmail/rmail:
	cd compat ; $(MAKE) $(MFLAGS) rmail/rmail-always

compat/sendmail/sendmail:
	cd compat ; $(MAKE) $(MFLAGS) sendmail/sendmail-always

utils/vacation/vacation:
	cd utils/vacation ; $(MAKE) $(MFLAGS) vacation

utils/makedb/makedb:
	cd utils/makedb ; $(MAKE) $(MFLAGS)

lib/libz.a: lib/*.c
	cd lib ; $(MAKE) $(MFLAGS)

libc/libzc.a: libc/*.c
	cd libc ; $(MAKE) $(MFLAGS)

libauth/libauth.a: libauth/authuser.c libauth/authuser.h
	cd libauth; $(MAKE) $(MFLAGS)

libresolv/libresolv.a: libresolv/*.c
	cd libresolv; $(MAKE) $(MFLAGS)

transports/libta/libta.a: transports/libta/*.c
	cd transports/libta ; $(MAKE) $(MFLAGS)

transports/-ok:
	cd transports ; $(MAKE) $(MFLAGS)

mostlyclean: mostlyclean-recursive mostlyclean-local

clean: clean-recursive clean-local

distclean: distclean-recursive distclean-local
	: rm config.status

realclean: realclean-recursive realclean-local
	: rm config.status

TAGS clean-recursive distclean-recursive \
	    mostlyclean-recursive realclean-recursive:
	for subdir in $(SUBDIRS) $(MOREDIRS); do \
	  target=`echo $@|sed 's/-recursive//'`; \
	  echo making $$target in $$subdir; \
	  (cd $$subdir && $(MAKE) $(MFLAGS) $$target) || exit 1; \
	done
	rm -f $(CLEANFILES)

mostlyclean-local:

clean-local: mostlyclean-local
	-tt=`find . "(" -name "*~" -o -name "*.log" -o -name "*.orig" ")" -print` && \
		rm -f clean.state $$tt

clean-version:
	-rm -f `find . -name version.c -print | egrep -v libmalloc` dummy.name
	-rm -f `find . -name revision -print ` dummy.name

distclean-local: clean-local clean-version
	rm -f config.cache config.h config.log stamp-h distname
	rm -f $(DISTCLEANFILES)

realclean-local: distclean-local

neat:
	-rm -f $(ZCONF) $(CONF).sed eddep makedep Makefile.bak *.tar

scrub:	distclean
	-rm -f make.log make.out make.err* errs

scrub-obsolete-tail:
	# No null entry at all, let it be generated into proper form
	# when real processing goes thru..
	# @echo 'typedef enum { nilHeaderSemantics = -1 } HeaderSemantics;' > include/rfc822.entry

dist:
	@echo 'Did you run "make scrub" first?' ; sleep 2
	chmod -R a+rX .
	find . -type l -o -type d -o -type f -print | \
	  egrep -v -e '/(private[/$$]|config.cache|config.status|CVS[/$$]|RCS[/$$]|ID$$|.*\.o$$|fc[/$$]|.*\.a$$|stamp)' | \
	  CWD=`pwd` sed -e '/\.tar.*/d' -e "s/^\./`sh -c 'basename \`pwd\`'`/" | \
	  sort -t/ > MANIFEST
	cp MANIFEST /tmp
	(cd .. ; tar cvf - `cat /tmp/MANIFEST` ) > `basename \`pwd\``.tar
	rm -f /tmp/MANIFEST #MANIFEST

distprivate:
	@echo 'Did you run "make scrub" first?' ; sleep 2
	chmod -R a+rX .
	find . -type l -o -type d -o -type f -print | \
	  egrep -v -e '/(config.cache|config.status|CVS[/$$]|RCS[/$$]|ID$$|.*\.o$$|fc[/$$]|.*\.a$$|stamp)' | \
	  CWD=`pwd` sed -e '/\.tar.*/d' -e "s/^\./`sh -c 'basename \`pwd\`'`/" | \
	  sort -t/ > MANIFEST
	cp MANIFEST /tmp
	(cd .. ; tar cvf - `cat /tmp/MANIFEST` ) > `basename \`pwd\``.tar
	rm -f /tmp/MANIFEST #MANIFEST

dist-usa:
	@echo 'Did you run "make scrub" first?' ; sleep 2
	chmod -R a+rX .
	./bin/usa-itar-stripper.sh
	find . -type d -o -type f -print | \
	  egrep -v -e '/(private[/$$]|config.cache|crypto|config.status|CVS[/$$]|RCS[/$$]|ID$$|.*\.o$$|fc[/$$]|.*\.a$$|stamp)' | \
	  CWD=`pwd` sed -e '/\.tar.*/d' -e "s/^\./`sh -c 'basename \`pwd\`'`/" | \
	  sort -t/ > MANIFEST
	cp MANIFEST /tmp
	(cd .. ; tar cvf - `cat /tmp/MANIFEST` ) > `basename \`pwd\``-usa.tar
	./bin/usa-itar-stripper.sh reverse
	mv crypto.diff crypto-`basename \`pwd\``.diff
	rm -f /tmp/MANIFEST #MANIFEST


# For the justification of the following Makefile rules, see node
# `Automatic Remaking' in GNU Autoconf documentation.

SiteConfig Makefile: config.status Makefile.in
	CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status

config.h: stamp-h
stamp-h: config.status $(srcdir)/config.h.in
	CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status

config.status: configure
	./config.status --recheck
#
# The GNU autoconf guide says: have following condition, however
# not all systems have "autoconf", and thus people pulling this
# package from CVS are getting serious problems -- or have to
# "touch configure" after the CVS pull.
#
#configure: configure.in
#	cd $(srcdir) && autoconf

config.h.in: stamp-h.in
stamp-h.in: configure.in
# 	cd $(srcdir) && autoheader
# # Use echo instead of date to avoid spurious conflicts for
# # people who use CVS, since stamp-h.in is distributed.
# 	echo > $(srcdir)/$@

$(ZCONF):	SiteConfig
	(echo '# Do not edit this file, instead edit '`pwd`'/SiteConfig.in file'; \
	cat SiteConfig | \
	sed -n	-e '/^\([a-zA-Z][^ 	]*\)[ 	]*=[ 	]*\(.*\)[ 	]*$$/!d' \
		-e 's/^\([^ 	]*\)[ 	]*=[ 	]*\(.*\)[ 	]*$$/\1="\2"/' \
		-e 's/^\([^=]*\)=""\(.*\)""$$/\1="\2"/'	\
		-e 's/^\([^=]*\)="\([^ 	]*\)"$$/\1=\2/'			\
		-e p	) > $@
# The sed-patterns above do:
#  - match sh-variable set expression, discard all else
#  - pick the variable name, and the parameter string and form up
#    an expression:   VAR="DATA"
#  - if the newly made expression has double quotes (because the input
#    was quoted), remove the extra quotes
#  - if a value is quoted, and it does not have white-space in it, strip
#    the quotes away
#  - and as always with sed, "p" in the end to output the result

#OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
# $(ZCONF):	SiteConfig
# 	(echo '# Do not edit this file, instead edit '`pwd`'/SiteConfig.in file'; \
# 	cat SiteConfig | \
# 	sed -n  -e '/^[^ 	]*=[ 	]*[^#].*/!d' \
# 		-e 's:^\([^ 	]*\)=[ 	]*\([^#].*\):\1=\2:' \
# 		-e 's:=\([^# 	]*[ 	][^#]*\)\(.*\):="\1"\2:' \
# 		-e 's:\([ 	][ 	]*\)":"\1:' \
# 		-e 's:"\([^ 	]*\)":\1:' -e 's:""::' -e p   ) > $@

force:

version.c: force # Makefile
	@sh -c ': $${USER=$${LOGNAME-root}} ; \
	REVISION=`cat revision 2>/dev/null || (echo 0 | tee revision)` ; \
	HOSTNAME=`(/bin/hostname || /bin/uname) 2>/dev/null` ; \
	case "$$REVISION" in \
	[0-9]|[0-9][0-9]|[0-9][0-9][0-9]) \
		REVISION=`expr $$REVISION + 1` ;; \
	*)	REVISION=0 ;; \
	esac ; \
	case "${PATCHLEVEL}" in \
	0)	VERSION="${MAJORVERSION}.${MINORVERSION}" ;; \
	*)	VERSION="${MAJORVERSION}.${MINORVERSION}.${PATCHLEVEL}" ;; \
	esac ; \
	echo $$REVISION > revision ; \
	exec > version.c ; \
	echo "const char *Version = \"$${VERSION} #$${REVISION}: `date`\";"; \
	echo "const char *VersionNumb = \"$${VERSION} #$${REVISION}\";"; \
	echo "const char *CC_user = \"$${USER}@$${HOSTNAME}\";"; \
	echo "const char *CC_pwd = \"`pwd`\";" '

depend:
	for x in $(SUBDIRS) $(MOREDIRS); do		\
	    if [ -f $$x/Makefile ]; then		\
		( cd $$x; ${MAKE} ${MFLAGS} depend CPPDEP="${CPPDEP}" ); \
	    fi ;					\
	done


# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

# DO NOT DELETE THIS LINE -- It is used by 'make depend' to update this file