1 Description: mk: always rebuild in the same order
3 In order to achieve reproducible builds, always check dependencies in
6 Origin: http://dpdk.org/dev/patchwork/patch/25679/
8 Author: Luca Boccassi <luca.boccassi@gmail.com>
9 Last-Update: 2017-06-24
11 mk/internal/rte.compile-pre.mk | 8 ++++----
12 1 file changed, 4 insertions(+), 4 deletions(-)
14 diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk
15 index da8dda498..5d519100c 100644
16 --- a/mk/internal/rte.compile-pre.mk
17 +++ b/mk/internal/rte.compile-pre.mk
18 @@ -108,13 +108,13 @@ C_TO_O_DO = @set -e; \
19 compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1)))
21 # return a non-empty string if the dst file does not exist
22 -file_missing = $(call compare,$(wildcard $@),$@)
23 +file_missing = $(call compare,$(sort $(wildcard $@)),$@)
25 # return a non-empty string if cmdline changed
26 cmdline_changed = $(call compare,$(strip $(cmd_$@)),$(strip $(1)))
28 # return a non-empty string if a dependency file does not exist
29 -depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@))
30 +depfile_missing = $(call compare,$(sort $(wildcard $(dep_$@))),$(dep_$@))
32 # return an empty string if no prereq is newer than target
33 # - $^ -> names of all the prerequisites
34 @@ -123,7 +123,7 @@ depfile_missing = $(call compare,$(wildcard $(dep_$@)),$(dep_$@))
35 # exist (filter-out removes existing ones from the list)
36 # - $? -> names of all the prerequisites newer than target
37 depfile_newer = $(strip $(filter-out FORCE,$? \
38 - $(filter-out $(wildcard $^),$^)))
39 + $(filter-out $(sort $(wildcard $^)),$^)))
41 # return 1 if parameter is a non-empty string, else 0
42 boolean = $(if $1,1,0)
43 @@ -134,7 +134,7 @@ boolean = $(if $1,1,0)
44 # user (by default it is empty)
47 -%.o: %.c $$(wildcard $$(dep_$$@)) $$(DEP_$$(@)) FORCE
48 +%.o: %.c $$(sort $$(wildcard $$(dep_$$@))) $$(DEP_$$(@)) FORCE
49 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
51 @echo -n "$< -> $@ " ; \