]>
Commit | Line | Data |
---|---|---|
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 024/113] Implement makefile dependencies on COPTS variable. | |
5 | ||
6 | --- | |
7 | .gitignore | 2 +- | |
8 | Makefile | 10 ++++++---- | |
9 | 2 files changed, 7 insertions(+), 5 deletions(-) | |
10 | ||
11 | diff --git a/.gitignore b/.gitignore | |
12 | index fcdbcbd135ae..23f11488ab4c 100644 | |
13 | --- a/.gitignore | |
14 | +++ b/.gitignore | |
15 | @@ -3,7 +3,7 @@ src/*.mo | |
16 | src/dnsmasq.pot | |
17 | src/dnsmasq | |
18 | src/dnsmasq_baseline | |
19 | -src/.configured | |
20 | +src/.copts_* | |
21 | contrib/wrt/dhcp_lease_time | |
22 | contrib/wrt/dhcp_release | |
23 | debian/base/ | |
24 | diff --git a/Makefile b/Makefile | |
25 | index c340f1c7b59a..5675f60c2036 100644 | |
26 | --- a/Makefile | |
27 | +++ b/Makefile | |
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 ' ') | |
34 | ||
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) | |
38 | ||
39 | mostly_clean : | |
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 | |
43 | ||
44 | clean : mostly_clean | |
45 | rm -f $(BUILDDIR)/dnsmasq_baseline | |
46 | @@ -139,8 +141,8 @@ bloatcheck : $(BUILDDIR)/dnsmasq_baseline mostly_clean all | |
47 | ||
48 | # rules below are targets in recusive makes with cwd=$(BUILDDIR) | |
49 | ||
50 | -.configured: $(hdrs) | |
51 | - @rm -f *.o | |
52 | +$(copts_conf): $(hdrs) | |
53 | + @rm -f *.o .copts_* | |
54 | @touch $@ | |
55 | ||
56 | $(objs:.o=.c) $(hdrs): | |
57 | @@ -149,7 +151,7 @@ $(objs:.o=.c) $(hdrs): | |
58 | .c.o: | |
59 | $(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $< | |
60 | ||
61 | -dnsmasq : .configured $(hdrs) $(objs) | |
62 | +dnsmasq : $(copts_conf) $(hdrs) $(objs) | |
63 | $(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS) | |
64 | ||
65 | dnsmasq.pot : $(objs:.o=.c) $(hdrs) | |
66 | -- | |
67 | 2.1.0 | |
68 |