X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=Makefile;h=23ffcd1e71e69f6071b42e041d44bdd493590373;hb=e79fdf45f5b9b14a452c9fe067e827d6a7d5e87d;hp=109daac28a626bcde20dc876eb062a12c7a7c77e;hpb=59dfdaa70d58d1c7366c9cb2bdb82e921e8cbc16;p=apps%2Fpfixtools.git diff --git a/Makefile b/Makefile index 109daac..23ffcd1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ############################################################################## -# postlicyd: a postfix policy daemon with a lot of features # +# pfixtools: a collection of postfix related tools # # ~~~~~~~~~ # # ________________________________________________________________________ # # # @@ -29,33 +29,40 @@ # THE POSSIBILITY OF SUCH DAMAGE. # ############################################################################## +all: + LDFLAGS += -Wl,--warn-common include mk/cflags.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 = str.c buffer.c daemon.c rbl.c postfix.c \ - postlicyd.c $(GENERATED) +postlicyd_SOURCES = common.c threads.c str.c buffer.c rbl.c \ + $(GENERATED) postfix.c main-postlicyd.c postlicyd_LIBADD = -lpthread -srsd_SOURCES = 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) - $(RM) .*.o .*.dep + $(RM) $(PROGRAMS) $(TESTS) .*.o .*.dep distclean: clean $(RM) $(GENERATED) @@ -64,7 +71,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 ) @@ -83,8 +90,8 @@ headers: .SECONDEXPANSION: -$(PROGRAMS) $(TESTS): $$(patsubst %.c,.%.o,$$($$@_SOURCES)) Makefile - $(CC) -o $@ $(CFLAGS) $($@_CFLAGS) $(filter %.o,$^) $(LDFLAGS) $($@_LIBADD) $(filter %.a,$^) +$(PROGRAMS) $(TESTS): $$(patsubst %.c,.%.o,$$($$@_SOURCES)) Makefile common.ld + $(CC) -o $@ $(CFLAGS) $($@_CFLAGS) $(filter %.ld,$^) $(filter %.o,$^) $(LDFLAGS) $($@_LIBADD) $(filter %.a,$^) -include $(foreach p,$(PROGRAMS) $(TESTS),$(patsubst %.c,.%.dep,$(filter %.c,$($p_SOURCES))))