X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=Makefile;h=e4f02ff21bb367ab989ae9a8513868219d38acf3;hb=88b8b932308215c770c4e9aae96a098421b8a477;hp=329455c28856ffeeb76d7992703af94f59cdf192;hpb=b8b6ac5a6d545a000077eed217c221c7eeda2a84;p=apps%2Fpfixtools.git diff --git a/Makefile b/Makefile index 329455c..e4f02ff 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 # # ~~~~~~~~~ # # ________________________________________________________________________ # # # @@ -16,80 +16,52 @@ # products derived from this software without specific prior written # # permission. # # # -# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS # -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # -# THE POSSIBILITY OF SUCH DAMAGE. # +# THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS # +# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # +# DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY # +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # +# POSSIBILITY OF SUCH DAMAGE. # +# # +# Copyright (c) 2006-2008 the Authors # +# see AUTHORS and source files for details # ############################################################################## -LDFLAGS += -Wl,--warn-common - -include mk/cflags.mk - -CFLAGS += --std=gnu99 -D_GNU_SOURCE - -PROGRAMS = postlicyd srsd -TESTS = tst-rbl - -GENERATED = tokens.h tokens.c - -postlicyd_SOURCES = \ - str.h buffer.h daemon.h rbl.h postfix.h \ - str.c buffer.c daemon.c rbl.c postfix.c \ - postlicyd.c $(GENERATED) -postlicyd_LIBADD = -lpthread - -srsd_SOURCES = \ - str.h daemon.h srsd.h \ - str.c daemon.c srsd.c -srsd_LIBADD = -lsrs2 - -tst-rbl_SOURCES = tst-rbl.c +PROGDIRS = postlicyd pfix-srsd +LIBDIRS = common +SUBDIRS = $(LIBDIRS) $(PROGDIRS) # RULES ###################################################################{{{ -all: $(PROGRAMS) $(GENERATED) | $(GENERATED) +all clean distclean doc install: %: %-recurse -clean: - $(RM) $(PROGRAMS) - $(RM) .*.o .*.dep +%-recurse: + @set -e $(foreach dir,$(SUBDIRS),; $(MAKE) -C $(dir) $*) -distclean: clean - $(RM) $(GENERATED) +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 -tags: .tags -.tags: $(shell git ls-files | egrep '\.[hc]$$') - ctags -o $@ $^ +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 -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) +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 -%.h: %.sh - ./$< $@ || ($(RM) $@; exit 1) - -%.c: %.sh - ./$< $@ || ($(RM) $@; exit 1) - -.%.o: %.c Makefile - $(CC) $(CFLAGS) -MMD -MT ".$*.dep $@" -MF .$*.dep -g -c -o $@ $< - -.%.dep: .%.o - -.SECONDEXPANSION: - -$(PROGRAMS) $(TESTS): $$(patsubst %.c,.%.o,$$($$@_SOURCES)) Makefile - $(CC) -o $@ $(CFLAGS) $($@_CFLAGS) $(filter %.o,$^) $(LDFLAGS) $($@_LIBADD) $(filter %.a,$^) - --include $(foreach p,$(PROGRAMS) $(TESTS),$(patsubst %.c,.%.dep,$(filter %.c,$($p_SOURCES)))) +.PHONY: clean distclean install install-% %-recurse ###########################################################################}}} + +include mk/common.mk