X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=Makefile;h=e4f02ff21bb367ab989ae9a8513868219d38acf3;hb=88b8b932308215c770c4e9aae96a098421b8a477;hp=7fb32354174bbca386cf3b044df85908ed0f3b6d;hpb=8ca147e634f83b185dd4cddebde78878a69f315f;p=apps%2Fpfixtools.git diff --git a/Makefile b/Makefile index 7fb3235..e4f02ff 100644 --- a/Makefile +++ b/Makefile @@ -32,44 +32,23 @@ # see AUTHORS and source files for details # ############################################################################## -prefix ?= /usr/local - -PROGRAMS = postlicyd pfix-srsd -LIBS = common -SUBDIRS = $(LIBS) $(PROGRAMS) - -CLEAN_TARGETS = $(addprefix clean-,$(SUBDIRS)) -DISTCLEAN_TARGETS = $(addprefix distclean-,$(SUBDIRS)) -INSTALL_TARGETS = $(addprefix install-,$(SUBDIRS)) +PROGDIRS = postlicyd pfix-srsd +LIBDIRS = common +SUBDIRS = $(LIBDIRS) $(PROGDIRS) # RULES ###################################################################{{{ -all: $(SUBDIRS) - -clean: $(CLEAN_TARGETS) - -distclean: $(DISTCLEAN_TARGETS) - -install: all $(INSTALL_TARGETS) +all clean distclean doc install: %: %-recurse -$(PROGRAMS): $(LIBS) +%-recurse: + @set -e $(foreach dir,$(SUBDIRS),; $(MAKE) -C $(dir) $*) -$(SUBDIRS): %: - make -C $@ all - -$(CLEAN_TARGETS): clean-%: - make -C $* clean - -$(DISTCLEAN_TARGETS): distclean-%: - make -C $* distclean - -$(INSTALL_TARGETS): install-%: % install-dir - make -C $* install - -install-postlicyd: install-postlicyd-tools install-postlicyd-conf +install-recurse: install-dir +install: install-postlicyd-tools install-postlicyd-conf install-dir: install -d $(DESTDIR)$(prefix)/sbin install -d $(DESTDIR)$(prefix)/bin + install -d $(DESTDIR)$(prefix)/share/doc/pfixtools install -d $(DESTDIR)/etc/pfixtools install-postlicyd-tools: @@ -81,8 +60,8 @@ install-postlicyd-conf: install -m 640 example/postlicyd.conf $(DESTDIR)/etc/pfixtools/postlicyd.example.conf install -m 640 example/postlicyd-rsyncrbl.conf $(DESTDIR)/etc/pfixtools/postlicyd-rsyncrbl.example.conf -.PHONY: clean distclean install install-dir $(SUBDIRS) $(CLEAN_TARGETS) \ - $(DISTCLEAN_TARGETS) $(INSTALL_TARGETS) install-postlicyd-tools \ - install-postlicyd-conf +.PHONY: clean distclean install install-% %-recurse ###########################################################################}}} + +include mk/common.mk