makefile - Pass file argument through to child make -


conditions:

  • a makefile passed make: make -f ../makefile hi
  • the hi target calls make

i need way propagate value -f sub-make command running inside hi.

bye:      echo 'whatever'  hi:     ${make} bye 

the possibility i'm aware of use makefile_list variable:

curr_makefile:=$(lastword $(makefile_list))  bye:      echo 'whatever'  hi:     +$(make) -f $(curr_makefile) bye 

but note, written in official documentation, variable records parsed makefiles, including includeed ones. value of variable reliable when queried @ top of makefile, before includes.