~taiite/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH senpai] Add Go and module files as Makefile deps

Details
Message ID
<20210319215337.7246-1-galen@galenabell.com>
DKIM signature
pass
Download raw message
Patch: +4 -1
This ensures that running `make` will rebuild senpai if files other than
cmd/senpai/main.go are modified.
---
Resending with proper repo prefix.

 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 8cc57e5..052f535 100644
--- a/Makefile
+++ b/Makefile
@@ -9,9 +9,12 @@ PREFIX = /usr/local
BINDIR = bin
MANDIR = share/man

GOSRC:=$(shell find . -name '*.go')
GOSRC+=go.mod go.sum

all: senpai doc/senpai.1 doc/senpai.5

senpai:
senpai: $(GOSRC)
	$(GO) build $(GOFLAGS) ./cmd/senpai
doc/senpai.1: doc/senpai.1.scd
	$(SCDOC) < doc/senpai.1.scd > doc/senpai.1
--
2.31.0
Details
Message ID
<20210321214502.0ff8feeb@vroom.localdomain>
In-Reply-To
<20210319215337.7246-1-galen@galenabell.com> (view parent)
DKIM signature
pass
Download raw message
Thank you for the patch!

On Fri, 19 Mar 2021 22:53:37 +0100, Galen Abell wrote:
> This ensures that running `make` will rebuild senpai if files other
> than cmd/senpai/main.go are modified.
> ---
> Resending with proper repo prefix.
> 
>  Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 8cc57e5..052f535 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -9,9 +9,12 @@ PREFIX = /usr/local
>  BINDIR = bin
>  MANDIR = share/man
> 
> +GOSRC:=$(shell find . -name '*.go')
> +GOSRC+=go.mod go.sum
> +

Can you make "senpai" .PHONY instead?  go will do this work anyway,
plus we'd have to also exclude "_test.go" files and handle other edge
cases.

Could you please also make "clean", "all" and "install" .PHONY while
we're at it?

>  all: senpai doc/senpai.1 doc/senpai.5
> 
> -senpai:
> +senpai: $(GOSRC)
>  	$(GO) build $(GOFLAGS) ./cmd/senpai
>  doc/senpai.1: doc/senpai.1.scd
>  	$(SCDOC) < doc/senpai.1.scd > doc/senpai.1
> --
> 2.31.0
> 
Reply to thread Export thread (mbox)