From 3f95dd6916c079f0434d086be267a94a9111a303 Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Tue, 7 Nov 2023 20:21:10 +0100 Subject: [PATCH] Restructure go Makefile: Build the per-platform target. This changes the default build target we use to build the go extractor to use th per-platform targets (requires internal change to follow up). This also builds the macos target as universal binary. --- go/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/Makefile b/go/Makefile index 24688cce942e..d0289a093a52 100644 --- a/go/Makefile +++ b/go/Makefile @@ -47,7 +47,7 @@ endif qhelp-to-markdown: scripts/qhelp-to-markdown.sh ql/src "$(QHELP_OUT_DIR)" -tools: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) tools/tokenizer.jar +tools: tools-codeql tools/tokenizer.jar .PHONY: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))): @@ -67,7 +67,10 @@ tools-osx64: $(addprefix tools/osx64/,$(BINARIES)) .PHONY: $(addprefix tools/osx64/,$(BINARIES)) $(addprefix tools/osx64/,$(BINARIES)): - GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(@F) + GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@.amd64 ./cli/$(@F) + GOOS=darwin GOARCH=arm64 go build -C extractor -mod=vendor -o ../$@.arm64 ./cli/$(@F) + lipo -create $@.amd64 $@.arm64 -output $@ + rm $@.amd64 $@.arm64 tools-win64: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES)))