LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   GNU Make - get list of targets to be made (https://www.linuxquestions.org/questions/linux-general-1/gnu-make-get-list-of-targets-to-be-made-463687/)

jrfk2 07-13-2006 10:38 AM

GNU Make - get list of targets to be made
 
I'm trying to find a way to get GNU Make 3.80 to list out all the targets it will make.

I have a top level makefile in my root folder, and it points to makefiles in subfolders etc.

I *really* want it to tell me which make files it will run in what order, but will settle for a list of all the targets and will figure out what I need from that.

I've tried various combinations of options like

-B always make
-d print debug
-n just print out commands
-p print make's internal DB
-t touch targets instead of making them

but not finding what I am hoping for.

Also --help mentions option --debug[=FLAGS] but doesn't say what FLAGS can be ... anyone know ..

thanks ...

pda_h4x0r 08-12-2006 10:03 PM

You could write a shell script wrapper that would echo which makefile it will work on before invoking GNU make. For example:

#!/bin/sh

ROOT_BUILD=/home/my_user/my_project

echo "Will execute GNU make in this order:"

for i in $ROOT_BUILD/dir1 $ROOT_BUILD/dir2 $ROOT_BUILD/dir3 do

echo "$i"

# if you wish to make the targets, uncomment this:
# make $i

done

I'm not very good at shell script (expect syntax errors), but is this something like what you needed?


All times are GMT -5. The time now is 04:27 AM.