aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch
blob: 1ebd95ea175a138769280025efab7e1a255d843c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
1)add -fPIC for $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
2)add sub target for subdirs-all, and those dependencies below
  pppd plugin directory build depends on $(IPPOOL_RPC_STEM)_xdr.o 
$(IPPOOL_RPC_STEM)_client.o ippool_rpc.h

  ippoold depends on libusl
  ippoolconfig depends on libcli

  $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o 
$(IPPOOL_RPC_STEM)_server.o *.o in main directory depends on ippool_rpc.h
as those all directly or indirectly include ippool_rpc.h which is 
dynamically generated by rpcgen

to make parallel make working.
3)include dependency files for pppd.

Upstream-Status: Pending

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
diff --git a/Makefile b/Makefile
index 73aa72f..4f7af1d 100644
--- a/Makefile
+++ b/Makefile
@@ -106,14 +106,14 @@ all:			generated-files $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o \
 			subdirs-all $(PROGS.sbin) $(PROGS.bin)
 
 # Compile without -Wall because rpcgen-generated code is full of warnings
-$(IPPOOL_RPC_STEM)_xdr.o:	$(IPPOOL_RPC_STEM)_xdr.c
-			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_xdr.o:	$(IPPOOL_RPC_STEM)_xdr.c $(IPPOOL_RPC_STEM).h
+			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
 
-$(IPPOOL_RPC_STEM)_client.o:	$(IPPOOL_RPC_STEM)_client.c
-			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_client.o:	$(IPPOOL_RPC_STEM)_client.c $(IPPOOL_RPC_STEM).h
+			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
 
-$(IPPOOL_RPC_STEM)_server.o:	$(IPPOOL_RPC_STEM)_server.c
-			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
+$(IPPOOL_RPC_STEM)_server.o:	$(IPPOOL_RPC_STEM)_server.c $(IPPOOL_RPC_STEM).h
+			$(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
 
 $(IPPOOL_RPC_STEM)_xdr.c:	$(IPPOOL_RPC_STEM).x
 			-$(RM) $@
@@ -136,8 +136,12 @@ $(IPPOOL_RPC_STEM).h:	$(IPPOOL_RPC_STEM).x
 
 generated-files:	$(RPC_FILES)
 
-subdirs-all:
-			@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
+subdirs-all:	$(patsubst %,%-dir, $(SUBDIRS))
+
+pppd-dir: $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o $(IPPOOL_RPC_STEM).h
+
+$(patsubst %,%-dir,$(SUBDIRS)):
+			@for d in $(patsubst %-dir,%,$@); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
 
 clean:
 			@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; if [ $$? -ne 0 ]; then exit 1; fi; done
@@ -151,13 +155,13 @@ TAGS:
 			@for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
 			etags -t $(wildcard *.c) $(wildcard *.h)
 
-ippoold:		$(IPPOOLD_SRCS.o)
-			$(CC) -o $@ $^ $(LDFLAGS.ippoold)
+ippoold:		$(IPPOOLD_SRCS.o) usl-dir
+			$(CC) -o $@ $(IPPOOLD_SRCS.o) $(LDFLAGS.ippoold)
 
-ippoolconfig:		$(IPPOOLCONFIG_SRCS.o)
-			$(CC) -o $@ $^ $(LDFLAGS.ippoolconfig)
+ippoolconfig:		$(IPPOOLCONFIG_SRCS.o) cli-dir
+			$(CC) -o $@ $(IPPOOLCONFIG_SRCS.o) $(LDFLAGS.ippoolconfig)
 
-%.o:	%.c
+%.o:	%.c $(IPPOOL_RPC_STEM).h
 			$(CC) -c $(CFLAGS) $< -o $@
 
 install:		all
diff --git a/pppd/Makefile b/pppd/Makefile
index 78d9b33..106deca 100644
--- a/pppd/Makefile
+++ b/pppd/Makefile
@@ -24,3 +24,5 @@ install: ippool.so
 
 clean:
 	-rm -rf *.o *.so
+
+include $(wildcard *.d /dev/null)