Skip to content

Instantly share code, notes, and snippets.

@moul
Last active June 9, 2016 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moul/4f0580ae940b2956043bab78a82a60c2 to your computer and use it in GitHub Desktop.
Save moul/4f0580ae940b2956043bab78a82a60c2 to your computer and use it in GitHub Desktop.
Makefile
$ find .
cmd/countrychange/main.go
cmd/visitpoints/main.go
countrychange/1.go
countrychange/2.go
visitpoints/3.go
visitpoints/4.go
Makefile
.PHONY: countrychange
countrychange:
go install ./cmd/$@
.PHONY: visitpoints
visitpoints:
go install ./cmd/$@
PACKAGES := countrychange visitpoints
.PHONY: $(PACKAGES)
$(PACKAGES):
go install ./cmd/$@
PACKAGES := $(notdir $(wildcard ./cmd/*))
.PHONY: $(PACKAGES)
$(PACKAGES):
go install ./cmd/$@
PACKAGES := $(notdir $(wildcard ./cmd/*))
SOURCES := $(find . -name "*.go")
.PHONY: $(PACKAGES)
$(PACKAGES): $(SOURCES)
go install ./cmd/$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment