This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find all files matching "src/*.go" and replace "src/%.go" with "bin/%" | |
OUTPUTS := $(patsubst src/%.go,bin/%,$(wildcard src/*.go)) | |
# Reference all files to be built in a single rule | |
all: $(OUTPUTS) | |
# Rule for compiling a single output file in bin/ | |
bin/%: src/%.go | |
# $* is replaced with the value of the wildcard in the rule (%) | |
go build -o bin/$* src/$*.go |
OlderNewer