]> go.fuhry.dev Git - runtime.git/commitdiff
Makefile: include all .go files from maindirs, exclude vendor/ from target detection
authorDan Fuhry <dan@fuhry.com>
Thu, 15 May 2025 21:42:40 +0000 (17:42 -0400)
committerDan Fuhry <dan@fuhry.com>
Thu, 15 May 2025 21:42:40 +0000 (17:42 -0400)
Makefile

index 2c1b756d7fc75b2fd0d8bdaf9fc28f6ec99f830f..793b07193a6921aef1abc2c33271b392686ea644 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 GO = $(shell which go)
-GOMAINSRCS = $(shell find . -type f -name main.go | cut -c 3- | paste -s -d ' ' -)
+GOMAINSRCS = $(shell find . -type f -name main.go | cut -c 3- | grep -v '^vendor/' | paste -s -d ' ' -)
 GOMAINDIRS = $(GOMAINSRCS:/main.go=)
 GOOS ?= $(shell $(GO) env GOOS)
 GOARCH ?= $(shell $(GO) env GOARCH)
@@ -58,8 +58,8 @@ LDFLAGS += -X "go.fuhry.dev/runtime/constants.DeviceTrustTokenName=$(DEVICE_TRUS
 define GOPROG_template
 GOMAINS += $(1)/$(2)
 all: $(1)/$(2)
-$(1)/$(2): $(1)/main.go
-       $(GO) build -ldflags '$$(LDFLAGS)' $$(GOBUILDFLAGS) -o $$@ $$<
+$(1)/$(2): $(wildcard $(1)/*.go)
+       $(GO) build -ldflags '$$(LDFLAGS)' $$(GOBUILDFLAGS) -o $$@ $$^
 
 endef