From 00c1b411f898b4e6fb8d3e40cd38b14f718f6a42 Mon Sep 17 00:00:00 2001 From: Dan Fuhry Date: Thu, 15 May 2025 17:42:40 -0400 Subject: [PATCH] Makefile: include all .go files from maindirs, exclude vendor/ from target detection --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2c1b756..793b071 100644 --- 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 -- 2.50.1