Implement lightweight getaddrinfo_a wrappers.
[apps/pfixtools.git] / Makefile
index 558ab07..179fed8 100644 (file)
--- a/Makefile
+++ b/Makefile
 ##############################################################################
 
 include mk/cflags.mk
+CFLAGS += --std=gnu99 -D_GNU_SOURCE -D_FORTIFY_SOURCE=1
 
 PROGRAMS = postlicyd
 
 postlicyd_SOURCES = \
-               str.h buffer.h policy.h        \
-               str.c buffer.c policy.c        \
+               str.h buffer.h job.h postfix.h gai.h query.h \
+               str.c buffer.c job.c postfix.c gai.c         \
                postlicyd.c
 
-postlicyd_LIBADD = -ludns
+postlicyd_LIBADD = -lanl
 
 # RULES ###################################################################{{{
 
@@ -46,7 +47,7 @@ all: $(PROGRAMS)
 
 clean:
        $(RM) $(PROGRAMS)
-       $(RM) *.o
+       $(RM) .*.o
 
 distclean: clean
 
@@ -60,7 +61,7 @@ headers:
                ( echo "package headache not installed" ; exit 1 )
        @git ls-files | egrep '(\.h|\.c|Makefile|*\.mk)$$' | xargs -t headache $(HEADACHEOPTS)
 
-%.o: %.c Makefile
+.%.o: %.c Makefile
        $(CC) $(CFLAGS) -MMD -MT ".$*.d $@" -MF .$*.d -g -c -o $@ $<
 
 %.d: %.c Makefile
@@ -68,9 +69,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))))
 
 ###########################################################################}}}