help-make
[Top][All Lists]
Advanced

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

cmd-line goal modification


From: Asperheim, Eric
Subject: cmd-line goal modification
Date: Wed, 28 Mar 2001 18:05:19 -0800

Hi,

Is it possible to modify a command line goal before gmake tries to do
anything? 

Currently, my Makefile has 

DB := dbs/      # location of gmake outputs - .db files
SRC := src/     # location of gmake source files - .vhdl files
$(DB)c.db : $(SRC)c.vhdl $(DB)csfa.db $(DB)csfb.db
$(DB)csfa.db : $(SRC)csfa.vhdl 
$(DB)csfb.db : $(SRC)csfb.vhdl

and I have a pattern rule to build the .db from the .vhdl
$(DB)%.db : $(SRC)%.vhdl
        @cmds

If the user types "gmake", everything works and all 3 targets are made. But
if the user only wants a lower level target, e.g. dbs/cfsa.db, the user
would have to type 
"gmake dbs/cfsa.db"

It would be convenient if the user only had to type
"gmake csfa.db" 

I've tried a couple of things

Try #1 - modify Makefile
$(DB)csfa.db csfa.db : $(SRC)csfa.vhdl 
and add another pattern rule
%.db : $(SRC)%.vhdl
PROLBEM: I'll get a dbs/csfa.db file. However, it always appears stall to
gmake since csfa.db doesn't really exist in the current work directory.

Try #2 - edit the $(MAKECMDGOALS) variable. 
ifeq ($(MAKECMDGOALS), csfa.db)
override MAKECMDGOALS := dbs/csfa.db
endif

Even when I print out the gmake database, I see that 
MAKECMDGOALS := dbs/csfa.db
But, it seems that gmake decided which pattern rule to use before the 
# Not a target:
csfa.db: src/csfa.vhdl
#  Command-line target.


So, any good way of doing this? 

Thanks,

Eric



Eric Asperheim  -  GCD Design
phone: (916) 356-4624 
Intel Corporation, FM6-81
fax: (916) 356-3051 
1900 Prairie City Rd, Folsom, CA 95630
address@hidden
----------------------------------------------------------------------------
--------------------------------- 






reply via email to

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