-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.17 KB
/
Makefile
File metadata and controls
63 lines (49 loc) · 1.17 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Go parameters
GOCMD=go
GOMOD=$(GOCMD) mod
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
current_dir := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
GOBIN ?= $(current_dir)/bin
prefix = /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
PKGBASE := github.com/openxt/openxt-go
PKGS := argo db ioctl
CMDS := argo-nc dbdcmd dbus-send
VERSION := 0.1.0
# FIPS is not available until Go 1.24
#FIPS = GOFIPS140=v1.0.0
ifeq (1,${STATIC})
ENV = CGO_ENABLED=0 GOOS=linux ${FIPS}
FLAGS = -a -ldflags '-s -w -extldflags "-static"'
else
ENV = ${FIPS}
FLAGS = -ldflags="-s -w"
endif
all: ${CMDS}
clean:
@$(GOCLEAN)
rm -rf $(GOBIN)
install: all
@- $(foreach CMD, $(CMDS), \
install -Dpm 0755 $(GOBIN)/$(CMD) $(DESTDIR)$(bindir)/$(CMD); \
)
dep:
$(GOMOD) download
vet:
@- $(foreach PKG, $(PKGS), \
$(GOVET) $(PKGBASE)/$(PKG); \
)
@- $(foreach CMD, $(CMDS), \
$(GOVET) $(PKGBASE)/cmd/$(CMD); \
)
gobin:
[ -e "$(GOBIN)" ] || mkdir $(GOBIN)
pkgsite: gobin
GOBIN=$(GOBIN) $(GOINSTALL) golang.org/x/pkgsite/cmd/pkgsite@latest
${CMDS}: gobin dep
$(ENV) $(GOBUILD) -o $(GOBIN)/$@ $(FLAGS) $(PKGBASE)/cmd/$@