From: Thomas Leonard Subject: [PATCH ARM v5 01/20] mini-os: build fixes Date: Thu, 26 Jun 2014 12:28:18 +0100 Message-ID: <1403782117-15125-2-git-send-email-talex5@gmail.com> References: <1403782117-15125-1-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X07r2-00043n-7c for xen-devel@lists.xenproject.org; Thu, 26 Jun 2014 11:28:36 +0000 Received: by mail-wi0-f179.google.com with SMTP id cc10so848051wib.0 for ; Thu, 26 Jun 2014 04:28:34 -0700 (PDT) In-Reply-To: <1403782117-15125-1-git-send-email-talex5@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Thomas Leonard , Dave.Scott@eu.citrix.com, anil@recoil.org, stefano.stabellini@eu.citrix.com, samuel.thibault@ens-lyon.org List-Id: xen-devel@lists.xenproject.org Make .o rules depend on the includes. Before, only the final link step depended on setting up the includes directory, making parallel builds unreliable. Make symlinks use explicit make rules instead of using a phony target. Avoids unnecessary rebuilds. [talex5@gmail.com: bring back "make links", for stubdom] Signed-off-by: Thomas Leonard Acked-by: Ian Campbell Acked-by: Samuel Thibault --- extras/mini-os/Makefile | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile index 50d038b..6d6537e 100644 --- a/extras/mini-os/Makefile +++ b/extras/mini-os/Makefile @@ -50,6 +50,11 @@ flags-$(CONFIG_XENBUS) += -DCONFIG_XENBUS DEF_CFLAGS += $(flags-y) +# Symlinks and headers that must be created before building the C files +GENERATED_HEADERS := include/list.h $(ARCH_LINKS) include/mini-os include/xen include/$(TARGET_ARCH_FAM)/mini-os + +EXTRA_DEPS += $(GENERATED_HEADERS) + # Include common mini-os makerules. include minios.mk @@ -124,11 +129,18 @@ include/list.h: $(XEN_ROOT)/tools/include/xen-external/bsd-sys-queue-h-seddery $ perl $^ --prefix=minios >$@.new $(call move-if-changed,$@.new,$@) +# Used by stubdom's Makefile .PHONY: links -links: include/list.h $(ARCH_LINKS) - [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen - [ -e include/mini-os ] || ln -sf . include/mini-os - [ -e include/$(TARGET_ARCH_FAM)/mini-os ] || ln -sf . include/$(TARGET_ARCH_FAM)/mini-os +links: $(GENERATED_HEADERS) + +include/xen: + ln -sf ../../../xen/include/public $@ + +include/mini-os: + ln -sf . $@ + +include/$(TARGET_ARCH_FAM)/mini-os: + ln -sf . $@ .PHONY: arch_lib arch_lib: @@ -174,7 +186,7 @@ ifneq ($(APP_OBJS),) APP_O=$(OBJ_DIR)/$(TARGET)_app.o endif -$(OBJ_DIR)/$(TARGET): links include/list.h $(OBJS) $(APP_O) arch_lib +$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o $(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@ @@ -212,4 +224,3 @@ tags: .PHONY: TAGS TAGS: $(all_sources) | xargs etags - -- 2.0.0