--- Makefile.tmpl.orig 2005-11-27 21:52:05.000000000 +0100 +++ Makefile.tmpl 2014-03-27 20:44:51.000000000 +0100 @@ -10,7 +10,7 @@ # #--------------------------------------------------------------------* -CC = gcc +CC?= gcc SRCS = dns.c dnsbl.c hndlrs.c misc.c smisc.c mx.c smtp.c inet.c ifi.c bwlist.c badext.c OBJS = ${SRCS:.c=.o} INCLUDES = ${SRCS:.c=.h} spamilter.h @@ -26,17 +26,17 @@ INCLUDEDIR = -I. -I${SMDIR}/include INCLUDEDIR += -CFLAGS = -Wall -pthread +CFLAGS += -Wall -pthread #CFLAGS += -ggdb -g3 CFLAGS += OFLAGS = -LDFLAGS = +LDFLAGS += -LIBS = -lmilter +LIBS += -lmilter LIBS += -lsmutil -lresolv -ldb LIBS += -lsmutil -lresolv -lsocket -lnsl -lxnet -lpthread LIBS += -LIBDIRS = -L${SMDIR}/libmilter +LIBDIRS += -L${SMDIR}/libmilter LIBDIRS = -L${SMDIR}/libmilter LIBDIRS = -L${SMOBJDIR}/libmilter -L${SMOBJDIR}/libsmutil -L/usr/lib LIBDIRS = -L${SMOBJDIR}/libmilter -L${SMOBJDIR}/libsmutil -L/usr/lib @@ -62,45 +62,45 @@ clean: rm -f *.o *core spamilter dnsblchk dnsblupd mxlookup iflookup -install: spamilter install-dnsblchk install-dnsblupd install-mxlookup - install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} spamilter ${BINDIR} +install: spamilter install-dnsblchk install-dnsblupd install-mxlookup + install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} spamilter ${DESTDIR}${BINDIR} install-dnsblchk: dnsblchk - install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} dnsblchk ${BINDIR} + install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} dnsblchk ${DESTDIR}${BINDIR} install-dnsblupd: dnsblupd - install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} dnsblupd ${BINDIR} + install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} dnsblupd ${DESTDIR}${BINDIR} install-mxlookup: mxlookup - install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} mxlookup ${BINDIR} + install -c -m ${BINMODE} -g ${BINGRP} -o ${BINOWN} mxlookup ${DESTDIR}${BINDIR} install-ipfwmtad: ipfwmtad - install -c -m 0500 -g ${BINGRP} -o ${BINOWN} ipfwmtad ${BINDIR} + install -c -m 0500 -g ${BINGRP} -o ${BINOWN} ipfwmtad ${DESTDIR}${BINDIR} install-startup: - if [ ! -e ${RCDIR}/${RCSHELL} ]; then install -c -m ${RCMODE} -g ${BINGRP} -o ${BINOWN} ${RCSHELL} ${RCDIR}; fi + if [ ! -e ${RCDIR}/${RCSHELL} ]; then install -c -m ${RCMODE} -g ${BINGRP} -o ${BINOWN} ${RCSHELL} ${DESTDIR}${RCDIR}; fi tar: clean cd ..; tar --exclude CVS -cfvz spamilter.tgz spamilter/* spamilter: Makefile ${SRCS} spamilter.o ${OBJS} ${INCLUDES} - ${CC} ${CFLAGS} -o spamilter spamilter.o ${OBJS} ${LIBDIRS} ${LIBS} + ${CC} ${CFLAGS} -o spamilter spamilter.o ${OBJS} ${LDFLAGS} ${LIBDIRS} ${LIBS} dnsblchk: Makefile ${SRCS} dnsblchk.o ${OBJS} ${INCLUDES} dnsblchk.c - ${CC} ${CFLAGS} -o dnsblchk dnsblchk.o dnsbl.o dns.o smisc.o misc.o mx.o smtp.o inet.o ifi.o ${LIBDIRS} ${LIBS} + ${CC} ${CFLAGS} -o dnsblchk dnsblchk.o dnsbl.o dns.o smisc.o misc.o mx.o smtp.o inet.o ifi.o ${LDFLAGS} ${LIBDIRS} ${LIBS} # dnsblupd is for use with the companion shell script blupd as an Exec action dnsblupd: Makefile dnsblupd.c dnsupdate.c dns.c dnsblupd.o dnsupdate.o dns.o dnsupdate.h dns.h config.h - ${CC} ${CFLAGS} -o dnsblupd dnsblupd.o dnsupdate.o dns.o ${LIBDIRS} ${LIBS} + ${CC} ${CFLAGS} -o dnsblupd dnsblupd.o dnsupdate.o dns.o ${LDFLAGS} ${LIBDIRS} ${LIBS} ipfwmtad: Makefile ipfwmtad.c ipfw_direct.c inet.c misc.c uam.o ipfwmtad.o ipfw_direct.o inet.o misc.o uam.o key.o inet.h misc.h uam.h key.h config.h ${CC} ${CFLAGS} -o ipfwmtad ipfwmtad.o ipfw_direct.o inet.o misc.o uam.o key.o -lcrypto -lcrypt mxlookup: Makefile mxlookup.c mx.c mxlookup.o mx.o mx.h - ${CC} ${CFLAGS} -o mxlookup mxlookup.o mx.o ${LIBDIRS} ${LIBS} + ${CC} ${CFLAGS} -o mxlookup mxlookup.o mx.o ${LDFLAGS} ${LIBDIRS} ${LIBS} iflookup: Makefile iflookup.c ifi.c iflookup.o ifi.o ifi.h - ${CC} ${CFLAGS} -o iflookup iflookup.o ifi.o ${LIBDIRS} ${LIBS} + ${CC} ${CFLAGS} -o iflookup iflookup.o ifi.o ${LDFLAGS} ${LIBDIRS} ${LIBS} .c.o: Makefile ${INCLUDES} ${CC} ${CFLAGS} ${OFLAGS} ${INCLUDEDIR} -c $*.c