Build system + release win64 + linux64
This commit is contained in:
30
Makefile
Normal file
30
Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
.PHONY: all clean windows linux darwin
|
||||
|
||||
include scripts/platforms.mk
|
||||
|
||||
BINARY_NAME=goonscape
|
||||
VERSION=1.0.0
|
||||
BUILD_DIR=build
|
||||
ASSETS_DIR=resources
|
||||
|
||||
all: clean $(PLATFORMS)
|
||||
|
||||
$(PLATFORMS):
|
||||
@echo "Building for $@..."
|
||||
@mkdir -p $(BUILD_DIR)/$@
|
||||
@scripts/build.sh $(word 1,$(subst /, ,$@)) $(word 2,$(subst /, ,$@)) \
|
||||
$(BUILD_DIR)/$@/$(BINARY_NAME)$(if $(findstring windows,$@),.exe,)
|
||||
@cp -r $(ASSETS_DIR) $(BUILD_DIR)/$@/
|
||||
@cd $(BUILD_DIR) && zip -r $(BINARY_NAME)-$(word 1,$(subst /, ,$@))-$(word 2,$(subst /, ,$@))-v$(VERSION).zip $@
|
||||
@echo "Done building for $@"
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
# Development build for current platform
|
||||
dev:
|
||||
go build -o $(BINARY_NAME)
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
go test ./...
|
Reference in New Issue
Block a user