I'm using a (somewhat outdated) Microsoft version of nmake, which is usually packaged with visual studio 6.0. (If there's a relevant answer for newer nmake - do let me know, I might consider upgrading).
I wish to alter existing makefile, so that it would not include the dependency list if it is ran with the nmake dpndfull
goal, which should build the dependency list.
With GNU make I would test if dpndfull
is in MAKECMDGOALS
, and if it does I wouldn't include the (maybe nonexisting) dependency list.
Any ideas how to find current make goal with nmake?
This question has lay around for five years now and no one has touched it. So it thought an answer would be appropriate.
The answer is simple. No. There is no obvious equivalent of MAKECMDGOALS
in Microsoft NMAKE. There is no way, during the execution of the makefile to discover what was supplied on the command line invoking it. There is the macro $(MAKEFLAGS)
but that only shows flags and not the targets.
The only method to achieve what is asked is to make a target rule for dpndfull
and then at that place use the methods for constructing dependencies. A discussion of how to build these for NMAKE can be found in the question makedepend equivalent for use with nmake?.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With