Follow-up Comment #9, bug #65600 (group make): [comment #8 comment #8:] > > [comment #7 comment #7:] > > > You can check the build system of the Linux man-pages, which I wrote in the last few years, if you're interested. It's quite complex, though, so it may be scary. :) > > > > <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/> > > > > The makefiles are the GNUmakefile, and files under share/mk/. > > Indeed the structure seems complicated to me. I browsed a bit and I like that you have an optional $(INFO_) that can prepend strings to the info lines which helps (I believe) with the hierarchy of the $(info) messages from different makefiles.
Yep, that $(INFO_) is for recursive make(1). Although I don't recommend recursive make(1) at all, it is unavoidable for a very specific thing: `make distcheck`. The distcheck target is supposed to run `make dist`, then extract the tarball, and then do a few things in that extracted tarball (building, and making sure everything's fine). ``` $ grep -rn -B4 -A2 INFO_= share/mk/ share/mk/dist/check/_.mk-26- share/mk/dist/check/_.mk-27-distcheck-%: $(_DISTCHECKSRCDIR) $(MK) | $$(@D)/ share/mk/dist/check/_.mk-28- $(info $(INFO_)MAKE $@) share/mk/dist/check/_.mk-29- $(MAKE) $(_MAKE_OPTS) $* \ share/mk/dist/check/_.mk:30: 'INFO_= $*: ' share/mk/dist/check/_.mk-31- share/mk/dist/check/_.mk-32- -- share/mk/dist/check/_.mk-34-distcheck: distcheck-diffoscope share/mk/dist/check/_.mk-35-distcheck: $(_DISTCHECKSRCDIR) $(MK) share/mk/dist/check/_.mk-36- $(info $(INFO_)MAKE lint build check install dist) share/mk/dist/check/_.mk-37- $(MAKE) $(_MAKE_OPTS) lint build check install dist \ share/mk/dist/check/_.mk:38: 'INFO_= distcheck: ' share/mk/dist/check/_.mk-39- share/mk/dist/check/_.mk-40- -- share/mk/dist/check/dist.mk-16- share/mk/dist/check/dist.mk-17-$(REDIST): $(_DISTCHECKSRCDIR) $(MK) | $$(@D)/ share/mk/dist/check/dist.mk-18- $(info $(INFO_)MAKE dist-tar) share/mk/dist/check/dist.mk-19- $(MAKE) $(_MAKE_OPTS) dist-tar \ share/mk/dist/check/dist.mk:20: 'INFO_= dist-tar: ' share/mk/dist/check/dist.mk-21- share/mk/dist/check/dist.mk-22- ``` > > > Doesn't verilator(1) allow running the compilation in a separate step? Maybe you can do something like this (pseudocode): > > > > verilator build A >/dev/null > > verilator run A > > verilator build B >/dev/null > > verilator run B > > ... > > Indeed the tool supports separating the generation of makefiles. Then I can make(1) myself. Thanks :) Nice. :) > > You could do something similar, and suffix every command with $(STDOUT), and then (conditionally?) define STDOUT:= as an empty thing (so under normal conditions you see the output, and optionally do the same with stderr. When running under verilator, you could define those variables to 1>/dev/null and 2>/dev/null. > > Good idea! Thanks Alex. You're welcome! :-) _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?65600> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/