X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=Makefile;h=2f96388a09fad913bcbb1458bf700dd67087b194;hb=838faa794a5feec77680499eb4e71bf8a92a4509;hp=9170135a353774f4a73186e83bc04a9cd964492c;hpb=9a4efa4f0dc893f243ee69d1b20f024666ca943d;p=apps%2Fpfixtools.git diff --git a/Makefile b/Makefile index 9170135..2f96388 100644 --- a/Makefile +++ b/Makefile @@ -30,15 +30,18 @@ ############################################################################## include mk/cflags.mk +CFLAGS += --std=gnu99 -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 PROGRAMS = postlicyd +GENERATED = tokens.h tokens.c + postlicyd_SOURCES = \ - str.h buffer.h policy.h \ - str.c buffer.c policy.c \ - postlicyd.c + str.h buffer.h job.h postfix.h gai.h \ + str.c buffer.c job.c postfix.c gai.c \ + postlicyd.c $(GENERATED) -postlicyd_LIBADD = -ludns +postlicyd_LIBADD = -lanl # RULES ###################################################################{{{ @@ -46,9 +49,14 @@ all: $(PROGRAMS) clean: $(RM) $(PROGRAMS) - $(RM) *.o + $(RM) .*.o distclean: clean + $(RM) $(GENERATED) + +tags: .tags +.tags: $(shell git ls-files | egrep '\.[hc]$$') + ctags -o $@ $^ headers: HEADACHEOPTS=-c mk/headache.cfg -h COPYING headers: @@ -56,7 +64,13 @@ headers: ( echo "package headache not installed" ; exit 1 ) @git ls-files | egrep '(\.h|\.c|Makefile|*\.mk)$$' | xargs -t headache $(HEADACHEOPTS) -%.o: %.c Makefile +%.c: %.sh + ./$< $@ || ($(RM) $@; exit 1) + +%.h: %.sh + ./$< $@ || ($(RM) $@; exit 1) + +.%.o: %.c Makefile $(CC) $(CFLAGS) -MMD -MT ".$*.d $@" -MF .$*.d -g -c -o $@ $< %.d: %.c Makefile @@ -64,9 +78,9 @@ headers: .SECONDEXPANSION: -$(PROGRAMS): $$(patsubst %.c,%.o,$$($$@_SOURCES)) Makefile +$(PROGRAMS): $$(patsubst %.c,.%.o,$$($$@_SOURCES)) Makefile $(CC) -o $@ $(CFLAGS) $(filter %.o,$^) $(LDFLAGS) $($@_LIBADD) $(filter %.a,$^) --include $(foreach p,$(PROGRAMS),$(patsubst %.c,%.d,$(filter %.c,$p_SOURCES))) +-include $(foreach p,$(PROGRAMS),$(patsubst %.c,.%.d,$(filter %.c,$($p_SOURCES)))) ###########################################################################}}}