Let's say I have a make target abc with prerequisites x, y, and z.
abc: x y z
echo 'Do something'
Is there not some simple way to run make and ignore the prerequisites, such that it runs abc without first running x, y, and z?
How it's done:
Note that a GNU
Makefilecan examine the value of the variableMKCMDGOALSand calculate other variables from that. You could have it that when certain targets are explicitly given on the command line (and thus appear inMKCMDGOALS) then thenoreqflags comes into effect, and those targets adjust their behavior with the macro.CAVEAT: In the
noreqmode, the target actually does not have prerequisites, so your rule cannot refer to prerequisites via$^or$<.