[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how can i get a list of prerequisites for a target
From: |
Tristan Van Berkom |
Subject: |
Re: how can i get a list of prerequisites for a target |
Date: |
Wed, 28 May 2003 13:39:06 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
address@hidden wrote:
Hi Paul,
If I need to have this details else where, not in the command script. Is it
possible?.
eg:
my makefile contains
"
include test.mk
all: a b c d
"
i am including a file test.mk in the makefile. In this test.mk I need to do the
following
if d is mentioned in the all target I need to include
d.mk
Thanks for your help
Regards
bhaskar
I am not aware of any such feature in 3.79 (that allows you to have any
knowlage of a.) what global target make was invoked with or b.) extract a
list of prerequisites for a given target at the global "scope" i.e. not
in the target scope).
Even though this is not really an answer to your question;
you may consider using an aproach similar to the following:
========= Makefile ========
PREREQS=a b c d
include test.mk
all: $(PREREQS)
======== test.mk ========
either:
-include $(patsubst %, %.mk, $(PREREQS))
or:
ifeq ($(findstring d, $(PREREQS)),d)
include d.mk
endif
==========================
Hope this helps,
-Tristan