From: Klemens Nanni Subject: Re: Provide lib/Makefile to enable tags file generation To: gameoftrees@openbsd.org Date: Thu, 7 Oct 2021 15:17:42 +0000 On Thu, Oct 07, 2021 at 02:49:50PM +0000, Klemens Nanni wrote: > 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 > 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 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 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 So this changes things: the default target now fails instead of silently doing nothing. > +# make the "libs" target work > +SRCS = *.c > + > +.include And there's more fitting which is used identically, although the default target always fails with LIB unset or set to the empty string... I'd do this for "correctness"; you're not supposed to run make for anything but tags anyway, so better fail. ----------------------------------------------- commit 56e9571e0a73355a42bc5c1c8c2a493882580e94 (main) from: Klemens Nanni date: Thu Oct 7 15:16:48 2021 UTC Provide lib/Makefile to enable tags file generation The root Makefile does not hook into lib/ via 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 stub and hook it up just for the "tags" such that *all* source is browsable via tags. See /usr/share/mk/bsd.README for details. OK stsp diff 4afb33a50adb03566efa20a315bf6fb7ad0b74df 23e351dd4c654559e3a92504d84e5906be75dfe3 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 + 65eec7f501303957ce958c4b03cc74c67d049634 (mode 644) --- /dev/null +++ lib/Makefile @@ -0,0 +1,4 @@ +# simple Makefile stub to make the "libs" target work +SRCS = *.c + +.include