Skip to content

Instantly share code, notes, and snippets.

@ceving
Created April 28, 2024 07:04
Show Gist options
  • Save ceving/edeb6f58429d552e8828a70640db3d6e to your computer and use it in GitHub Desktop.
Save ceving/edeb6f58429d552e8828a70640db3d6e to your computer and use it in GitHub Desktop.
Makefile example for Go
module:=$(shell go list -f '{{.Module}}' .)
source:=$(shell go list -f '{{join .GoFiles "\n"}}' $(module))
embedded:=$(shell go list -f '{{join .EmbedFiles "\n"}}' $(module))
build: $(module)
$(module): $(source) $(embedded)
go build -v $(module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment