"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
Re: Provide lib/Makefile to enable tags file generation
To:
gameoftrees@openbsd.org
Date:
Thu, 7 Oct 2021 14:49:50 +0000

Download raw body.

Thread
On Thu, Oct 07, 2021 at 04:22:35PM +0200, Stefan Sperling wrote:
> Fair enough. Yes, a comment which explains that all this is
> intended for 'make tags' only would be good.
> 
> > > I hope we won't forget to update the list of files in this Makefile.
> > > But I guess the damage of such negligence would be limited ;-)
> > 
> > Well, `SRCS = *.c' always works but I've never seen that in OpenBSD
> > Makefiles which seem to always explicitly define sources.
> 
> Using *.c might be the best approach here because this would keep
> 'make tags' working as files get added or removed over time.

OK?

-----------------------------------------------
commit 7bb90a43d6c469497baf0f3c62f1a6d9c7fbbc22 (main)
from: Klemens Nanni <kn@openbsd.org>
date: Thu Oct  7 14:48:11 2021 UTC
 
 Provide lib/Makefile to enable tags file generation
 
 The root Makefile does not hook into lib/ via <bsd.subdir.mk> since it
 is not a program itself and thus gets included by all others.
 
 This means `make tags` skips lib/ and `make -C lib/ tags` does not know
 what to do;  provide a minimal <bsd.prog.mk> stub and hook it up just
 for the "tags" such that *all* source is browsable via tags.
 
 OK stsp
 
diff 4afb33a50adb03566efa20a315bf6fb7ad0b74df c04ee46ec4ea7fc80099c6452c06001794ce5007
blob - 5e96ac3cb604c6c6ffb943a5f7620395583905f4
blob + bcee8dd56be2cbbc7d735892c67f6c50a1062163
--- Makefile
+++ Makefile
@@ -10,6 +10,10 @@ SUBDIR += regress
 SUBDIR += gotweb
 .endif
 
+.if make(tags)
+SUBDIR += lib
+.endif
+
 .include "got-version.mk"
 
 release: clean
blob - /dev/null
blob + c29824ec93904a78d46471cb7d666413bf09fdff (mode 644)
--- /dev/null
+++ lib/Makefile
@@ -0,0 +1,5 @@
+PROG =	# empty
+# make the "libs" target work
+SRCS =	*.c
+
+.include <bsd.prog.mk>