Makefile files to make the code compile in Mac
@@ -25,9 +25,10 @@ DOCKERDIR := docker
RELEASEDIR := release
TARGET_OS := linux windows darwin
+GOHOSTOS := $(shell go env GOHOSTOS)
ifndef GOOS
- GOOS := $(shell go env GOHOSTOS)
+ GOOS := $GOHOSTOS
endif
ifndef GOARCH
@@ -63,18 +64,23 @@ SIDECAR_RELEASE_NAME := $(SIDECAR_APP_NAME)-$(APP_VER)-$(GOOS)-$(GOARCH)
EXAMPLES_RELEASE_NAME := a8examples-$(APP_VER)
# build flags
-BUILDFLAGS := -i
+BUILDFLAGS :=
# linker flags
LDFLAGS :=
-ifeq ($(GOOS),linux)
+# These do not work on Mac.
+ifeq ($(GOHOSTOS),linux)
+ # install pkgs to speed up compilation
+ BUILDFLAGS += -i
+
# linker flags to strip symbol tables and debug information
LDFLAGS += -s -w
+ LDFLAGS += -linkmode external
+endif
# linker flags to enable static linking
- LDFLAGS += -linkmode external -extldflags -static
-endif
+LDFLAGS += -extldflags -static
# linker flags to set build info variables
BUILD_SYM := github.com/amalgam8/amalgam8/pkg/version
