1SHELL	= /bin/sh
2SRCS	= postcat.c
3OBJS	= postcat.o
4HDRS	=
5TESTSRC	=
6DEFS	= -I. -I$(INC_DIR) -D$(SYSTYPE)
7CFLAGS	= $(DEBUG) $(OPT) $(DEFS)
8TESTPROG=
9PROG	= postcat
10INC_DIR	= ../../include
11LIBS	= ../../lib/libglobal.a ../../lib/libutil.a
12
13.c.o:;	$(CC) $(CFLAGS) -c $*.c
14
15$(PROG): $(OBJS) $(LIBS)
16	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
17
18$(OBJS): ../../conf/makedefs.out
19
20Makefile: Makefile.in
21	cat ../../conf/makedefs.out $? >$@
22
23test:	$(TESTPROG)
24
25tests: default_test ebh_test e_test b_test h_test eb_test eh_test bh_test
26
27root_tests:
28
29update: ../../bin/$(PROG)
30
31../../bin/$(PROG): $(PROG)
32	cp $(PROG) ../../bin
33
34printfck: $(OBJS) $(PROG)
35	rm -rf printfck
36	mkdir printfck
37	sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
38	set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
39	cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
40
41lint:
42	lint $(DEFS) $(SRCS) $(LINTFIX)
43
44clean:
45	rm -f *.o *core $(PROG) $(TESTPROG) junk
46	rm -rf printfck
47
48tidy:	clean
49
50default_test: test-queue-file default_test.ref
51	./postcat test-queue-file >postcat.tmp 2>&1
52	diff default_test.ref postcat.tmp
53	rm -f postcat.tmp
54
55ebh_test: test-queue-file default_test.ref
56	./postcat -ebh test-queue-file >postcat.tmp 2>&1
57	diff default_test.ref postcat.tmp
58	rm -f postcat.tmp
59
60e_test: test-queue-file e_test.ref
61	./postcat -e test-queue-file >postcat.tmp 2>&1
62	diff e_test.ref postcat.tmp
63	rm -f postcat.tmp
64
65b_test: test-queue-file b_test.ref
66	./postcat -b test-queue-file >postcat.tmp 2>&1
67	diff b_test.ref postcat.tmp
68	rm -f postcat.tmp
69
70h_test: test-queue-file h_test.ref
71	./postcat -h test-queue-file >postcat.tmp 2>&1
72	diff h_test.ref postcat.tmp
73	rm -f postcat.tmp
74
75eb_test: test-queue-file eb_test.ref
76	./postcat -eb test-queue-file >postcat.tmp 2>&1
77	diff eb_test.ref postcat.tmp
78	rm -f postcat.tmp
79
80eh_test: test-queue-file eh_test.ref
81	./postcat -eh test-queue-file >postcat.tmp 2>&1
82	diff eh_test.ref postcat.tmp
83	rm -f postcat.tmp
84
85bh_test: test-queue-file bh_test.ref
86	./postcat -bh test-queue-file >postcat.tmp 2>&1
87	diff bh_test.ref postcat.tmp
88	rm -f postcat.tmp
89
90depend: $(MAKES)
91	(sed '1,/^# do not edit/!d' Makefile.in; \
92	set -e; for i in [a-z][a-z0-9]*.c; do \
93	    $(CC) -E $(DEFS) $(INCL) $$i | grep -v '[<>]' | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
94	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' \
95	    -e 's/o: \.\//o: /' -e p -e '}' ; \
96	done | sort -u) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
97	@$(EXPORT) make -f Makefile.in Makefile 1>&2
98
99# do not edit below this line - it is generated by 'make depend'
100postcat.o: ../../include/attr.h
101postcat.o: ../../include/iostuff.h
102postcat.o: ../../include/is_header.h
103postcat.o: ../../include/lex_822.h
104postcat.o: ../../include/mail_conf.h
105postcat.o: ../../include/mail_params.h
106postcat.o: ../../include/mail_proto.h
107postcat.o: ../../include/mail_queue.h
108postcat.o: ../../include/mail_version.h
109postcat.o: ../../include/msg.h
110postcat.o: ../../include/msg_vstream.h
111postcat.o: ../../include/rec_type.h
112postcat.o: ../../include/record.h
113postcat.o: ../../include/stringops.h
114postcat.o: ../../include/sys_defs.h
115postcat.o: ../../include/vbuf.h
116postcat.o: ../../include/vstream.h
117postcat.o: ../../include/vstring.h
118postcat.o: ../../include/vstring_vstream.h
119postcat.o: postcat.c
120