1From 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--- 10 Makefile | 15 +++++++++++++-- 11 wvrules-posix.mk | 7 +++++-- 12 2 files changed, 18 insertions(+), 4 deletions(-) 13 14diff --git a/Makefile b/Makefile 15index 72c8bef..5a4cfb2 100644 16--- a/Makefile 17+++ b/Makefile 18@@ -131,12 +131,19 @@ utils/tests/%: PRELIBS+=$(LIBWVSTREAMS) 19 # libwvstreams: stream/event handling library 20 # 21 TARGETS += libwvstreams.so 22-TARGETS += crypto/tests/ssltest ipstreams/tests/unixtest 23+TARGETS += crypto/tests/ssltest 24+crypto/tests/ssltest: $(LIBWVSTREAMS) 25+ 26+TARGETS += ipstreams/tests/unixtest 27+ipstreams/tests/unixtest: $(LIBWVSTREAMS) 28+ 29 TARGETS += crypto/tests/printcert 30+crypto/tests/printcert: $(LIBWVSTREAMS) 31 32 ifndef _MACOS 33 ifneq ("$(with_readline)", "no") 34 TARGETS += ipstreams/tests/wsd 35+ ipstreams/tests/wsd: $(LIBWVSTREAMS) 36 ipstreams/tests/wsd-LIBS += -lreadline 37 else 38 TEST_SKIP_OBJS += ipstreams/tests/wsd 39@@ -179,7 +186,11 @@ uniconf/tests/%: PRELIBS+=$(LIBUNICONF) 40 # 41 ifneq ("$(with_dbus)", "no") 42 TARGETS += libwvdbus.so 43- TARGETS += dbus/tests/wvdbus dbus/tests/wvdbusd 44+ TARGETS += dbus/tests/wvdbus 45+ dbus/tests/wvdbus: $(LIBWVDBUS) 46+ 47+ TARGETS += dbus/tests/wvdbusd 48+ dbus/tests/wvdbusd: $(LIBWVDBUS) 49 TESTS += $(call tests_cc,dbus/tests) 50 libwvdbus_OBJS += $(call objects,dbus) 51 libwvdbus.so: $(libwvdbus_OBJS) $(LIBWVSTREAMS) 52diff --git a/wvrules-posix.mk b/wvrules-posix.mk 53index f94d2cd..2e99f36 100644 54--- a/wvrules-posix.mk 55+++ b/wvrules-posix.mk 56@@ -80,12 +80,15 @@ define wvlink_ar 57 $(AR) s $1 58 endef 59 60-CC: FORCE 61+CC: 62 @CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ 63 $(WVSTREAMS)/gen-cc CC c 64 65-CXX: FORCE 66+CXX: 67 @CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \ 68 $(WVSTREAMS)/gen-cc CXX cc 69 70+#All files must depend on the above two rules. This is a godawful hack. 71+$(shell find -type f '(' -name '*.c' -o -name '*.cc' ')' ): CC CXX 72+ 73 wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS) 74-- 752.14.1 76 77