Skip to content

Commit

Permalink
Makefile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarpicas committed Mar 31, 2020
1 parent 9427db3 commit db676a3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ ifndef VERBOSE
MAKEFLAGS += --no-print-directory
endif

ifneq (, $(GOOS))
ifneq (, $(GOARCH))
ifneq (, $(GOBIN))
$(error "Cross compilation cannot work with GOBIN defined. Stopping build.")
endif
endif
endif

ifneq (, $(GOOS))
ifeq (, $(GOARCH))
$(error "Cross compilation requires both GOOS and GOARCH to be specified. Stopping build.")
endif
endif

ifeq (, $(GOOS))
ifneq (, $(GOARCH))
$(error "Cross compilation requires both GOOS and GOARCH to be specified. Stopping build.")
endif
endif

ifeq (, $(GOOS))
RACE_CHECK=-race
else
Expand Down

0 comments on commit db676a3

Please sign in to comment.