From 7256ea3b32c59ee211b549a087fb8d30f1e543e2 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 12 Dec 2022 05:32:04 +0100 Subject: [PATCH] make: update Makefile --- Makefile | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index b6fc8828..06ccfb48 100644 --- a/Makefile +++ b/Makefile @@ -14,20 +14,6 @@ ifneq ($(VERBOSE),) UPX_CMAKE_BUILD_FLAGS += --verbose endif -# check git submodules -ifeq ($(wildcard ./vendor/doctest/doctest/.),) - $(error ERROR: missing git submodule; run 'git submodule update --init') -endif -ifeq ($(wildcard ./vendor/lzma-sdk/C/.),) - $(error ERROR: missing git submodule; run 'git submodule update --init') -endif -ifeq ($(wildcard ./vendor/ucl/include/.),) - $(error ERROR: missing git submodule; run 'git submodule update --init') -endif -ifeq ($(wildcard ./vendor/zlib/crc32.c),) - $(error ERROR: missing git submodule; run 'git submodule update --init') -endif - #*********************************************************************** # default #*********************************************************************** @@ -55,35 +41,53 @@ release: build/release #*********************************************************************** # force building with gcc/g++ -build/%-gcc: export CC=gcc -build/%-gcc: export CXX=g++ build/debug-gcc: PHONY $(call run_config,$@,Debug) $(call run_build,$@,Debug) build/release-gcc: PHONY $(call run_config,$@,Release) $(call run_build,$@,Release) +build/%-gcc: export CC=gcc +build/%-gcc: export CXX=g++ # force building with clang/clang++ -build/%-clang: export CC=clang -build/%-clang: export CXX=clang++ build/debug-clang: PHONY $(call run_config,$@,Debug) $(call run_build,$@,Debug) build/release-clang: PHONY $(call run_config,$@,Release) $(call run_build,$@,Release) +build/%-clang: export CC=clang +build/%-clang: export CXX=clang++ # cross compiler: Windows mingw-w64 -build/%-cross-mingw64: export CC=x86_64-w64-mingw32-gcc -build/%-cross-mingw64: export CXX=x86_64-w64-mingw32-g++ -# disable sanitize to avoid link errors on GitHub CI -build/%-cross-mingw64: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1 build/debug-cross-mingw64: PHONY $(call run_config,$@,Debug) $(call run_build,$@,Debug) build/release-cross-mingw64: PHONY $(call run_config,$@,Release) $(call run_build,$@,Release) +build/%-cross-mingw64: export CC=x86_64-w64-mingw32-gcc +build/%-cross-mingw64: export CXX=x86_64-w64-mingw32-g++ +# disable sanitize to avoid link errors on GitHub CI +build/%-cross-mingw64: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1 + +#*********************************************************************** +# misc +#*********************************************************************** .PHONY: PHONY + +# check git submodules +ifeq ($(wildcard ./vendor/doctest/doctest/.),) + $(error ERROR: missing git submodule; run 'git submodule update --init') +endif +ifeq ($(wildcard ./vendor/lzma-sdk/C/.),) + $(error ERROR: missing git submodule; run 'git submodule update --init') +endif +ifeq ($(wildcard ./vendor/ucl/include/.),) + $(error ERROR: missing git submodule; run 'git submodule update --init') +endif +ifeq ($(wildcard ./vendor/zlib/crc32.c),) + $(error ERROR: missing git submodule; run 'git submodule update --init') +endif