Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit db676a3

Browse files
committed
Makefile changes
1 parent 9427db3 commit db676a3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

common.mk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ ifndef VERBOSE
1414
MAKEFLAGS += --no-print-directory
1515
endif
1616

17+
ifneq (, $(GOOS))
18+
ifneq (, $(GOARCH))
19+
ifneq (, $(GOBIN))
20+
$(error "Cross compilation cannot work with GOBIN defined. Stopping build.")
21+
endif
22+
endif
23+
endif
24+
25+
ifneq (, $(GOOS))
26+
ifeq (, $(GOARCH))
27+
$(error "Cross compilation requires both GOOS and GOARCH to be specified. Stopping build.")
28+
endif
29+
endif
30+
31+
ifeq (, $(GOOS))
32+
ifneq (, $(GOARCH))
33+
$(error "Cross compilation requires both GOOS and GOARCH to be specified. Stopping build.")
34+
endif
35+
endif
36+
1737
ifeq (, $(GOOS))
1838
RACE_CHECK=-race
1939
else

0 commit comments

Comments
 (0)