diff --git a/src/Makefile b/src/Makefile index 18ab524b8..7104a91cf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -176,11 +176,7 @@ include Makefile.d/detect.mk # make would try to remove the implicitly made directories .PRECIOUS : %/ comptime.c -# very sophisticated dependency -sources:=\ - $(call List,Sourcefile)\ - $(call List,blua/Sourcefile)\ - +sources:= makedir:=../make # -DCOMPVERSION: flag to use comptime.h @@ -204,6 +200,11 @@ endif depdir:=$(makedir)/deps objdir:=$(makedir)/objs +# very sophisticated dependency +sources+=\ + $(call List,Sourcefile)\ + $(call List,blua/Sourcefile)\ + depends:=$(basename $(filter %.c %.s,$(sources))) objects:=$(basename $(filter %.c %.s %.nas,$(sources))) diff --git a/src/Makefile.d/platform.mk b/src/Makefile.d/platform.mk index 531d073e9..fad4be191 100644 --- a/src/Makefile.d/platform.mk +++ b/src/Makefile.d/platform.mk @@ -7,9 +7,11 @@ PKG_CONFIG?=pkg-config ifdef WINDOWSHELL rmrf=-2>NUL DEL /S /Q mkdir=-2>NUL MD +cat=TYPE else rmrf=rm -rf mkdir=mkdir -p +cat=cat endif ifdef LINUX64 diff --git a/src/Makefile.d/util.mk b/src/Makefile.d/util.mk index e76e32422..bda68df13 100644 --- a/src/Makefile.d/util.mk +++ b/src/Makefile.d/util.mk @@ -10,7 +10,8 @@ Wildvar=$(foreach v,$(filter $(1),$(.VARIABLES)),$($(v))) # Read a list of words from file and prepend each with the # directory of the file. -List=$(addprefix $(dir $(1)),$(file < $(1))) +_cat=$(shell $(cat) $(call Windows_path,$(1))) +List=$(addprefix $(dir $(1)),$(call _cat,$(1))) # Convert path separators to backslash on Windows. Windows_path=$(if $(WINDOWSHELL),$(subst /,\,$(1)),$(1))