From 517be2a2419dca2f211cf75c5d0fc7d851bd99e5 Mon Sep 17 00:00:00 2001 From: Simon Gaiser Date: Tue, 13 Aug 2019 23:32:02 +0200 Subject: [PATCH] [LibOS,Pal] Improve recursive Make calls Do not declare the result of the recursive Make call as "phony" to avoid unnecessary rebuilds. Due to the missing dependency information we of course still need to always recurse. --- LibOS/shim/src/Makefile | 7 +++++-- Pal/src/Makefile | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/LibOS/shim/src/Makefile b/LibOS/shim/src/Makefile index 018fe09b..3d76d31b 100644 --- a/LibOS/shim/src/Makefile +++ b/LibOS/shim/src/Makefile @@ -88,10 +88,13 @@ libsysdb_debug.so: $(addsuffix .o,$(filter-out syscallas,$(objs))) \ @mkdir -p .lib $(call cmd,ln_sf) -.PHONY: $(graphene_lib) -$(graphene_lib): .lib/host_endian.h +.PHONY: graphene_lib_recurse +graphene_lib_recurse: .lib/host_endian.h $(MAKE) -C ../../../Pal/lib target=$(abspath .lib)/ +$(graphene_lib): graphene_lib_recurse + @true + libsysdb.a: $(addsuffix .o,$(objs)) $(call cmd,ar_a_o) else diff --git a/Pal/src/Makefile b/Pal/src/Makefile index bcd9004c..31efd587 100644 --- a/Pal/src/Makefile +++ b/Pal/src/Makefile @@ -83,14 +83,20 @@ $(LIB_DIR)/host_endian.h: $(HOST_DIR)/host_endian.h @mkdir -p $(LIB_DIR) $(call cmd,ln_sf) -.PHONY: $(host_lib) $(graphene_lib) $(pal_lib) +.PHONY: host_lib_recurse graphene_lib_recurse -$(graphene_lib): $(LIB_DIR)/host_endian.h +graphene_lib_recurse: $(LIB_DIR)/host_endian.h $(MAKE) -C ../lib target=$(abspath $(LIB_DIR))/ -$(host_lib): $(graphene_lib) +$(graphene_lib): graphene_lib_recurse + @true + +host_lib_recurse: $(graphene_lib) @[ ! -d host/$(PAL_HOST) ] || $(MAKE) -C host/$(PAL_HOST) +$(host_lib): host_lib_recurse + @true + $(pal_loader): $(host_lib) $(runtime_loader): $(pal_loader)