mirror of
https://github.com/gmemstr/sliproad.git
synced 2024-09-19 16:11:11 +01:00
a686cb8c53
This is a workaround for the CircleCI Docker image, and should be removed soon-ish. Before patching, the `make_build_dir` Makefile command would fail, producing a single directory rather than all 3.
35 lines
911 B
Makefile
35 lines
911 B
Makefile
.DEFAULT_GOAL := build
|
|
NAS_VERSION := 2.0.0
|
|
# Workaround for CircleCI Docker image and mkdir.
|
|
SHELL := /bin/bash
|
|
|
|
make_build_dir:
|
|
mkdir -p build/{bin,assets,tars}
|
|
|
|
build: make_build_dir
|
|
go build -o build/bin/nas
|
|
|
|
pi: make_build_dir
|
|
env GOOS=linux GOARCH=arm GOARM=5 go build -o build/bin/nas-arm
|
|
|
|
small: make_build_dir
|
|
go build -o build/bin/nas -ldflags="-s -w"
|
|
upx --brute build/bin/nas -9 --no-progress
|
|
|
|
small_pi: make_build_dir
|
|
env GOOS=linux GOARCH=arm GOARM=5 go build -o build/bin/nas-arm -ldflags="-s -w"
|
|
upx --brute build/bin/nas-arm -9 --no-progress
|
|
|
|
run:
|
|
go run webserver.go
|
|
|
|
test:
|
|
go test ./... -cover
|
|
|
|
dist: clean make_build_dir small small_pi
|
|
cp -r assets/* build/assets
|
|
tar -czf build/tars/nas-$(NAS_VERSION)-arm.tar.gz build/assets build/bin/nas-arm README.md LICENSE
|
|
tar -czf build/tars/nas-$(NAS_VERSION)-x86.tar.gz build/assets build/bin/nas README.md LICENSE
|
|
|
|
clean:
|
|
rm -rf build
|