forcing make action independent from specified target?
From:
gert . geurts
Subject:
forcing make action independent from specified target?
Date:
Fri, 29 Oct 2004 16:04:14 +0200
Hi,
Hope this email address is still valid...
I'm wondering if the following problem can be solved neatly.
I've a Makefile with several targets. (a barebone version included
at the end of this email). All targets are used
to build something (object, executable) except for
the targets 'clean, cleanall' (not included here).
What I would like to happen is that gmake always checks out
all include files specified in $(APS_INCLUDES) that are not
checked out yet before trying to build anything else, when the target
is not defined as clean or cleanall. I would guess that this
should be possible without calling gmake recursively, but I
don't see how. I tried several things:
- overriding MAKECMDGOALS. It would do the job:
MAKECMDGOALS := coinc $(MAKECMDGOALS)
but overriding this variable is not ineffective.
- setting MAKEFLAGS in the Makefile:
MAKEFLAGS := $(MAKEFLAGS -o coinc)
and declare sources to depend on coinc.
Reading the manual a bit better revealed that
-o is one of the options that cannot be used.
(I don't want to put it in a script, or have users
call gmake with the options on the command line.
I'm interested in a pure -nonrecursive- gmake solution.)
Another way could have been using a .FORCETARGET directive,
to indicate that a target defined here should always be made first.
Using it in a 'ifeq ....' construct could define this directive conditionally.
Hope this is clear enough...
Am I overlooking something, or is it really hard to implement this?