about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--libraries.mk2
-rw-r--r--programs.mk2
2 files changed, 2 insertions, 2 deletions
diff --git a/libraries.mk b/libraries.mk
index bc258b799f55..98cc9f363f44 100644
--- a/libraries.mk
+++ b/libraries.mk
@@ -35,7 +35,7 @@ libs_list :=
 define build-library =
   $(1)_NAME ?= $(1)
   _d := $$(strip $$($(1)_DIR))
-  _srcs := $$(foreach src, $$($(1)_SOURCES), $$(src))
+  _srcs := $$(sort $$(foreach src, $$($(1)_SOURCES), $$(src)))
   $(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
   _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
 
diff --git a/programs.mk b/programs.mk
index 52e55598cbae..a97a51635264 100644
--- a/programs.mk
+++ b/programs.mk
@@ -17,7 +17,7 @@ programs_list :=
 #   installed; defaults to $(bindir).
 define build-program =
   _d := $$($(1)_DIR)
-  _srcs := $$(foreach src, $$($(1)_SOURCES), $$(src))
+  _srcs := $$(sort $$(foreach src, $$($(1)_SOURCES), $$(src)))
   $(1)_OBJS := $$(addsuffix .o, $$(basename $$(_srcs)))
   _libs := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_PATH))
   $(1)_PATH := $$(_d)/$(1)