Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 8c7d517

Browse files
Merge pull request #42 from r2d4/makefile
Makefile
2 parents 92d4f0e + 12cb722 commit 8c7d517

File tree

8 files changed

+385
-5
lines changed

8 files changed

+385
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
tests/*_actual.json
2+
out/*

Godeps/Godeps.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
VERSION_MAJOR ?= 0
2+
VERSION_MINOR ?= 2
3+
VERSION_BUILD ?= 0
4+
5+
GOOS ?= $(shell go env GOOS)
6+
GOARCH = amd64
7+
BUILD_DIR ?= ./out
8+
ORG := github.com/GoogleCloudPlatform
9+
PROJECT := container-diff
10+
REPOPATH ?= $(ORG)/$(PROJECT)
11+
12+
SUPPORTED_PLATFORMS := linux-amd64 darwin-amd64
13+
BUILD_PACKAGE = $(REPOPATH)
14+
15+
# These build tags are from the containers/image library.
16+
#
17+
# container_image_ostree_stub allows building the library without requiring the libostree development libraries
18+
# container_image_openpgp forces a Golang-only OpenPGP implementation for signature verification instead of the default cgo/gpgme-based implementation
19+
GO_BUILD_TAGS := "container_image_ostree_stub containers_image_openpgp"
20+
GO_FILES := $(shell go list -f '{{join .Deps "\n"}}' $(BUILD_PACKAGE) | grep $(ORG) | xargs go list -f '{{ range $$file := .GoFiles }} {{$$.Dir}}/{{$$file}}{{"\n"}}{{end}}')
21+
22+
$(BUILD_DIR)/$(PROJECT): out/$(PROJECT)-$(GOOS)-$(GOARCH)
23+
cp $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH) $@
24+
25+
$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(GO_FILES) $(BUILD_DIR)
26+
GOOS=$* GOARCH=$(GOARCH) go build -tags $(GO_BUILD_TAGS) -o $@ $(BUILD_PACKAGE)
27+
28+
$(BUILD_DIR):
29+
mkdir -p $(BUILD_DIR)
30+
31+
.PHONY: cross
32+
cross: $(foreach platform, $(SUPPORTED_PLATFORMS), out/$(PROJECT)-$(platform))
33+
34+
.PHONY: test
35+
test: $(BUILD_DIR)/$(PROJECT)
36+
./.container-diff-tests.sh
37+
38+
.PHONY: clean
39+
clean:
40+
rm -rf $(BUILD_DIR)
41+
42+

vendor/code.cloudfoundry.org/bytefmt/LICENSE

Lines changed: 201 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/code.cloudfoundry.org/bytefmt/NOTICE

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/code.cloudfoundry.org/bytefmt/README.md

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)