From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: [PATCH v3 8/8] mk: always rebuild in the same order Date: Fri, 23 Jun 2017 19:41:53 +0100 Message-ID: <20170623184153.24488-9-lboccass@brocade.com> References: <20170623181616.16981-1-lboccass@brocade.com> <20170623184153.24488-1-lboccass@brocade.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Luca Boccassi To: Return-path: Received: from mx0a-000f0801.pphosted.com (mx0b-000f0801.pphosted.com [67.231.152.113]) by dpdk.org (Postfix) with ESMTP id D56091C0B for ; Fri, 23 Jun 2017 20:59:14 +0200 (CEST) In-Reply-To: <20170623184153.24488-1-lboccass@brocade.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Luca Boccassi In order to achieve reproducible builds, always check dependencies in the same order. Signed-off-by: Luca Boccassi --- mk/internal/rte.compile-pre.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index da8dda498..5d519100c 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -108,13 +108,13 @@ C_TO_O_DO = @set -e; \ compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1))) # return a non-empty string if the dst file does not exist -file_missing = $(call compare,$(wildcard $@),$@) +file_missing = $(call compare,$(sort $(wildcard $@)),$@) # return a non-empty string if cmdline changed cmdline_changed = $(call compare,$(strip $(cmd_$@)),$(strip $(1))) # return a non-empty string if a dependency file does not exist -depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@)) +depfile_missing = $(call compare,$(sort $(wildcard $(dep_$@))),$(dep_$@)) # return an empty string if no prereq is newer than target # - $^ -> names of all the prerequisites @@ -123,7 +123,7 @@ depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@)) # exist (filter-out removes existing ones from the list) # - $? -> names of all the prerequisites newer than target depfile_newer = $(strip $(filter-out FORCE,$? \ - $(filter-out $(wildcard $^),$^))) + $(filter-out $(sort $(wildcard $^)),$^))) # return 1 if parameter is a non-empty string, else 0 boolean = $(if $1,1,0) @@ -134,7 +134,7 @@ boolean = $(if $1,1,0) # user (by default it is empty) # .SECONDEXPANSION: -%.o: %.c $$(wildcard $$(dep_$$@)) $$(DEP_$$(@)) FORCE +%.o: %.c $$(sort $$(wildcard $$(dep_$$@))) $$(DEP_$$(@)) FORCE @[ -d $(dir $@) ] || mkdir -p $(dir $@) $(if $(D),\ @echo -n "$< -> $@ " ; \ -- 2.11.0