summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDemki <mordbz@gmail.com>2020-07-11 09:16:37 +0300
committerDemki <mordbz@gmail.com>2020-07-11 09:16:37 +0300
commitc158adba66b96b16659a706312bd1c354b33d1b9 (patch)
tree777d208394c64d546cc70b0d99fcb295975ae1d9 /Makefile
parentd022486e419b8651a9716fb50e0cedcbb6733168 (diff)
Added sorting to makefile wildcard
fixes builds with make >= 3.8.2 and < 4.3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9b8b430e..06655098 100644
--- a/Makefile
+++ b/Makefile
@@ -65,8 +65,9 @@ BNR := $(BUILD_DIR)/$(TARGET).bnr
SRC_DIRS := src
ASM_DIRS := asm data files
-C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
-S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
+# sorting wildcards required for versions of make >= 3.8.2 and < 4.3 for consistent builds
+C_FILES := $(foreach dir,$(SRC_DIRS),$(sort $(wildcard $(dir)/*.c)))
+S_FILES := $(foreach dir,$(ASM_DIRS),$(sort $(wildcard $(dir)/*.s)))
# Object files
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \