Begin work on the greylist module.
[apps/pfixtools.git] / Makefile
index 948c575..3dcb94c 100644 (file)
--- a/Makefile
+++ b/Makefile
 #  THE POSSIBILITY OF SUCH DAMAGE.                                           #
 ##############################################################################
 
+all:
+
 LDFLAGS += -Wl,--warn-common
 
 include mk/cflags.mk
+include mk/tc.mk
 
 CFLAGS += --std=gnu99 -D_GNU_SOURCE
+prefix ?= /usr/local
 
-PROGRAMS = postlicyd srsd
+PROGRAMS = postlicyd pfix-srsd
 TESTS    = tst-rbl
 
 GENERATED = tokens.h tokens.c
 
-postlicyd_SOURCES = common.c str.c buffer.c daemon.c rbl.c postfix.c \
-                   $(GENERATED) postlicyd.c
-postlicyd_LIBADD = -lpthread
+postlicyd_SOURCES = common.c threads.c str.c buffer.c \
+                   greylist.c rbl.c \
+                   $(GENERATED) postfix.c main-postlicyd.c
+postlicyd_LIBADD = -lpthread $(TC_LIBS)
+postlicyd_CFLAGS = $(TC_CFLAGS)
 
-srsd_SOURCES = common.c buffer.c str.c daemon.c srsd.c
-srsd_LIBADD = -lsrs2
+pfix-srsd_SOURCES = common.c epoll.c buffer.c str.c main-srsd.c
+pfix-srsd_LIBADD = -lsrs2
 
 tst-rbl_SOURCES = tst-rbl.c
 
+install: all
+       install -d $(DESTDIR)$(prefix)/sbin
+       install $(PROGRAMS) $(DESTDIR)$(prefix)/sbin
+       install -d $(DESTDIR)/etc/pfixtools
+
 # RULES ###################################################################{{{
 
-all: $(PROGRAMS) $(GENERATED) | $(GENERATED)
+all: $(GENERATED) $(PROGRAMS) | $(GENERATED)
 
 clean:
        $(RM) $(PROGRAMS) $(TESTS) .*.o .*.dep
@@ -63,7 +74,7 @@ tags: .tags
 .tags: $(shell git ls-files | egrep '\.[hc]$$')
        ctags -o $@ $^
 
-headers: HEADACHEOPTS=-c mk/headache.cfg -h COPYING
+headers: HEADACHEOPTS=-c mk/headache.cfg -h mk/COPYING
 headers:
        @which headache > /dev/null || \
                ( echo "package headache not installed" ; exit 1 )