Skip to content

Commit

Permalink
Merge pull request #9 from 3viLMonk3y/macos-multiarch-fat-mach-o-dylib
Browse files Browse the repository at this point in the history
build fat-mach-o binary for pygore
  • Loading branch information
TcM1911 committed Apr 14, 2023
2 parents dbc28a8 + bcd8149 commit 0650fda
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CGO=CGO_ENABLED=1
BUILD_OPTS=-ldflags="-s -w" -buildmode=c-shared
WINDOWS_GO_ENV=GOOS=windows $(ARCH) $(CGO) CC=x86_64-w64-mingw32-gcc
LINUX_GO_ENV=GOOS=linux $(ARCH) $(CGO)
DARWIN_GO_ENV=GOOS=darwin $(ARCH) $(CGO)
DARWIN_GO_ENV=GOOS=darwin $(CGO)

.DEFAULT_GOAL := help

Expand All @@ -47,7 +47,10 @@ help:
.PHONY: darwin
darwin: ## Make binary for macOS
@echo -e "$(OK_COLOR)[$(APP)] Build for macOS$(NO_COLOR)"
@$(DARWIN_GO_ENV) $(GO) build -o $(APP).dylib $(BUILD_OPTS) .
@GOARCH=amd64 $(DARWIN_GO_ENV) $(GO) build -o $(APP).amd64.dylib $(BUILD_OPTS) .
@GOARCH=arm64 $(DARWIN_GO_ENV) $(GO) build -o $(APP).arm64.dylib $(BUILD_OPTS) .
@lipo -create -output $(APP).dylib $(APP).amd64.dylib $(APP).arm64.dylib
@rm $(APP).amd64.dylib $(APP).arm64.dylib

.PHONY: windows
windows: ## Make binary for Windows
Expand Down

0 comments on commit 0650fda

Please sign in to comment.