Skip to content

Commit 3f95dd6

Browse files
committed
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.
1 parent b632947 commit 3f95dd6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

go/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif
4747
qhelp-to-markdown:
4848
scripts/qhelp-to-markdown.sh ql/src "$(QHELP_OUT_DIR)"
4949

50-
tools: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) tools/tokenizer.jar
50+
tools: tools-codeql tools/tokenizer.jar
5151

5252
.PHONY: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES)))
5353
$(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))):
@@ -67,7 +67,10 @@ tools-osx64: $(addprefix tools/osx64/,$(BINARIES))
6767

6868
.PHONY: $(addprefix tools/osx64/,$(BINARIES))
6969
$(addprefix tools/osx64/,$(BINARIES)):
70-
GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@ ./cli/$(@F)
70+
GOOS=darwin GOARCH=amd64 go build -C extractor -mod=vendor -o ../$@.amd64 ./cli/$(@F)
71+
GOOS=darwin GOARCH=arm64 go build -C extractor -mod=vendor -o ../$@.arm64 ./cli/$(@F)
72+
lipo -create $@.amd64 $@.arm64 -output $@
73+
rm $@.amd64 $@.arm64
7174

7275
tools-win64: $(addsuffix .exe,$(addprefix tools/win64/,$(BINARIES)))
7376

0 commit comments

Comments
 (0)