2025-04-14 17:35:12 +08:00
|
|
|
ARCHS := amd64 arm64
|
|
|
|
VERSION ?= $(shell git describe --tags --always)
|
|
|
|
all:$(ARCHS)
|
2023-12-10 20:16:07 +08:00
|
|
|
|
2025-04-14 17:35:12 +08:00
|
|
|
$(ARCHS):
|
|
|
|
@echo "Building for $(@)"
|
|
|
|
@GOOS=linux GOARCH=$(@)
|
|
|
|
go build -ldflags "-X main.Version=$(VERSION)" -o target/$(@)/gohttpd
|
|
|
|
cp config.json target/$(@)/
|
|
|
|
cp -r adminui target/$(@)/
|
|
|
|
cp gohttpd.service target/$(@)/
|
|
|
|
cp install.sh target/$(@)/
|
2023-12-10 20:16:07 +08:00
|
|
|
|
|
|
|
clean:
|
2023-12-10 20:49:38 +08:00
|
|
|
go clean
|
|
|
|
rm -rf target
|