SHELL	= /bin/sh
SRCS	= smtp-source.c smtp-sink.c qmqp-source.c qmqp-sink.c
OBJS	= smtp-source.o smtp-sink.o qmqp-source.o qmqp-sink.o
HDRS	= 
TESTSRC	= 
WARN	= -W -Wformat -Wimplicit -Wmissing-prototypes \
	-Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
	-Wunused
DEFS	= -I. -I$(INC_DIR) -D$(SYSTYPE)
CFLAGS	= $(DEBUG) $(OPT) $(DEFS)
TESTPROG= 
INC_DIR	= ../../include
PROG	= smtp-source smtp-sink qmqp-source qmqp-sink
LIBS	= ../../lib/libglobal.a ../../lib/libutil.a

.c.o:;	$(CC) $(CFLAGS) -c $*.c

all:	$(PROG)

Makefile: Makefile.in
	(set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../../makedefs && cat $?) >$@

smtp-sink: smtp-sink.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS)

smtp-source: smtp-source.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ smtp-source.o $(LIBS) $(SYSLIBS)

qmqp-sink: qmqp-sink.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ qmqp-sink.o $(LIBS) $(SYSLIBS)

qmqp-source: qmqp-source.o $(LIBS)
	$(CC) $(CFLAGS) -o $@ qmqp-source.o $(LIBS) $(SYSLIBS)

test:	$(TESTPROG)

tests:	test

update: ../../bin/smtp-source ../../bin/smtp-sink ../../bin/qmqp-source

../../bin/smtp-source: smtp-source
	cp $? $@

../../bin/smtp-sink: smtp-sink
	cp $? $@

../../bin/qmqp-source: qmqp-source
	cp $? $@

../../bin/qmqp-sink: qmqp-sink
	cp $? $@

printfck: $(OBJS) $(PROG)
	rm -rf printfck
	mkdir printfck
	sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
	set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
	cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`

lint:
	lint $(DEFS) $(SRCS) $(LINTFIX)

clean:
	rm -f *.o *core $(PROG) $(TESTPROG) junk
	rm -rf printfck

tidy:	clean

depend: $(MAKES)
	(sed '1,/^# do not edit/!d' Makefile.in; \
	set -e; for i in [a-z][a-z0-9]*.c; do \
	    $(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \
	done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
	@$(EXPORT) make -f Makefile.in Makefile 1>&2

# do not edit below this line - it is generated by 'make depend'
qmqp-sink.o: qmqp-sink.c
qmqp-sink.o: ../../include/sys_defs.h
qmqp-sink.o: ../../include/msg.h
qmqp-sink.o: ../../include/vstring.h
qmqp-sink.o: ../../include/vbuf.h
qmqp-sink.o: ../../include/vstream.h
qmqp-sink.o: ../../include/listen.h
qmqp-sink.o: ../../include/iostuff.h
qmqp-sink.o: ../../include/events.h
qmqp-sink.o: ../../include/mymalloc.h
qmqp-sink.o: ../../include/msg_vstream.h
qmqp-sink.o: ../../include/netstring.h
qmqp-sink.o: ../../include/qmqp_proto.h
qmqp-source.o: qmqp-source.c
qmqp-source.o: ../../include/sys_defs.h
qmqp-source.o: ../../include/msg.h
qmqp-source.o: ../../include/msg_vstream.h
qmqp-source.o: ../../include/vstream.h
qmqp-source.o: ../../include/vbuf.h
qmqp-source.o: ../../include/vstring.h
qmqp-source.o: ../../include/get_hostname.h
qmqp-source.o: ../../include/split_at.h
qmqp-source.o: ../../include/connect.h
qmqp-source.o: ../../include/iostuff.h
qmqp-source.o: ../../include/mymalloc.h
qmqp-source.o: ../../include/events.h
qmqp-source.o: ../../include/find_inet.h
qmqp-source.o: ../../include/netstring.h
qmqp-source.o: ../../include/mail_date.h
qmqp-source.o: ../../include/qmqp_proto.h
smtp-sink.o: smtp-sink.c
smtp-sink.o: ../../include/sys_defs.h
smtp-sink.o: ../../include/msg.h
smtp-sink.o: ../../include/vstring.h
smtp-sink.o: ../../include/vbuf.h
smtp-sink.o: ../../include/vstream.h
smtp-sink.o: ../../include/vstring_vstream.h
smtp-sink.o: ../../include/get_hostname.h
smtp-sink.o: ../../include/listen.h
smtp-sink.o: ../../include/iostuff.h
smtp-sink.o: ../../include/events.h
smtp-sink.o: ../../include/mymalloc.h
smtp-sink.o: ../../include/msg_vstream.h
smtp-sink.o: ../../include/stringops.h
smtp-sink.o: ../../include/smtp_stream.h
smtp-source.o: smtp-source.c
smtp-source.o: ../../include/sys_defs.h
smtp-source.o: ../../include/msg.h
smtp-source.o: ../../include/msg_vstream.h
smtp-source.o: ../../include/vstream.h
smtp-source.o: ../../include/vbuf.h
smtp-source.o: ../../include/vstring.h
smtp-source.o: ../../include/vstring_vstream.h
smtp-source.o: ../../include/get_hostname.h
smtp-source.o: ../../include/split_at.h
smtp-source.o: ../../include/connect.h
smtp-source.o: ../../include/iostuff.h
smtp-source.o: ../../include/mymalloc.h
smtp-source.o: ../../include/events.h
smtp-source.o: ../../include/find_inet.h
smtp-source.o: ../../include/smtp_stream.h
smtp-source.o: ../../include/mail_date.h
