help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Howto: Variables dependent on command-line targets


From: Chad Loder
Subject: Howto: Variables dependent on command-line targets
Date: Wed, 02 May 2001 05:48:37 -0700

Hello. Does GNU make provide any way to construct a
conditional which tests whether any target was specified
explicitly?

Here's what I would like to do, in pseudocode -- I can think
of some ways to achieve this (e.g., use different target names
or have the user specify a flag on the command line, but I'm
hoping I can get the kind of automagic behavior I want):

##############################################################
# two targets, this and that
#
# if user did not specify a target on command line, then assume
# the user wants a full dependency scan -- otherwise, do not
# do a dependency scan

.PHONY: all this that
all : this that

ifdef NO_TARGET_SPECIFIED_ON_COMMAND_LINE
 this : that
endif

this :
        compile this

that :
        compile that

############################################################




reply via email to

[Prev in Thread] Current Thread [Next in Thread]