-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
38 lines (29 loc) · 922 Bytes
/
Makefile
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
# Copyright 2020-2021 Azul Systems, Inc. All rights reserved.
# Use of this source code is governed by the 3-Clause BSD
# license that can be found in the LICENSE file.
MYDIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
APP := jdowser
SCRIPT := ansible-jdowser
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
FILES := \
classfile.go \
classfilereader.go \
config.go \
jvminstallation.go \
main.go \
scanlock.go \
status.go \
utils.go \
all: $(APP) $(SCRIPT)
$(APP): $(FILES:%=$(MYDIR)/src/%) $(VERSION)
V=$$($(MYDIR)/src/version.sh) && \
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags="-s -w -X \"main.VERSION=$${V}\"" -o $@ $^
$(SCRIPT): $(MYDIR)/src/$(SCRIPT)
V=$$($(MYDIR)/src/version.sh) && \
sed "s#%VERSION%#$${V}#" $^ > $@ && chmod +x $@
resolve:
go get -u golang.org/x/sys/unix
clean:
rm -f $(APP) $(SCRIPT)
.PHONY: clean resolve all