2016-04-28 09:58:02 -04:00
|
|
|
# Build tool for Factorio Server Manager
|
|
|
|
|
2016-11-02 18:05:14 -04:00
|
|
|
NODE_ENV:=production
|
|
|
|
|
2017-12-21 14:50:29 -08:00
|
|
|
#TODO add support for a mac build maybe?
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
release := build/factorio-server-manager-linux.zip
|
|
|
|
else
|
|
|
|
release := build/factorio-server-manager-windows.zip
|
|
|
|
endif
|
|
|
|
|
|
|
|
build: $(release)
|
|
|
|
|
2019-10-29 22:53:06 +01:00
|
|
|
build/factorio-server-manager-%.zip: clean app/bundle factorio-server-manager-%
|
2019-10-30 15:42:01 +01:00
|
|
|
@mkdir -p build/
|
2017-12-21 14:50:29 -08:00
|
|
|
@echo "Packaging Build - $@"
|
|
|
|
@cp -r app/ factorio-server-manager/
|
|
|
|
@cp conf.json.example factorio-server-manager/conf.json
|
|
|
|
@zip -r $@ factorio-server-manager > /dev/null
|
|
|
|
|
2018-08-12 02:24:31 +02:00
|
|
|
app/bundle:
|
2017-12-21 14:50:29 -08:00
|
|
|
@echo "Building Frontend"
|
2018-08-12 02:24:31 +02:00
|
|
|
@npm install && npm run build
|
2017-12-21 14:50:29 -08:00
|
|
|
|
2019-10-29 22:04:53 +01:00
|
|
|
factorio-server-manager-linux:
|
2017-12-21 14:50:29 -08:00
|
|
|
@echo "Building Backend - Linux"
|
|
|
|
@mkdir -p factorio-server-manager
|
2019-10-29 22:04:53 +01:00
|
|
|
@cd src; \
|
|
|
|
GOOS=linux GOARCH=amd64 go build -o ../factorio-server-manager/factorio-server-manager .
|
2017-12-21 14:50:29 -08:00
|
|
|
|
2019-10-29 22:04:53 +01:00
|
|
|
factorio-server-manager-windows:
|
2017-12-21 14:50:29 -08:00
|
|
|
@echo "Building Backend - Windows"
|
|
|
|
@mkdir -p factorio-server-manager
|
2019-10-29 22:04:53 +01:00
|
|
|
@cd src; \
|
|
|
|
GOOS=windows GOARCH=386 go build -o ../factorio-server-manager/factorio-server-manager.exe .
|
2017-12-21 14:50:29 -08:00
|
|
|
|
|
|
|
gen_release: build/factorio-server-manager-linux.zip build/factorio-server-manager-windows.zip
|
|
|
|
@echo "Done"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning"
|
2019-10-29 22:53:06 +01:00
|
|
|
@-rm -r build/
|
|
|
|
@-rm app/bundle.js
|
|
|
|
@-rm app/bundle.js.map
|
|
|
|
@-rm app/style.css
|
|
|
|
@-rm app/style.css.map
|
|
|
|
@-rm -r app/fonts/vendor/
|
|
|
|
@-rm -r app/images/vendor/
|
2020-10-16 18:13:51 +02:00
|
|
|
@-rm -rf node_modules/
|
2019-10-29 22:53:06 +01:00
|
|
|
@-rm -r pkg/
|
|
|
|
@-rm -r factorio-server-manager
|