# DO NOT EDIT MAKEFILE; EDIT MAKEFILE.IN INSTEAD
# Makefile.in for amavisd-new helper-progs

# Needed for autoconf to behave properly...
AMAVISUSER=@AMAVISUSER@
prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
DESTDIR=$(sbindir)

MINCLUDE=@MINCLUDE@
# TODO : use some VERSION variable DEFS=  -DVERSION=\"@VERSION@ and in the 2 .c helper programs
# additional flags
DEFS=-D_POSIX_PTHREAD_SEMANTICS 

all: amavis-milter amavis

amavis-milter.c:
	ln -sf amavis-milter-based-on-1.1.2.3.2.40-v2.c amavis-milter.c

amavis-milter: amavis-milter.o 
	@CC@ @CFLAGS@ @LDFLAGS@ @PTHREAD_FLAG@ -o amavis-milter amavis-milter.o @LIBMILTER@ @LIBS@

amavis-milter.o: amavis-milter.c 
	@CC@ @CFLAGS@ @PTHREAD_FLAG@ $(DEFS) $(MINCLUDE) -c -o amavis-milter.o amavis-milter.c

amavis: amavis.o
	@CC@ @CFLAGS@ @LDFLAGS@ -o amavis amavis.o @LIBS@

amavis.o: amavis.c
	@CC@ @CFLAGS@   $(DEFS) -c -o amavis.o amavis.c

install:
	-test -f amavis-milter && install -o root -m 755 amavis-milter $(DESTDIR)
	-test -f amavis && install -o root -m 755 amavis $(DESTDIR)

clean:: FORCE
	rm -f *~ *.o amavis-milter amavis
	[ -L amavis-milter.c ] && rm -f amavis-milter.c

distclean:: clean
	rm -f config.log config.status Makefile config.cache config.h amavis-milter amavis

FORCE:

.phony: FORCE
