Hello Dan, and welcome,
> On 20 Apr 2017, at 19:44, Daniel Wang <
danielw...@gmail.com> wrote:
>
> Hi all,
>
> I've become interested in the MINIX3.4 build system. I think I understood the most part of the build.sh and Makefile. However, there are some parts of the output information still puzzles me. It would be great if someone can help me shed light on the following outputs.
>
> First I understood the build system call make and print out current build progress ('===>') uses the function MAKEDIRTARGET defined in
bsd.own.mk.
>
> I also understood that the build starts with release -> distribution -> build -> check-tools -> do-top-obj, etc. (one by one from ${BUILDTARGETS})
That statement is slightly incorrect, "make" by design, builds a dependency tree, and once it has done so, re-orders each targets (which can be anything) in a sorted order* which guarantees that all the dependencies are available before trying to build a specific target.
*(this is a typical topological sort application, as we need to find an order among a tree)
>
> However, I do not know how 'do-top-obj ===> .' and 'do-tools-obj ===> .' and 'obj ===> tools/host-mkdep' etc. being printed out? I could not find if there is any call such as ${MAKEDIRTARGET} . do-top-obj. What I missed?
>
In src/Makefile:
501 do-tools: .PHONY .MAKE
502 >.......${MAKEDIRTARGET} tools build_install
503
504 do-lib: .PHONY .MAKE
505 >.......${MAKEDIRTARGET} lib build_install
506
507 do-compat-lib: .PHONY .MAKE
508 >.......${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
509
510 do-top-obj: .PHONY .MAKE
511 >.......${MAKEDIRTARGET} . obj NOSUBDIR=
512
513 do-tools-obj: .PHONY .MAKE
514 >.......${MAKEDIRTARGET} tools obj
515
516 do-build: .PHONY .MAKE
517 .for targ in dependall install
518 >.......${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
519 .endfor
>
> build ===> . (with: NOPOSTINSTALL=1)
> Build started at: Wed Apr 19 22:42:11 EDT 2017
> check-tools ===> .
> do-top-obj ===> .
> obj ===> . (with: NOSUBDIR=)
> do-tools-obj ===> .
> obj ===> tools
> obj ===> tools/host-mkdep
>
> Thank you very much!
> -Dan
Also some relevant information is available in /usr/share/mk/bsd.README.
I hope this helps.
Kind regards,
Lionel