mirror of
https://github.com/upx/upx.git
synced 2025-08-07 22:46:51 +08:00
make: move extra builds to "build/extra/" subdirectories
This commit is contained in:
68
.github/workflows/ci.yml
vendored
68
.github/workflows/ci.yml
vendored
@ -78,25 +78,25 @@ jobs:
|
|||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
- name: 'Check out test suite'
|
- name: 'Check out test suite'
|
||||||
run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite'
|
run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite'
|
||||||
- name: 'Build cmake debug-gcc'
|
- name: 'Build cmake extra/gcc/debug'
|
||||||
run: 'make build/debug-gcc'
|
run: 'make build/extra/gcc/debug'
|
||||||
- name: 'Build cmake release-gcc'
|
- name: 'Build cmake extra/gcc/release'
|
||||||
run: 'make build/release-gcc'
|
run: 'make build/extra/gcc/release'
|
||||||
- name: 'Build cmake debug-clang'
|
- name: 'Build cmake extra/clang/debug'
|
||||||
run: 'make build/debug-clang'
|
run: 'make build/extra/clang/debug'
|
||||||
- name: 'Build cmake release-clang'
|
- name: 'Build cmake extra/clang/release'
|
||||||
run: 'make build/release-clang'
|
run: 'make build/extra/clang/release'
|
||||||
- name: 'Build cmake debug-gcc-m32'
|
- name: 'Build cmake extra/gcc-m32/debug'
|
||||||
if: ${{ matrix.use_m32 }}
|
if: ${{ matrix.use_m32 }}
|
||||||
run: 'make build/debug-gcc-m32'
|
run: 'make build/extra/gcc-m32/debug'
|
||||||
- name: 'Build cmake release-gcc-m32'
|
- name: 'Build cmake extra/gcc-m32/release'
|
||||||
if: ${{ matrix.use_m32 }}
|
if: ${{ matrix.use_m32 }}
|
||||||
run: 'make build/release-gcc-m32'
|
run: 'make build/extra/gcc-m32/release'
|
||||||
- name: 'Make artifact'
|
- name: 'Make artifact'
|
||||||
run: |
|
run: |
|
||||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||||
mkdir -p "tmp/artifact/$N"
|
mkdir -p "tmp/artifact/$N"
|
||||||
(cd build && cp -ai --parents */upx "../tmp/artifact/$N")
|
(cd build/extra && cp -ai --parents */*/upx "../../tmp/artifact/$N")
|
||||||
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
(cd tmp/artifact && tar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
@ -107,20 +107,20 @@ jobs:
|
|||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
- name: 'Run basic tests'
|
- name: 'Run basic tests'
|
||||||
run: |
|
run: |
|
||||||
make -C build/debug-gcc test
|
make -C build/extra/gcc/debug test
|
||||||
make -C build/release-gcc test
|
make -C build/extra/gcc/release test
|
||||||
make -C build/debug-clang test
|
make -C build/extra/clang/debug test
|
||||||
make -C build/release-clang test
|
make -C build/extra/clang/release test
|
||||||
- name: 'Run basic tests 32-bit'
|
- name: 'Run basic tests 32-bit'
|
||||||
if: ${{ matrix.use_m32 }}
|
if: ${{ matrix.use_m32 }}
|
||||||
run: |
|
run: |
|
||||||
make -C build/debug-gcc-m32 test
|
make -C build/extra/gcc-m32/debug test
|
||||||
make -C build/release-gcc-m32 test
|
make -C build/extra/gcc-m32/release test
|
||||||
- name: 'Run test suite build/release-gcc'
|
- name: 'Run test suite build/extra/gcc/release'
|
||||||
run: |
|
run: |
|
||||||
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
||||||
testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
|
testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
|
||||||
env -C build/release-gcc upx_exe=./upx bash "$testsuite_1"
|
env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1"
|
||||||
|
|
||||||
job-macos-cmake:
|
job-macos-cmake:
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
@ -144,21 +144,21 @@ jobs:
|
|||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
- name: 'Check out test suite'
|
- name: 'Check out test suite'
|
||||||
run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite'
|
run: 'git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite'
|
||||||
- name: 'Build cmake debug-gcc'
|
- name: 'Build cmake extra/gcc/debug'
|
||||||
if: ${{ matrix.gcc != '' }}
|
if: ${{ matrix.gcc != '' }}
|
||||||
run: 'make build/debug-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
run: 'make build/extra/gcc/debug CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||||
- name: 'Build cmake release-gcc'
|
- name: 'Build cmake extra/gcc/release'
|
||||||
if: ${{ matrix.gcc != '' }}
|
if: ${{ matrix.gcc != '' }}
|
||||||
run: 'make build/release-gcc CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
run: 'make build/extra/gcc/release CC=${{ matrix.gcc }} CXX=${{ matrix.gxx }}'
|
||||||
- name: 'Build cmake debug-clang'
|
- name: 'Build cmake extra/clang/debug'
|
||||||
run: 'make build/debug-clang'
|
run: 'make build/extra/clang/debug'
|
||||||
- name: 'Build cmake release-clang'
|
- name: 'Build cmake extra/clang/release'
|
||||||
run: 'make build/release-clang'
|
run: 'make build/extra/clang/release'
|
||||||
- name: 'Make artifact'
|
- name: 'Make artifact'
|
||||||
run: |
|
run: |
|
||||||
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
N=upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}
|
||||||
mkdir -p "tmp/artifact/$N"
|
mkdir -p "tmp/artifact/$N"
|
||||||
(cd build && rsync -R -a */upx "../tmp/artifact/$N/")
|
(cd build/extra && rsync -R -a */*/upx "../../tmp/artifact/$N/")
|
||||||
(cd tmp/artifact && gtar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
(cd tmp/artifact && gtar --sort=name -czf "$N.tar.gz" "$N" && rm -rf "./$N")
|
||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
@ -169,15 +169,15 @@ jobs:
|
|||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
- name: 'Run basic tests'
|
- name: 'Run basic tests'
|
||||||
run: |
|
run: |
|
||||||
make -C build/debug-clang test
|
make -C build/extra/clang/debug test
|
||||||
make -C build/release-clang test
|
make -C build/extra/clang/release test
|
||||||
- name: 'Run test suite build/release-clang'
|
- name: 'Run test suite build/extra/clang/release'
|
||||||
if: ${{ matrix.testsuite }}
|
if: ${{ matrix.testsuite }}
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
|
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
|
||||||
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
||||||
testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
|
testsuite_1=$(readlink -en ./.github/travis_testsuite_1.sh)
|
||||||
env -C build/release-clang upx_exe=./upx bash "$testsuite_1"
|
env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1"
|
||||||
|
|
||||||
job-windows-cmake:
|
job-windows-cmake:
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
|
98
Makefile
98
Makefile
@ -18,9 +18,11 @@ endif
|
|||||||
# default
|
# default
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
|
|
||||||
__check_cache = $(if $(wildcard $1/CMakeCache.txt),@true,)
|
run_cmake_config = $(CMAKE) -S . -B $1 $(UPX_CMAKE_CONFIG_FLAGS) -DCMAKE_BUILD_TYPE=$2
|
||||||
run_config = $(call __check_cache,$1) $(CMAKE) -S . -B $1 $(UPX_CMAKE_CONFIG_FLAGS) -DCMAKE_BUILD_TYPE=$2
|
run_cmake_build = $(CMAKE) --build $1 $(UPX_CMAKE_BUILD_FLAGS) --config $2
|
||||||
run_build = $(CMAKE) --build $1 $(UPX_CMAKE_BUILD_FLAGS) --config $2
|
# avoid re-running run_cmake_config if CMakeCache.txt already exists
|
||||||
|
run_config = $(if $(wildcard $1/CMakeCache.txt),,$(call run_cmake_config,$1,$2))
|
||||||
|
run_build = $(call run_cmake_build,$1,$2)
|
||||||
|
|
||||||
.DEFAULT_GOAL = build/release
|
.DEFAULT_GOAL = build/release
|
||||||
|
|
||||||
@ -39,7 +41,7 @@ release: build/release
|
|||||||
.PHONY: PHONY
|
.PHONY: PHONY
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# extra convenience: some pre-defined build configurations
|
# extra builds: some pre-defined build configurations
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
|
|
||||||
define run_config_and_build
|
define run_config_and_build
|
||||||
@ -48,68 +50,68 @@ define run_config_and_build
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# force building with clang/clang++
|
# force building with clang/clang++
|
||||||
build/debug-clang: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/clang/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-clang: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/clang/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-clang: export CC = clang
|
build/extra/clang/%: export CC = clang
|
||||||
build/%-clang: export CXX = clang++
|
build/extra/clang/%: export CXX = clang++
|
||||||
|
|
||||||
# force building with clang/clang++ -m32
|
# force building with clang/clang++ -m32
|
||||||
build/debug-clang-m32: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/clang-m32/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-clang-m32: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/clang-m32/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-clang-m32: export CC = clang -m32
|
build/extra/clang-m32/%: export CC = clang -m32
|
||||||
build/%-clang-m32: export CXX = clang++ -m32
|
build/extra/clang-m32/%: export CXX = clang++ -m32
|
||||||
|
|
||||||
# force building with clang/clang++ -m64
|
# force building with clang/clang++ -m64
|
||||||
build/debug-clang-m64: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/clang-m64/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-clang-m64: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/clang-m64/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-clang-m64: export CC = clang -m64
|
build/extra/clang-m64/%: export CC = clang -m64
|
||||||
build/%-clang-m64: export CXX = clang++ -m64
|
build/extra/clang-m64/%: export CXX = clang++ -m64
|
||||||
|
|
||||||
# force building with gcc/g++
|
# force building with gcc/g++
|
||||||
build/debug-gcc: PHONY; $(call run_config_and_build,$@,Debug)
|
build/extra/gcc/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-gcc: PHONY; $(call run_config_and_build,$@,Release)
|
build/extra/gcc/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-gcc: export CC = gcc
|
build/extra/gcc/%: export CC = gcc
|
||||||
build/%-gcc: export CXX = g++
|
build/extra/gcc/%: export CXX = g++
|
||||||
|
|
||||||
# force building with gcc/g++ -m32
|
# force building with gcc/g++ -m32
|
||||||
build/debug-gcc-m32: PHONY; $(call run_config_and_build,$@,Debug)
|
build/extra/gcc-m32/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-gcc-m32: PHONY; $(call run_config_and_build,$@,Release)
|
build/extra/gcc-m32/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-gcc-m32: export CC = gcc -m32
|
build/extra/gcc-m32/%: export CC = gcc -m32
|
||||||
build/%-gcc-m32: export CXX = g++ -m32
|
build/extra/gcc-m32/%: export CXX = g++ -m32
|
||||||
|
|
||||||
# force building with gcc/g++ -m64
|
# force building with gcc/g++ -m64
|
||||||
build/debug-gcc-m64: PHONY; $(call run_config_and_build,$@,Debug)
|
build/extra/gcc-m64/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-gcc-m64: PHONY; $(call run_config_and_build,$@,Release)
|
build/extra/gcc-m64/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-gcc-m64: export CC = gcc -m64
|
build/extra/gcc-m64/%: export CC = gcc -m64
|
||||||
build/%-gcc-m64: export CXX = g++ -m64
|
build/extra/gcc-m64/%: export CXX = g++ -m64
|
||||||
|
|
||||||
# cross compiler: Linux glibc aarch64-linux-gnu
|
# cross compiler: Linux glibc aarch64-linux-gnu
|
||||||
build/debug-cross-linux-aarch64: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/cross-linux-aarch64/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-cross-linux-aarch64: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/cross-linux-aarch64/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-cross-linux-aarch64: export CC = aarch64-linux-gnu-gcc
|
build/extra/cross-linux-aarch64/%: export CC = aarch64-linux-gnu-gcc
|
||||||
build/%-cross-linux-aarch64: export CXX = aarch64-linux-gnu-g++
|
build/extra/cross-linux-aarch64/%: export CXX = aarch64-linux-gnu-g++
|
||||||
|
|
||||||
# cross compiler: Linux glibc arm-linux-gnueabihf
|
# cross compiler: Linux glibc arm-linux-gnueabihf
|
||||||
build/debug-cross-linux-arm: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/cross-linux-arm/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-cross-linux-arm: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/cross-linux-arm/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-cross-linux-arm: export CC = arm-linux-gnueabihf-gcc
|
build/extra/cross-linux-arm/%: export CC = arm-linux-gnueabihf-gcc
|
||||||
build/%-cross-linux-arm: export CXX = arm-linux-gnueabihf-g++ -Wno-psabi
|
build/extra/cross-linux-arm/%: export CXX = arm-linux-gnueabihf-g++ -Wno-psabi
|
||||||
|
|
||||||
# cross compiler: Windows win32 mingw32
|
# cross compiler: Windows win32 mingw32
|
||||||
build/debug-cross-mingw32: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/cross-mingw32/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-cross-mingw32: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/cross-mingw32/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-cross-mingw32: export CC = i686-w64-mingw32-gcc
|
build/extra/cross-mingw32/%: export CC = i686-w64-mingw32-gcc
|
||||||
build/%-cross-mingw32: export CXX = i686-w64-mingw32-g++
|
build/extra/cross-mingw32/%: export CXX = i686-w64-mingw32-g++
|
||||||
# disable sanitize to avoid link errors on GitHub CI
|
# disable sanitize to avoid link errors with current MinGW-w64 versions
|
||||||
build/%-cross-mingw32: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1
|
build/extra/cross-mingw32/%: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1
|
||||||
|
|
||||||
# cross compiler: Windows win64 mingw64
|
# cross compiler: Windows win64 mingw64
|
||||||
build/debug-cross-mingw64: PHONY ; $(call run_config_and_build,$@,Debug)
|
build/extra/cross-mingw64/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/release-cross-mingw64: PHONY ; $(call run_config_and_build,$@,Release)
|
build/extra/cross-mingw64/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/%-cross-mingw64: export CC = x86_64-w64-mingw32-gcc
|
build/extra/cross-mingw64/%: export CC = x86_64-w64-mingw32-gcc
|
||||||
build/%-cross-mingw64: export CXX = x86_64-w64-mingw32-g++
|
build/extra/cross-mingw64/%: export CXX = x86_64-w64-mingw32-g++
|
||||||
# disable sanitize to avoid link errors on GitHub CI
|
# disable sanitize to avoid link errors with current MinGW-w64 versions
|
||||||
build/%-cross-mingw64: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1
|
build/extra/cross-mingw64/%: UPX_CMAKE_CONFIG_FLAGS += -DUPX_CONFIG_DISABLE_SANITIZE=1
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# check git submodules
|
# check git submodules
|
||||||
|
@ -34,7 +34,9 @@ podman run "${flags[@]}" "$image" bash -l
|
|||||||
|
|
||||||
# now we can cross-compile UPX for Windows:
|
# now we can cross-compile UPX for Windows:
|
||||||
# cd /home/upx/src/upx
|
# cd /home/upx/src/upx
|
||||||
# rm -rf ./build/release-cross-mingw64
|
# rm -rf ./build/extra/cross-mingw64/release
|
||||||
# make build/release-cross-mingw64
|
# make build/extra/cross-mingw64/release
|
||||||
|
|
||||||
# lots of other cross-compilers are installed; see "ls /usr/bin/*g++*"
|
# lots of other cross-compilers are installed:
|
||||||
|
# - see "ls /usr/bin/*g++*"
|
||||||
|
# - see misc/cross-compile-upx-with-podman/build-all-inside-container.sh
|
||||||
|
@ -27,7 +27,7 @@ function run_config_and_build {
|
|||||||
# these old architectures do not support sanitize
|
# these old architectures do not support sanitize
|
||||||
alpha-linux-gnu) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
alpha-linux-gnu) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
||||||
hppa-linux-gnu) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
hppa-linux-gnu) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
||||||
# avoid link errors with Windows cross compilers; need to install some more support libs??
|
# avoid link errors with current MinGW-w64 versions
|
||||||
i686-w64-mingw32) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
i686-w64-mingw32) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
||||||
x86_64-w64-mingw32) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
x86_64-w64-mingw32) cmake_config_flags=-DUPX_CONFIG_DISABLE_SANITIZE=ON ;;
|
||||||
# avoid warnings about arm libstdc++ ABI change in gcc-7
|
# avoid warnings about arm libstdc++ ABI change in gcc-7
|
||||||
|
@ -47,11 +47,11 @@ podman run "${flags[@]}" "$image" bash -l
|
|||||||
|
|
||||||
# we can also build UPX in the container:
|
# we can also build UPX in the container:
|
||||||
# cd /home/upx/src/upx
|
# cd /home/upx/src/upx
|
||||||
# rm -rf ./build/release
|
# rm -rf ./build/extra/gcc/release
|
||||||
# make build/release
|
# make build/extra/gcc/release
|
||||||
# # run tests
|
# # run tests
|
||||||
# ./build/release/upx --version
|
# ./build/extra/gcc/release/upx --version
|
||||||
# make -C build/release test
|
# make -C build/extra/gcc/release test
|
||||||
|
|
||||||
# and we can also rebuild the UPX docs the container:
|
# and we can also rebuild the UPX docs the container:
|
||||||
# cd /home/upx/src/upx
|
# cd /home/upx/src/upx
|
||||||
|
Reference in New Issue
Block a user