X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=blobdiff_plain;f=Makefile;h=88e599de711eee90f184a9ff7a110c9b04691cb3;hp=49ac809f6fea213298efd381963f42f7a8516e0c;hb=7961b29b3aae8dee45748bf66e30a45c76a47272;hpb=6276d460a9deb4bb530cefdaa0a43b62a8ed5854 diff --git a/Makefile b/Makefile index 49ac809..88e599d 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,48 +29,56 @@ # THE POSSIBILITY OF SUCH DAMAGE. # ############################################################################## -include mk/cflags.mk +prefix ?= /usr/local -PROGRAMS = postlicyd +PROGRAMS = postlicyd pfix-srsd +LIBS = common +SUBDIRS = $(LIBS) $(PROGRAMS) -postlicyd_SOURCES = \ - str.h buffer.h policy.h \ - str.c buffer.c policy.c \ - postlicyd.c - -postlicyd_LIBADD = -ludns +CLEAN_TARGETS = $(addprefix clean-,$(SUBDIRS)) +DISTCLEAN_TARGETS = $(addprefix distclean-,$(SUBDIRS)) +INSTALL_TARGETS = $(addprefix install-,$(SUBDIRS)) # RULES ###################################################################{{{ -all: $(PROGRAMS) +all: $(SUBDIRS) + +clean: $(CLEAN_TARGETS) + +distclean: $(DISTCLEAN_TARGETS) + +install: all $(INSTALL_TARGETS) -clean: - $(RM) $(PROGRAMS) - $(RM) .*.o +$(PROGRAMS): $(LIBS) -distclean: clean +$(SUBDIRS): %: + make -C $@ all -tags: .tags -.tags: $(shell git ls-files | egrep '\.[hc]$$') - ctags -o $@ $^ +$(CLEAN_TARGETS): clean-%: + make -C $* clean -headers: HEADACHEOPTS=-c mk/headache.cfg -h COPYING -headers: - @which headache > /dev/null || \ - ( echo "package headache not installed" ; exit 1 ) - @git ls-files | egrep '(\.h|\.c|Makefile|*\.mk)$$' | xargs -t headache $(HEADACHEOPTS) +$(DISTCLEAN_TARGETS): distclean-%: + make -C $* distclean -.%.o: %.c Makefile - $(CC) $(CFLAGS) -MMD -MT ".$*.d $@" -MF .$*.d -g -c -o $@ $< +$(INSTALL_TARGETS): install-%: % install-dir + make -C $* install -%.d: %.c Makefile - $(CC) $(CFLAGS) -MM -MT ".$*.d $@" -MF .$*.d $< +install-postlicyd: install-postlicyd-tools install-postlicyd-conf +install-dir: + install -d $(DESTDIR)$(prefix)/sbin + install -d $(DESTDIR)/etc/pfixtools -.SECONDEXPANSION: +install-postlicyd-tools: + install tools/postlicyd-rsyncrbl $(DESTDIR)$(prefix)/bin/postlicyd-rsyncrbl + install tools/postgrey2postlicyd $(DESTDIR)$(prefix)/bin/postgrey2postlicyd + install tools/rbldns2postlicyd $(DESTDIR)$(prefix)/bin/rbldns2postlicyd -$(PROGRAMS): $$(patsubst %.c,.%.o,$$($$@_SOURCES)) Makefile - $(CC) -o $@ $(CFLAGS) $(filter %.o,$^) $(LDFLAGS) $($@_LIBADD) $(filter %.a,$^) +install-postlicyd-conf: + install example/postlicyd.conf $(DESTDIR)/etc/pfixtools/postlicyd.example.conf + install example/postlicyd-rsyncrbl.conf $(DESTDIR)/etc/pfixtools/postlicyd-rsyncrbl.example.conf --include $(foreach p,$(PROGRAMS),$(patsubst %.c,%.d,$(filter %.c,$p_SOURCES))) +.PHONY: clean distclean install install-dir $(SUBDIRS) $(CLEAN_TARGETS) \ + $(DISTCLEAN_TARGETS) $(INSTALL_TARGETS) install-postlicyd-tools \ + install-postlicyd-conf ###########################################################################}}}