forked from SAP/cf-cli-java-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (45 loc) · 1.55 KB
/
Makefile
File metadata and controls
58 lines (45 loc) · 1.55 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
JAVA_PLUGIN_INSTALLED = $(cf plugins | grep -q)
JSTALL_JAR = dist/jstall-minimal.jar
# Set JSTALL_DEV=1 to pull the latest GitHub Actions build instead of the latest release
JSTALL_DEV ?=
all: install
build: compile
$(JSTALL_JAR):
mkdir -p dist
ifdef JSTALL_DEV
ifeq ($(JSTALL_DEV),1)
gh run download -R parttimenerd/jstall -n jstall-minimal-jar --dir dist
else
gh run download $(JSTALL_DEV) -R parttimenerd/jstall -n jstall-minimal-jar --dir dist
endif
else
curl -sL -o $@ https://github.com/parttimenerd/jstall/releases/latest/download/jstall-minimal.jar
endif
download-jstall: $(JSTALL_JAR)
update-jstall:
rm -f $(JSTALL_JAR)
$(MAKE) download-jstall
.PHONY: build compile compile-all update-jstall download-jstall install remove clean vclean
# When JSTALL_DEV=1, always re-download the jar (skip file existence check)
ifdef JSTALL_DEV
JSTALL_DEP = update-jstall
else
JSTALL_DEP = $(JSTALL_JAR)
endif
compile: $(JSTALL_DEP)
go build -o build/cf-cli-java-plugin .
compile-all: $(JSTALL_DEP)
GOOS=linux GOARCH=amd64 go build -o build/cf-cli-java-plugin-linux64 .
GOOS=linux GOARCH=arm64 go build -o build/cf-cli-java-plugin-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -o build/cf-cli-java-plugin-osx .
GOOS=darwin GOARCH=arm64 go build -o build/cf-cli-java-plugin-osx-arm64 .
GOOS=windows GOARCH=amd64 go build -o build/cf-cli-java-plugin-win64.exe .
clean:
rm -r build
install: compile remove
yes | cf install-plugin build/cf-cli-java-plugin
remove: $(objects)
ifeq ($(JAVA_PLUGIN_INSTALLED),)
cf uninstall-plugin java || true
endif
vclean: remove clean