Skip to content

Instantly share code, notes, and snippets.

@nbargnesi
Created December 16, 2024 12:54
Show Gist options
  • Select an option

  • Save nbargnesi/2ef0c1f023af88126c07da478283a536 to your computer and use it in GitHub Desktop.

Select an option

Save nbargnesi/2ef0c1f023af88126c07da478283a536 to your computer and use it in GitHub Desktop.
Go Makefile, step one
PROGS := $(subst cmd/,,$(wildcard cmd/*))
.PHONY: $(PROGS)
all: $(PROGS)
$(PROGS):
go build -o $@ cmd/$@/*.go
.PHONY: clean
clean:
rm -fv $(PROGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment