Where the target all-recursive is specified in the makefile

in the makefile, I got the all target and its all-recursive dependency. I am browsing the entire file, but I cannot determine all recursive ones. I think that all-recursive should also be the goal, or how can we do this further? so that someone can tell me how to deal with this, I will be very grateful for your help.

all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive 

I cannot get all-recursive protection. if I remove this, make will constantly process the entire target. What is "all recursive" built in?

+4
source share
2 answers

I also found them for many hours. No, this is not a built-in make function; it turned out to be a feature of the autotools makefile created.

Those THING-recursive targets are actually defined in the Makefile itself, but in a complicated way that you cannot use to simply search for grep .

It starts by defining the RECURSIVE_TARGETS variable in the Makefile, which looks like this:

 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 

The following defines the real definition of these goals somewhere below:

 $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" 

What decides in this:

 all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive: @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" 

This target recipe is essentially boilerplate code for scrolling through each subdirectory found in the current folder and running make inside it, using the same target name, but with a "-recursive" section.

Please note that these THING-recursive targets are not intended to be directly invoked by the user; it will be launched automatically as part of the normal THING target (without "-recursive") as a mechanism to launch a building with the same purpose in the subproject tree.

Appendix: sample code is taken from the configured root Makefile GNU Flash Player (version e9eb84e ).

+2
source

see if it is included in the target value of $ (RECURSIVE_TARGETS)

+1
source

Source: https://habr.com/ru/post/1486855/


All Articles