blob: 954c3d9fca583bd5fe24f2a0e2f7008e0c08d93d [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 90de630f21ac744a37b3adac1bd84654471744ff Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Aug 2017 22:30:01 -0700
4Subject: [PATCH 1/2] build: fix parallel make
5
6Imported from Gentoo
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
Patrick Williams520786c2023-06-25 16:20:36 -050010Upstream-Status: Pending
11
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 Makefile | 15 +++++++++++++--
13 wvrules-posix.mk | 7 +++++--
14 2 files changed, 18 insertions(+), 4 deletions(-)
15
16diff --git a/Makefile b/Makefile
17index 72c8bef..5a4cfb2 100644
18--- a/Makefile
19+++ b/Makefile
20@@ -131,12 +131,19 @@ utils/tests/%: PRELIBS+=$(LIBWVSTREAMS)
21 # libwvstreams: stream/event handling library
22 #
23 TARGETS += libwvstreams.so
24-TARGETS += crypto/tests/ssltest ipstreams/tests/unixtest
25+TARGETS += crypto/tests/ssltest
26+crypto/tests/ssltest: $(LIBWVSTREAMS)
27+
28+TARGETS += ipstreams/tests/unixtest
29+ipstreams/tests/unixtest: $(LIBWVSTREAMS)
30+
31 TARGETS += crypto/tests/printcert
32+crypto/tests/printcert: $(LIBWVSTREAMS)
33
34 ifndef _MACOS
35 ifneq ("$(with_readline)", "no")
36 TARGETS += ipstreams/tests/wsd
37+ ipstreams/tests/wsd: $(LIBWVSTREAMS)
38 ipstreams/tests/wsd-LIBS += -lreadline
39 else
40 TEST_SKIP_OBJS += ipstreams/tests/wsd
41@@ -179,7 +186,11 @@ uniconf/tests/%: PRELIBS+=$(LIBUNICONF)
42 #
43 ifneq ("$(with_dbus)", "no")
44 TARGETS += libwvdbus.so
45- TARGETS += dbus/tests/wvdbus dbus/tests/wvdbusd
46+ TARGETS += dbus/tests/wvdbus
47+ dbus/tests/wvdbus: $(LIBWVDBUS)
48+
49+ TARGETS += dbus/tests/wvdbusd
50+ dbus/tests/wvdbusd: $(LIBWVDBUS)
51 TESTS += $(call tests_cc,dbus/tests)
52 libwvdbus_OBJS += $(call objects,dbus)
53 libwvdbus.so: $(libwvdbus_OBJS) $(LIBWVSTREAMS)
54diff --git a/wvrules-posix.mk b/wvrules-posix.mk
55index f94d2cd..2e99f36 100644
56--- a/wvrules-posix.mk
57+++ b/wvrules-posix.mk
58@@ -80,12 +80,15 @@ define wvlink_ar
59 $(AR) s $1
60 endef
61
62-CC: FORCE
63+CC:
64 @CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
65 $(WVSTREAMS)/gen-cc CC c
66
67-CXX: FORCE
68+CXX:
69 @CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
70 $(WVSTREAMS)/gen-cc CXX cc
71
72+#All files must depend on the above two rules. This is a godawful hack.
73+$(shell find -type f '(' -name '*.c' -o -name '*.cc' ')' ): CC CXX
74+
75 wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS)
76--
772.14.1
78