mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-27 20:14:54 +02:00
41 lines
1.9 KiB
Makefile
41 lines
1.9 KiB
Makefile
TARGET ?= osmedeus
|
|
GO ?= go
|
|
GOFLAGS ?=
|
|
VERSION := $(shell cat libs/version.go | grep 'VERSION =' | cut -d '"' -f 2)
|
|
|
|
build:
|
|
go install
|
|
go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET)
|
|
|
|
release:
|
|
go install
|
|
@echo "==> Clean up old builds"
|
|
rm -rf ./dist/* ~/myGit/premium-$(TARGET)-base/dist/* ~/org-$(TARGET)/$(TARGET)-base/dist/*
|
|
@echo "==> building binaries for for mac intel"
|
|
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET)
|
|
zip -9 -j dist/$(TARGET)-macos-amd64.zip dist/$(TARGET) && rm -rf ./dist/$(TARGET)
|
|
@echo "==> building binaries for for mac M1 chip"
|
|
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET)
|
|
zip -9 -j dist/$(TARGET)-macos-arm64.zip dist/$(TARGET)&& rm -rf ./dist/$(TARGET)
|
|
@echo "==> building binaries for linux intel build on mac"
|
|
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET)
|
|
zip -j dist/$(TARGET)-linux-amd64.zip dist/$(TARGET)&& rm -rf ./dist/$(TARGET)
|
|
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -tags netgo -trimpath -buildmode=pie -o dist/$(TARGET)
|
|
zip -j dist/$(TARGET)-linux-arm64.zip dist/$(TARGET)&& rm -rf ./dist/$(TARGET)
|
|
cp dist/* ~/myGit/premium-$(TARGET)-base/dist/
|
|
cp dist/* ~/org-$(TARGET)/$(TARGET)-base/dist/
|
|
@echo "==> Generating metadata info"
|
|
$(TARGET) update --gen dist/public.json
|
|
mv dist/$(TARGET)-macos-amd64.zip dist/$(TARGET)-$(VERSION)-macos-amd64.zip
|
|
mv dist/$(TARGET)-macos-arm64.zip dist/$(TARGET)-$(VERSION)-macos-arm64.zip
|
|
mv dist/$(TARGET)-linux-amd64.zip dist/$(TARGET)-$(VERSION)-linux-amd64.zip
|
|
mv dist/$(TARGET)-linux-arm64.zip dist/$(TARGET)-$(VERSION)-linux-arm64.zip
|
|
run:
|
|
$(GO) $(GOFLAGS) run *.go
|
|
|
|
fmt:
|
|
$(GO) $(GOFLAGS) fmt ./...; \
|
|
echo "Done."
|
|
|
|
test:
|
|
$(GO) $(GOFLAGS) test ./... -v%
|