GNU Makefile "preprocessor"?

Is there an option to output a “pre-processed” make file, which is equivalent to the GCC option -E?

I have a project consisting of a hierarchy of dozens of modules, each with its own make file. The assembly is called from the make master file. This wizard file contains included, definition variables, command line dependent variables, etc.

So, essentially, I'm looking for a processed makefile, including all the lookups.

+4
source share
1 answer

Not that I knew. The closest thing you can get is to exit from make -qp(or similar) that will dump the make database onto you.

, / .. , , ( , ), /etc. makefile .

make -d , , make make , makefile .

Remake .

/etc. make, , , .

tl; dr , , Makefile ( , ).

print-%:
    @echo '$*=$($*)'
    @echo '  origin = $(origin $*)'
    @echo '  flavor = $(flavor $*)'
    @echo '   value = $(value  $*)'

,

@echo '$*=$(subst ','\'',$($*))'

.

+3

All Articles