From 4e2324216d6d3c276322fe4c4ef722221265c10f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 12 Oct 2023 19:40:35 -0400 Subject: [PATCH] Makefile Also allow overwrite of OBJCOPY, OBJDUMP and WINDRES --- .gitlab-ci.yml | 6 ++--- cpdebug.mk | 64 +++++++++++++++++++++++++------------------------- src/Makefile | 6 ++--- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2ec24996..681c6e61f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,7 +78,7 @@ build-i686-linux-gnu: - export OBJDUMP=i686-linux-gnu-objdump - export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig - *ccache - - make --directory=src CCACHE=1 OBJCOPY=$OBJCOPY OBJDUMP=$OBJDUMP LINUX=1 + - make --directory=src CCACHE=1 LINUX=1 build-aarch64-linux-gnu: <<: *job_build @@ -95,7 +95,7 @@ build-aarch64-linux-gnu: - export OBJDUMP=aarch64-linux-gnu-objdump - export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig - *ccache - - make --directory=src CCACHE=1 OBJCOPY=$OBJCOPY OBJDUMP=$OBJDUMP LINUX64=1 NONX86=1 + - make --directory=src CCACHE=1 LINUX64=1 NONX86=1 build-x86_64-linux-gnu: <<: *job_build @@ -112,7 +112,7 @@ build-x86_64-linux-gnu: - export OBJDUMP=x86_64-linux-gnu-objdump - export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig - *ccache - - make --directory=src CCACHE=1 OBJCOPY=$OBJCOPY OBJDUMP=$OBJDUMP LINUX64=1 + - make --directory=src CCACHE=1 LINUX64=1 build-i686-w64-mingw32: <<: *job_build diff --git a/cpdebug.mk b/cpdebug.mk index e7b076303..75f08c66f 100644 --- a/cpdebug.mk +++ b/cpdebug.mk @@ -1,32 +1,32 @@ -#Add-on Makefile for wxDev-C++ project file -ifdef ComSpec -COMSPEC=$(ComSpec) -endif -ifdef COMSPEC -OBJCOPY?=objcopy.exe -OBJDUMP?=objdump.exe -GZIP?=gzip.exe -else -OBJCOPY?=objcopy -OBJDUMP?=objdump -GZIP?=gzip -endif -DBGNAME=$(BIN).debug -OBJDUMP_OPTS?=--wide --source --line-numbers -GZIP_OPTS?=-9 -f -n -GZIP_OPT2=$(GZIP_OPTS) --rsyncable -UPX?=upx -UPX_OPTS?=--best --preserve-build-id -UPX_OPTS+=-q - -all-after: - $(OBJDUMP) $(OBJDUMP_OPTS) "$(BIN)" > "$(DBGNAME).txt" - $(OBJCOPY) $(BIN) $(DBGNAME) - $(OBJCOPY) --strip-debug $(BIN) - -$(OBJCOPY) --add-gnu-debuglink=$(DBGNAME) $(BIN) - -$(GZIP) $(GZIP_OPTS) "$(DBGNAME).txt" -ifndef COMSPEC - -$(GZIP) $(GZIP_OPT2) "$(DBGNAME).txt" -endif - -$(UPX) $(UPX_OPTS) $(BIN) - +#Add-on Makefile for wxDev-C++ project file +ifdef ComSpec +COMSPEC=$(ComSpec) +endif +ifdef COMSPEC +OBJCOPY?=objcopy.exe +OBJDUMP?=objdump.exe +GZIP?=gzip.exe +else +OBJCOPY?=objcopy +OBJDUMP?=objdump +GZIP?=gzip +endif +DBGNAME=$(BIN).debug +OBJDUMP_OPTS?=--wide --source --line-numbers +GZIP_OPTS?=-9 -f -n +GZIP_OPT2=$(GZIP_OPTS) --rsyncable +UPX?=upx +UPX_OPTS?=--best --preserve-build-id +UPX_OPTS+=-q + +all-after: + $(OBJDUMP) $(OBJDUMP_OPTS) "$(BIN)" > "$(DBGNAME).txt" + $(OBJCOPY) $(BIN) $(DBGNAME) + $(OBJCOPY) --strip-debug $(BIN) + -$(OBJCOPY) --add-gnu-debuglink=$(DBGNAME) $(BIN) + -$(GZIP) $(GZIP_OPTS) "$(DBGNAME).txt" +ifndef COMSPEC + -$(GZIP) $(GZIP_OPT2) "$(DBGNAME).txt" +endif + -$(UPX) $(UPX_OPTS) $(BIN) + diff --git a/src/Makefile b/src/Makefile index 41cef2a17..539c2fa74 100644 --- a/src/Makefile +++ b/src/Makefile @@ -141,9 +141,9 @@ endif OBJDUMP_OPTS?=--wide --source --line-numbers -OBJCOPY:=$(call Prefix,objcopy) -OBJDUMP:=$(call Prefix,objdump) -WINDRES:=$(call Prefix,windres) +OBJCOPY?=$(call Prefix,objcopy) +OBJDUMP?=$(call Prefix,objdump) +WINDRES?=$(call Prefix,windres) GZIP?=gzip GZIP_OPTS?=-9 -f -n