Makefile: (Moderate) Build Speed improvements:

0) use gnu make "simply expanded" variable
1) use gnu make `shell` function instead of backticks
2) collectively these avoid multiple variable expansions per compiler call
3) should most significantly improve I/O bound platforms (e.g. MSYS2)
This commit is contained in:
GammaTendonNine 2020-11-23 08:25:31 -06:00
parent 11cad56dd3
commit 48228f2036
1 changed files with 6 additions and 7 deletions

View File

@ -166,9 +166,8 @@ VERSION_ASFLAGS := --defsym $(VERSION_DEF)=1
# Stuff for showing the git hash in the intro on nightly builds
# From https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source
ifeq ($(shell git rev-parse --abbrev-ref HEAD),nightly)
GIT_HASH=`git rev-parse --short HEAD`
COMPILE_TIME=`date -u +'%Y-%m-%d %H:%M:%S UTC'`
VERSION_CFLAGS += -DNIGHTLY -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\""
GIT_HASH := $(shell git rev-parse --short HEAD)
VERSION_CFLAGS += -DNIGHTLY -DGIT_HASH="\"$(GIT_HASH)\""
endif
# Microcode
@ -528,7 +527,7 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL)
else ifeq ($(TARGET_RPI),1)
BACKEND_LDFLAGS += -lGLESv2
else ifeq ($(OSX_BUILD),1)
BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew`
BACKEND_LDFLAGS += -framework OpenGL $(shell pkg-config --libs glew)
else
BACKEND_LDFLAGS += -lGL
endif
@ -557,11 +556,11 @@ else ifeq ($(SDL1_USED),1)
endif
ifneq ($(SDL1_USED)$(SDL2_USED),00)
BACKEND_CFLAGS += `$(SDLCONFIG) --cflags`
BACKEND_CFLAGS += $(shell $(SDLCONFIG) --cflags)
ifeq ($(WINDOWS_BUILD),1)
BACKEND_LDFLAGS += `$(SDLCONFIG) --static-libs` -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion
BACKEND_LDFLAGS += $(shell $(SDLCONFIG) --static-libs) -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion
else
BACKEND_LDFLAGS += `$(SDLCONFIG) --libs`
BACKEND_LDFLAGS += $(shell $(SDLCONFIG) --libs)
endif
endif