forked from lusis/go-artifactory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (31 loc) · 921 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
39
40
41
42
43
44
BINARIES := $(shell find cmd/ -maxdepth 1 -type d -name 'artif-*' -exec sh -c 'echo $(basename {})' \;)
BINLIST := $(subst cmd/,,$(BINARIES))
ifeq ($(TRAVIS_BUILD_DIR),)
GOPATH := $(GOPATH)
else
GOPATH := $(GOPATH):$(TRAVIS_BUILD_DIR)
endif
all: clean lint test artifactory $(BINLIST)
linux: export GOOS=linux
linux: all linux-zip
osx: export GOOS=darwin
osx: clean artifactory $(BINLIST) osx-zip
lint:
@script/lint
test:
@script/test
artifactory:
@echo "Building for $(GOOS)"
@script/build
$(BINLIST):
@echo $@
@go build -o bin/$@ ./cmd/$@
osx-zip:
@mkdir target || echo "directory already exists"
@zip -j target/artifactory-tools-osx-`date +%s`.zip bin/darwin_amd64/*
linux-zip:
@mkdir target || echo "directory already exists"
@zip -j target/artifactory-tools-linux-`date +%s`.zip bin/*
clean:
@rm -rf bin/ pkg/
.PHONY: all clean lint test artifactory osx-zip linux-zip osx linux $(BINLIST)