-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 867 Bytes
/
Makefile
File metadata and controls
30 lines (23 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SCRIPTS_DIR ?= $(HOME)/Development/github.com/rios0rios0/pipelines
-include $(SCRIPTS_DIR)/makefiles/common.mk
-include $(SCRIPTS_DIR)/makefiles/golang.mk
VERSION ?= $(or $(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//'),dev)
LDFLAGS := -X main.version=$(VERSION) -X main.repoOwner=rios0rios0 -X main.repoName=devforge -X main.binaryName=dev
.PHONY: debug build build-musl install run
build:
rm -rf bin
go build -ldflags "$(LDFLAGS) -s -w" -o bin/dev ./cmd/devforge
strip -s bin/dev
debug:
rm -rf bin
go build -gcflags "-N -l" -ldflags "$(LDFLAGS)" -o bin/dev ./cmd/devforge
build-musl:
CGO_ENABLED=1 CC=musl-gcc go build \
-ldflags '$(LDFLAGS) -linkmode external -extldflags="-static"' -o bin/dev ./cmd/devforge
strip -s bin/dev
run:
go run ./cmd/devforge
install:
make build
mkdir -p ~/.local/bin
cp -v bin/dev ~/.local/bin/dev