From 47bdfb3089ab7166b815606add7b438c361a9088 Mon Sep 17 00:00:00 2001 From: "anton.gurov" Date: Wed, 6 Nov 2019 13:26:02 +0300 Subject: [PATCH] mac makefile instructions --- Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3641b85..174a2c8 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,9 @@ +# +## +# Take a note - you MUST set CGO_ENABLED to true for cross-compilation +## +# +# PROJECT_NAME := "alchemyst-go" PKG := "lab.zaar.be/thefish/$(PROJECT_NAME)" GO=$(shell which go) @@ -15,7 +21,7 @@ all: build test #build: build.spec build.server build: distclean build.deps build.game -build.game: build.game.linux64 build.game.win64 +build.game: build.game.linux64 build.game.win64 build.game.mac build.deps: GIT_SSL_NO_VERIFY=true $(GO) mod vendor @@ -36,13 +42,21 @@ build.game.win64: strip $(DISTFOLDER)/game.exe && \ cd $(DISTFOLDER) && zip -r ../$(PROJECT_NAME)-$(OS)-${PKG_VER}.zip . -x *.git* +build.game.mac: + cp $(CWD)/lib/mac/libBearLibTerminal.dylib $(DISTFOLDER) && \ + cp $(CWD)/config.json $(DISTFOLDER) && \ + cp -r $(CWD)/resources $(DISTFOLDER) && \ + OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1 MACOSX_DEPLOYMENT_TARGET=10.6 CC=o64-clang CXX=o64-clang++ GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 $(GO) build -ldflags $(LDFLAGS) -o $(DISTFOLDER)/game $(CWD)/cmd/game/main.go && \ + strip $(DISTFOLDER)/game.exe && \ + cd $(DISTFOLDER) && zip -r ../$(PROJECT_NAME)-$(OS)-${PKG_VER}.zip . -x *.git* + test: $(GO) test -v $(go list ./... | grep -v /vendor/) distclean: # find . ! -name '.gitkeep' ! -path 'linux64' ! -path 'win64' -exec rm -rf {} \; cd $(CWD)/dist && find . -type f -not \( -name .gitkeep -o -name README \) -delete && \ - find . -type d -not \( -name .gitkeep -o -name linux64 -o -name win64 \) -delete + find . -type d -not \( -name .gitkeep -o -name linux64 -o -name win64 -o -name mac\) -delete