1 Author: Reiner Herrmann <reiner@reiner-h.de>
2 Description: Sort lists of libraries/source/object files
3 for deterministic linking order
8 _libs = $(strip $(foreach _lib,$(LIBDIRS),\
9 $(if $(filter lib%,$(_lib)),\
10 $(patsubst lib%,-l%,$(_lib)),\
11 - $(wildcard $(srcdir)/$(_lib)/$(_lib).so \
12 - $(srcdir)/$(_lib)/$(_lib).a))))
13 + $(sort $(wildcard $(srcdir)/$(_lib)/$(_lib).so \
14 + $(srcdir)/$(_lib)/$(_lib).a)))))
16 override LIBS := $(_libs) -lm $(LIBS)
22 -sources = $(wildcard *.c)
23 +sources = $(sort $(wildcard *.c))
24 OBJS = $(sources:.c=.$(obj))
30 ifeq ($(filter $(TARGET),$(EXEDIRS)),$(TARGET))
32 ifeq ($(filter $(TARGET),$(MODUSERS)),$(TARGET))
33 -MOD_OBJS = $(wildcard $(foreach dir,$(MODDIRS),$(srcdir)/$(dir)/*.o))
34 +MOD_OBJS = $(sort $(wildcard $(foreach dir,$(MODDIRS),$(srcdir)/$(dir)/*.o)))
36 override LDFLAGS := -rdynamic $(LDFLAGS)