From a14b4ac6507b65d9b2d5e22ff89cf89c689cd936 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 24 Apr 2020 18:57:01 +0200 Subject: [bug] do not use cross-compiling for the helper in win - add -H windowsgui to avoid console popping up --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 950c6fd..ec642b2 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ dependsCygwin: @choco install -y golang python nssm nsis wget 7zip build: - $(MAKE) _buildparts + echo "XBUILD>", ${XBUILD} ifeq (${XBUILD}, yes) $(MAKE) build_cross_win $(MAKE) build_cross_osx @@ -68,11 +68,14 @@ else ifeq (${XBUILD}, win) else ifeq (${XBUILD}, osx) $(MAKE) build_cross_osx $(MAKE) _build_done +else + $(MAKE) _buildparts endif _buildparts: $(foreach path,$(wildcard cmd/*),build_$(patsubst cmd/%,%,$(path))) build_%: + @echo "PLATFORM: ${PLATFORM}" @mkdir -p build/bin/${PLATFORM} go build -tags $(TAGS) -ldflags "-s -w -X main.version=`git describe --tags` ${EXTRA_LDFLAGS}" -o build/bin/${PLATFORM}/$* ./cmd/$* -@rm -rf build/${PROVIDER}/staging/${PLATFORM} && mkdir -p build/${PROVIDER}/staging/${PLATFORM} @@ -91,7 +94,11 @@ CROSS_WIN_FLAGS = CGO_ENABLED=1 GOARCH=386 GOOS=windows CC="/usr/bin/i686-w64-mi PLATFORM_WIN = PLATFORM=windows EXTRA_LDFLAGS_WIN = EXTRA_LDFLAGS="-H windowsgui" build_cross_win: + @echo "[+] Cross-building for windows..." $(CROSS_WIN_FLAGS) $(PLATFORM_WIN) $(EXTRA_LDFLAGS_WIN) $(MAKE) _buildparts + # workaround for helper: we use the go compiler + @echo "[+] Compiling helper with the Go compiler to work around missing stdout bug..." + cd cmd/bitmask-helper && GOOS=windows GOARCH=386 go build -ldflags "-X main.version=`git describe --tags` -H windowsgui" -o ../../build/bin/windows/bitmask-helper-go CROSS_OSX_FLAGS = MACOSX_DEPLOYMENT_TARGET=10.10 CGO_ENABLED=1 GOOS=darwin CC="o64-clang" PLATFORM_OSX = PLATFORM=darwin -- cgit v1.2.3