Skip to content

Commit

Permalink
Merge pull request #28 from wking/makefile-pattern-rule
Browse files Browse the repository at this point in the history
Makefile: Add a pattern rule for oci-* commands
  • Loading branch information
vbatts authored Oct 6, 2016
2 parents bf96365 + 2d06368 commit ff224f8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export GO15VENDOREXPERIMENT
COMMIT=$(shell git rev-parse HEAD 2> /dev/null || true)

EPOCH_TEST_COMMIT ?= v0.2.0
TOOLS := \
oci-create-runtime-bundle \
oci-image-validate \
oci-unpack

default: help

Expand All @@ -20,10 +24,10 @@ check-license:
@echo "checking license headers"
@./.tool/check-license

tools:
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/oci-create-runtime-bundle
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/oci-unpack
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/oci-image-validate
tools: $(TOOLS)

$(TOOLS): oci-%:
go build -ldflags "-X main.gitCommit=${COMMIT}" ./cmd/$@

lint:
@echo "checking lint"
Expand Down Expand Up @@ -69,13 +73,11 @@ install.tools: .install.gitvalidation .install.glide .install.glide-vc .install.
gometalinter --install --update

clean:
rm -rf *~ $(OUTPUT_DIRNAME)
rm -f oci-create-runtime-bundle
rm -f oci-unpack
rm -f oci-image-validate
rm -rf *~ $(OUTPUT_DIRNAME) $(TOOLS)

.PHONY: \
tools \
$(TOOLS) \
check-license \
clean \
lint \
Expand Down

0 comments on commit ff224f8

Please sign in to comment.