blob: 4ab9d23bf75c7691b2e2ffb0ca9daab3ecb8f252 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 43b6e98c9c37afd0d914949dcff4eab81f5a995f Mon Sep 17 00:00:00 2001
2From: Brendan Le Foll <brendan.le.foll@intel.com>
3Date: Tue, 3 Mar 2015 11:42:57 +0000
4
5Upstream-Status: Inappropriate [OE-specific]
6
7Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8
9---
10 mDNSPosix/Makefile | 54 +++++++++++++++++++++++++-----------------------------
11 1 file changed, 25 insertions(+), 29 deletions(-)
12
13diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile
14index 4f98e90..8ac97ad 100755
15--- a/mDNSPosix/Makefile
16+++ b/mDNSPosix/Makefile
17@@ -50,6 +50,7 @@
18
19 LIBVERS = 1
20
21+POSIXDIR = ../mDNSPosix
22 COREDIR = ../mDNSCore
23 SHAREDDIR ?= ../mDNSShared
24 JDK = /usr/jdk
25@@ -58,11 +59,11 @@ CC = @cc
26 BISON = @bison
27 FLEX = @flex
28 ST = @strip
29-LD = ld -shared
30+LD =@LD
31 CP = cp
32 RM = rm
33 LN = ln -s -f
34-CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
35+CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
36 CFLAGS_PTHREAD =
37 LINKOPTS =
38 LINKOPTS_PTHREAD = -lpthread
39@@ -70,7 +71,7 @@ LDSUFFIX = so
40 JAVACFLAGS_OS = -fPIC -shared -ldns_sd
41
42 # Set up diverging paths for debug vs. prod builds
43-DEBUG=0
44+DEBUG?=1
45 ifeq ($(DEBUG),1)
46 CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
47 OBJDIR = objects/debug
48@@ -213,7 +214,7 @@ endif
49 endif
50 endif
51
52-CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
53+CFLAGS_BUILD = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
54
55 #############################################################################
56
57@@ -249,8 +250,7 @@ Daemon: setup $(BUILDDIR)/mdnsd
58 @echo "Responder daemon done"
59
60 $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
61- $(CC) -o $@ $+ $(LINKOPTS)
62- @$(STRIP) $@
63+ $(CC) -o $@ $+
64
65 # libdns_sd target builds the client library
66 libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
67@@ -259,22 +259,18 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
68 CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
69
70 $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
71- @$(LD) $(LINKOPTS) -o $@ $+
72- @$(STRIP) $@
73+ $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+
74
75-Clients: setup libdns_sd ../Clients/build/dns-sd
76+Clients: setup libdns_sd
77+ @$(MAKE) -C ../Clients DEBUG=${DEBUG}
78 @echo "Clients done"
79
80-../Clients/build/dns-sd:
81- @$(MAKE) -C ../Clients
82-
83 # nss_mdns target builds the Name Service Switch module
84 nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
85 @echo "Name Service Switch module done"
86
87 $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
88- @$(LD) $(LINKOPTS) -o $@ $+
89- @$(STRIP) $@
90+ $(LD) -shared $(LINKOPTS) -o $@ $+
91
92 #############################################################################
93
94@@ -470,55 +466,55 @@ dnsextd: setup $(BUILDDIR)/dnsextd
95 @echo "dnsextd done"
96
97 $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
98- $(CC) $+ -o $@ $(LINKOPTS)
99+ $(CC) $+ -o $@
100
101 $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
102- $(CC) $+ -o $@ $(LINKOPTS)
103+ $(CC) $+ -o $@
104
105 $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
106- $(CC) $+ -o $@ $(LINKOPTS)
107+ $(CC) $+ -o $@
108
109 $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
110- $(CC) $+ -o $@ $(LINKOPTS)
111+ $(CC) $+ -o $@
112
113 $(OBJDIR)/Identify.c.o: $(COREDIR)/mDNS.c # Note: Identify.c textually imports mDNS.c
114
115 $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
116- $(CC) $+ -o $@ $(LINKOPTS)
117+ $(CC) $+ -o $@
118
119 $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c
120
121 $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
122- $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)
123+ $(CC) $+ -o $@ $(LINKOPTS_PTHREAD)
124
125 #############################################################################
126
127 # Implicit rules
128 $(OBJDIR)/%.c.o: %.c
129- $(CC) $(CFLAGS) -c -o $@ $<
130+ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
131
132 $(OBJDIR)/%.c.o: $(COREDIR)/%.c
133- $(CC) $(CFLAGS) -c -o $@ $<
134+ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
135
136 $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
137- $(CC) $(CFLAGS) -c -o $@ $<
138+ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
139
140 $(OBJDIR)/%.c.threadsafe.o: %.c
141- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
142+ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
143
144 $(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c
145- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
146+ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
147
148 $(OBJDIR)/%.c.so.o: %.c
149- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
150+ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $<
151
152 $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
153- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
154+ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $<
155
156 $(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y
157 $(BISON) -o $(OBJDIR)/$*.c -d $<
158- $(CC) $(CFLAGS) -c -o $@ $(OBJDIR)/$*.c
159+ $(CC) $(CFLAGS_BUILD) -c -o $@ $(OBJDIR)/$*.c
160
161 $(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l
162 $(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $<
163- $(CC) $(CFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
164+ $(CC) $(CFLAGS_BUILD) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
165--
1662.9.5
167