diff options
author | lns <matzeton@googlemail.com> | 2022-09-20 12:29:48 +0200 |
---|---|---|
committer | lns <matzeton@googlemail.com> | 2022-09-20 17:34:46 +0200 |
commit | 5086b13f9e486e2ed953bf5eccb6851bd6e2b1b4 (patch) | |
tree | 5220d3d044d9b6c4221513f30e413ee4ffaa8fe8 | |
parent | 74146a39c666a87d0480125669feb9901e5bc8cb (diff) |
Build DPP with a toolchain tarball generated by mingw-w64-build-ng.
* integrate into CircleCI
Signed-off-by: lns <matzeton@googlemail.com>
-rw-r--r-- | .circleci/config.yml | 46 | ||||
-rw-r--r-- | .github/workflows/build.yml | 3 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | Makefile.deps | 27 | ||||
-rw-r--r-- | Makefile.inc | 15 |
5 files changed, 88 insertions, 21 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index e26ea1a..1cd7097 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,19 +15,37 @@ jobs: git subversion curl xz-utils osslsigncode \ binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-x86-64-dev - run: | - env DEBIAN_FRONTEND=noninteractive \ - make -C . -f Makefile.deps all \ - WERROR=1 JOBS=4 Q= \ - CC=/usr/bin/x86_64-w64-mingw32-gcc \ - CXX=/usr/bin/x86_64-w64-mingw32-g++ \ - RC=/usr/bin/x86_64-w64-mingw32-windres \ - DDK_INCLUDE_DIR=/usr/x86_64-w64-mingw32/include/ddk + make deps \ + WERROR=1 JOBS=4 Q= \ + LOCAL_MINGW64_CC=/usr/bin/x86_64-w64-mingw32-gcc \ + LOCAL_MINGW64_CXX=/usr/bin/x86_64-w64-mingw32-g++ \ + LOCAL_MINGW64_RC=/usr/bin/x86_64-w64-mingw32-windres \ + DDK_INCLUDE_DIR=/usr/x86_64-w64-mingw32/include/ddk + - run: | + test -r EASTL-build/libEASTL.a - run: | - env DEBIAN_FRONTEND=noninteractive \ make examples-install \ - WERROR=1 Q= \ - CC=/usr/bin/x86_64-w64-mingw32-gcc \ - CXX=/usr/bin/x86_64-w64-mingw32-g++ \ - RC=/usr/bin/x86_64-w64-mingw32-windres \ - DDK_INCLUDE_DIR=/usr/x86_64-w64-mingw32/include/ddk \ - DESTDIR=$(realpath _install) + WERROR=1 JOBS=4 Q= \ + LOCAL_MINGW64_CC=/usr/bin/x86_64-w64-mingw32-gcc \ + LOCAL_MINGW64_CXX=/usr/bin/x86_64-w64-mingw32-g++ \ + LOCAL_MINGW64_RC=/usr/bin/x86_64-w64-mingw32-windres \ + DDK_INCLUDE_DIR=/usr/x86_64-w64-mingw32/include/ddk \ + DESTDIR=$(realpath _install) + - run: | + test -r _install/codesign-ca-cert.crt -a \ + -r _install/dpp-example.bat -a \ + -r _install/dpp-example-cplusplus.bat -a \ + -r _install/dpp-example-cplusplus-EASTL.bat -a \ + -r _install/dpp-example.sys -a \ + -r _install/dpp-example-cplusplus.sys -a \ + -r _install/dpp-example-cplusplus-EASTL.sys + - run: | + wget 'https://github.com/utoni/mingw-w64-build-ng/releases/download/v1.0/mingw-w64-toolchain.tbz2' -O ./mingw-w64-toolchain.tbz2 + - run: | + make examples-clean + - run: | + make deps-distclean + - run: | + make deps \ + WERROR=1 JOBS=4 Q= \ + USE_MINGW64_TARBALL=./mingw-w64-toolchain.tbz2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5edbcd4..06a5415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,11 @@ on: push: branches: - main + - tmp pull_request: branches: - main + - tmp types: [opened, synchronize, reopened] release: types: [created] @@ -53,6 +55,7 @@ jobs: run: | make examples-install DESTDIR=$(realpath _install) ls -alh _install + test -r _install/codesign-ca-cert.crt -a -r _install/dpp-example.bat -a -r _install/dpp-example-cplusplus.bat -a -r _install/dpp-example-cplusplus-EASTL.bat -a -r _install/dpp-example.sys -a -r _install/dpp-example-cplusplus.sys -a -r _install/dpp-example-cplusplus-EASTL.sys - name: Cleanup run: | make deps-clean @@ -8,6 +8,16 @@ ifndef JOBS JOBS := 4 endif +export Q +export DPP_ROOT +export JOBS +export USE_MINGW64_TARBALL +export LOCAL_MINGW64_CC +export LOCAL_MINGW64_CXX +export LOCAL_MINGW64_RC +export SIGNTOOL +export SIGNTOOL_PREFIX + examples: $(MAKE) -C examples DPP_ROOT=$(realpath $(DPP_ROOT)) all @@ -18,14 +28,18 @@ examples-install: $(MAKE) -C examples DPP_ROOT=$(realpath $(DPP_ROOT)) install deps: - $(MAKE) -C $(DPP_ROOT) -f Makefile.deps WERROR=1 JOBS=$(JOBS) Q=$(Q) - $(MAKE) -C $(DPP_ROOT) -f Makefile.deps BUILD_NATIVE=1 WERROR=1 JOBS=$(JOBS) Q=$(Q) + $(MAKE) -C $(DPP_ROOT) -f Makefile.deps \ + WERROR=1 + $(MAKE) -C $(DPP_ROOT) -f Makefile.deps \ + BUILD_NATIVE=1 WERROR=1 deps-distclean: $(MAKE) -C $(DPP_ROOT) -f Makefile.deps distclean + $(MAKE) -C $(DPP_ROOT) -f Makefile.deps BUILD_NATIVE=1 distclean deps-clean: $(MAKE) -C $(DPP_ROOT) -f Makefile.deps clean + $(MAKE) -C $(DPP_ROOT) BUILD_NATIVE=1 -f Makefile.deps clean help: $(MAKE) -C $(DPP_ROOT) -f Makefile.deps help diff --git a/Makefile.deps b/Makefile.deps index 0dd33d8..ad476c3 100644 --- a/Makefile.deps +++ b/Makefile.deps @@ -49,14 +49,30 @@ endif $(LOCAL_MINGW64_BUILD_SCRIPT): ifeq ($(CC),$(LOCAL_MINGW64_CC)) @echo - @echo "------------------------------------------------------------------------------" - @echo "-- ./mingw-w64-build/mingw-w64-build does not exist, clonging git submodule --" - @echo "------------------------------------------------------------------------------" + @echo "-----------------------------------------------------------------------------" + @echo "-- ./mingw-w64-build/mingw-w64-build does not exist, cloning git submodule --" + @echo "-----------------------------------------------------------------------------" @echo git submodule update --init mingw-w64-build endif +ifeq ($(USE_MINGW64_TARBALL),) $(LOCAL_MINGW64_CC): $(LOCAL_MINGW64_BUILD_SCRIPT) +else +$(LOCAL_MINGW64_CC): +endif +ifneq ($(USE_MINGW64_TARBALL),) + @echo + @echo "------------------------------------------------------------------------------------------------" + @echo "-- USE_MINGW64_TARBALL found: $(USE_MINGW64_TARBALL) --" + @echo "------------------------------------------------------------------------------------------------" + @echo +ifneq ($(Q),@) + tar -xjvf '$(USE_MINGW64_TARBALL)' +else + tar -xjf '$(USE_MINGW64_TARBALL)' +endif +else ifeq ($(CC),$(LOCAL_MINGW64_CC)) @echo @echo "------------------------------------------------------------------------------------------------" @@ -70,6 +86,7 @@ ifeq ($(CC),$(LOCAL_MINGW64_CC)) @echo 'export PATH="$${MYDIR}/$(SYSROOT_X64)/bin:$${MYDIR}/bin:$${PATH}"' >>$(ACTIVATE_SH) @chmod +x $(ACTIVATE_SH) endif +endif ifeq ($(CC),$(LOCAL_MINGW64_CC)) $(LOCAL_MINGW64_CXX): $(LOCAL_MINGW64_CC) @@ -108,7 +125,7 @@ distclean: clean rm -rf $(LOCAL_MINGW64_BUILD_DIR) git submodule deinit --all -clean: $(EASTL_STATIC_LIB) +clean: rm -f $(DRIVER_CRT) $(DRIVER_CRTPLUSPLUS) $(USER_CRT) $(EASTL_STATIC_LIB) rm -f $(DRIVER_ADDITIONAL_OBJS) rm -rf $(EASTL_BUILDDIR) @@ -133,7 +150,7 @@ $(EASTL_STATIC_LIB): $(CXX) $(EASTL_DEPS) distclean: clean -clean: $(EASTL_STATIC_LIB) +clean: rm -f $(USER_CRT) $(EASTL_STATIC_LIB) rm -rf $(EASTL_BUILDDIR) diff --git a/Makefile.inc b/Makefile.inc index 8e65b2e..bb564c5 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -13,13 +13,28 @@ ifeq ($(Q),) CMAKE_Q = VERBOSE=1 endif DPP_ROOT = $(realpath .) +ifeq ($(LOCAL_MINGW64_CC),) LOCAL_MINGW64_BUILD_SCRIPT := $(DPP_ROOT)/mingw-w64-build/mingw-w64-build LOCAL_MINGW64_BUILD_DIR := $(DPP_ROOT)/mingw-w64-sysroot/x86_64 LOCAL_MINGW64_CC := $(LOCAL_MINGW64_BUILD_DIR)/bin/x86_64-w64-mingw32-gcc LOCAL_MINGW64_CXX := $(LOCAL_MINGW64_BUILD_DIR)/bin/x86_64-w64-mingw32-g++ LOCAL_MINGW64_RC := $(LOCAL_MINGW64_BUILD_DIR)/bin/x86_64-w64-mingw32-windres +else +ifeq ($(LOCAL_MINGW64_CXX),) +$(error LOCAL_MINGW64_CC was set, missing required LOCAL_MINGW64_CXX) +endif +ifeq ($(LOCAL_MINGW64_RC),) +$(error LOCAL_MINGW64_CC was set, missing required LOCAL_MINGW64_RC) +endif +endif + +ifeq ($(SIGNTOOL),) SIGNTOOL := osslsigncode +endif + +ifeq ($(SIGNTOOL_PREFIX),) SIGNTOOL_PREFIX := codesign +endif DDK_GLOBAL_DEPS := deps $(LOCAL_MINGW64_BUILD_SCRIPT) $(LOCAL_MINGW64_BUILD_DIR) $(LOCAL_MINGW64_CC) $(LOCAL_MINGW64_CXX) $(LOCAL_MINGW64_RC) |