1 From 81c538efcebfce2ce4a1d3a420b6c885b8f08df9 Mon Sep 17 00:00:00 2001
2 From: Yousong Zhou <yszhou4tech@gmail.com>
3 Date: Sat, 3 Jan 2015 16:36:14 +0000
4 Subject: [PATCH 24/87] Implement makefile dependencies on COPTS variable.
8 Makefile | 10 ++++++----
9 2 files changed, 7 insertions(+), 5 deletions(-)
11 diff --git a/.gitignore b/.gitignore
12 index fcdbcbd135ae..23f11488ab4c 100644
15 @@ -3,7 +3,7 @@ src/*.mo
21 contrib/wrt/dhcp_lease_time
22 contrib/wrt/dhcp_release
24 diff --git a/Makefile b/Makefile
25 index c340f1c7b59a..5675f60c2036 100644
28 @@ -64,6 +64,8 @@ nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG
29 gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
30 sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
31 version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
32 +copts_conf = .copts_$(shell $(CC) -DDNSMASQ_COMPILE_OPTS $(COPTS) -E $(top)/$(SRC)/dnsmasq.h | \
33 + ( md5sum 2>/dev/null || md5 ) | cut -f 1 -d ' ')
35 objs = cache.o rfc1035.o util.o option.o forward.o network.o \
36 dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
37 @@ -83,7 +85,7 @@ all : $(BUILDDIR)
40 rm -f $(BUILDDIR)/*.mo $(BUILDDIR)/*.pot
41 - rm -f $(BUILDDIR)/.configured $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq
42 + rm -f $(BUILDDIR)/.copts_* $(BUILDDIR)/*.o $(BUILDDIR)/dnsmasq.a $(BUILDDIR)/dnsmasq
45 rm -f $(BUILDDIR)/dnsmasq_baseline
46 @@ -139,8 +141,8 @@ bloatcheck : $(BUILDDIR)/dnsmasq_baseline mostly_clean all
48 # rules below are targets in recusive makes with cwd=$(BUILDDIR)
52 +$(copts_conf): $(hdrs)
56 $(objs:.o=.c) $(hdrs):
57 @@ -149,7 +151,7 @@ $(objs:.o=.c) $(hdrs):
59 $(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
61 -dnsmasq : .configured $(hdrs) $(objs)
62 +dnsmasq : $(copts_conf) $(hdrs) $(objs)
63 $(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
65 dnsmasq.pot : $(objs:.o=.c) $(hdrs)