[Libct] [PATCH 2/2] make: Eliminate double building of objects

Cyrill Gorcunov gorcunov at openvz.org
Wed Nov 19 11:41:43 PST 2014


Because src/$(LIBCT).a and src/$(LIBCT).so are
separate targest the make -j2 command yields
two instances of make which are building same
targets simultaneously which leads to unneeded
double generation of dep files and such.

Simply make "so" to depends on "a" because they
are different in linking but not in building
improving build speed.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b8bbd80..0daa533 100644
--- a/Makefile
+++ b/Makefile
@@ -119,14 +119,16 @@ src: $(EARLY-GEN)
 
 .PHONY: src
 
-$(LIBCT).so: src/$(LIBCT).so
+$(LIBCT).a: src/$(LIBCT).a
 	$(E) "  LN      " $@
 	$(Q) $(LN) -sf $^ $@
 
-$(LIBCT).a: src/$(LIBCT).a
+$(LIBCT).so: src/$(LIBCT).so
 	$(E) "  LN      " $@
 	$(Q) $(LN) -sf $^ $@
 
+src/$(LIBCT).so: src/$(LIBCT).a
+
 all: $(LIBCT).so $(LIBCT).a
 	@true
 
-- 
1.9.3



More information about the Libct mailing list