Created
December 6, 2023 20:54
-
-
Save kauefraga/716d3c596e9245504f4dd23a0051eafc to your computer and use it in GitHub Desktop.
๐น A simple cross-platform build script (for Golang).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remember to indent with tabs | |
BINARY_FOLDER=bin | |
BINARY_NAME={} | |
debug: | |
go build -o debug/${BINARY_NAME} ./src/main.go | |
./debug/${BINARY_NAME} | |
# -ldflags=-w remove unnecessary debug tools | |
release: | |
GOOS=darwin go build -ldflags=-w -o ${BINARY_FOLDER}/darwin/${BINARY_NAME} ./src/main.go | |
GOOS=linux go build -ldflags=-w -o ${BINARY_FOLDER}/linux/${BINARY_NAME} ./src/main.go | |
GOOS=windows go build -ldflags=-w -o ${BINARY_FOLDER}/windows/${BINARY_NAME}.exe ./src/main.go | |
clean: | |
go clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment