Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit 1587f84

Browse files
committed
build: various cleanups
This reuses some variables and moves the PHONY target above each of the dependant targets.
1 parent 0a5b9e0 commit 1587f84

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
export CGO_ENABLED:=0
2-
export GOPATH=$(shell pwd)/gopath
3-
41
# kernel-style V=1 build verbosity
52
ifeq ("$(origin V)", "command line")
63
BUILD_VERBOSE = $(V)
@@ -13,18 +10,20 @@ else
1310
endif
1411

1512
VERSION=$(shell git describe --dirty)
16-
LD_FLAGS="-w -X github.com/coreos/container-linux-config-transpiler/internal/version.Raw=$(VERSION)"
17-
1813
REPO=github.com/coreos/container-linux-config-transpiler
14+
LD_FLAGS="-w -X $(REPO)/internal/version.Raw=$(VERSION)"
1915

20-
all: build
16+
export GOPATH=$(shell pwd)/gopath
17+
export CGO_ENABLED:=0
18+
19+
.PHONY: all
20+
all: bin/ct
2121

2222
gopath:
2323
$(Q)mkdir -p gopath/src/github.com/coreos
2424
$(Q)ln -s ../../../.. gopath/src/$(REPO)
2525

26-
build: bin/ct
27-
26+
.PHONY: test
2827
test:
2928
$(Q)./test
3029

@@ -33,6 +32,7 @@ vendor:
3332
$(Q)glide update --strip-vendor
3433
$(Q)glide-vc --use-lock-file --no-tests --only-code
3534

35+
.PHONY: clean
3636
clean:
3737
$(Q)rm -rf bin
3838

@@ -48,5 +48,3 @@ bin/ct-%-x86_64-pc-windows-gnu.exe: GOARGS = GOOS=windows GOARCH=amd64
4848

4949
bin/%: | gopath
5050
$(Q)$(GOARGS) go build -o $@ -ldflags $(LD_FLAGS) $(REPO)/internal
51-
52-
.PHONY: all build clean test

0 commit comments

Comments
 (0)