help-make
[Top][All Lists]
Advanced

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

RE: Please Help!- I have a problem using make ( variable "$*")


From: zartaj . majeed
Subject: RE: Please Help!- I have a problem using make ( variable "$*")
Date: Thu, 26 Apr 2001 09:18:39 -0700

For implicit rules, $* is the matching stem. 
Since $@ is surfcoei/bit_.o and the target pattern is surfcoei/%.o, the
matching stem must be bit_
Looking at the CC command though why don't you just use $< instead
of $*.c?

Here's an example of how $* differs in various kinds of rules:

########################################
# dollarstar.mk
dir/a.%.b:
        @echo ----- Rule 1 ------------
        @echo \$$@: $@
        @echo \$$*: $*
        @echo ----- Rule 1 ------------
a.%.b: %.d
        @echo ----- Rule 2 ------------
        @echo \$$@: $@
        @echo \$$*: $*
        @echo ----- Rule 2 ------------
%.d:
        @echo ----- Rule 3 ------------
        @echo \$$@: $@
        @echo \$$*: $*
        @echo ----- Rule 3 ------------
matches := a.m1 a.m2 a.m3
$(matches:%=c.%.b): c.a.%.b : a.%.b
        @echo ----- Rule 4 ------------
        @echo \$$@: $@
        @echo \$$*: $*
        @echo ----- Rule 4 ------------
########################################
chogori> make -f dollarstar.mk a.m1.b xyz/a.m2.b dir/a.m1.b c.a.m3.b
----- Rule 3 ------------
$@: m1.d
$*: m1
----- Rule 3 ------------
----- Rule 2 ------------
$@: a.m1.b
$*: m1
----- Rule 2 ------------
----- Rule 3 ------------
$@: xyz/m2.d
$*: xyz/m2
----- Rule 3 ------------
----- Rule 2 ------------
$@: xyz/a.m2.b
$*: xyz/m2
----- Rule 2 ------------
----- Rule 1 ------------
$@: dir/a.m1.b
$*: m1
----- Rule 1 ------------
----- Rule 3 ------------
$@: m3.d
$*: m3
----- Rule 3 ------------
----- Rule 2 ------------
$@: a.m3.b
$*: m3
----- Rule 2 ------------
----- Rule 4 ------------
$@: c.a.m3.b
$*: m3
----- Rule 4 ------------

Zartaj

-----Original Message-----
From: Kang Sujin-W19218 [mailto:address@hidden
Sent: Thursday, April 26, 2001 2:09 AM
To: address@hidden
Subject: Please Help!- I have a problem using make ( variable "$*")


Hello.

I am Sujin,Kang in Seoul, Korea.
I am a Software engineer in Motorola Korea Technology Center.

I did a build using gnu make, perl script and arm compiler.
We have no problem in DOS mode but in UNIX....^^;;;;;;

The problem is concerned with the variable "$*";
For example,

file :
*****a.min******************************************************************
***********
$(TARGETDIR)/%.o %.o: %.c
        @echo --------------------------------------------------------------
---
        @echo OBJECT $@
        @echo $@ $< $* $?
        $(CC) $(CFLAGS) $(DMSS_CFLAGS) $(MSG_FILE) $(OBJ_CMD) $@ $*.c
        @echo $@ $< $*
        @echo --------------------------------------------------------------
--
****************************************************************************
*******************
a.min is called from a perl script which is called from a main make file.
The echo results are 
% <= surfcoei/bit_
****************************************************************************
*******************
 echo -----------------------------------------------------------------
 echo OBJECT surfcoei/bit_.o
 echo surfcoei/bit_.o surfcoei/bit_.c bit_ surfcoei/bit_.c
                                                   ^^^^^ this part is the
problem....
 .........
 (omission)
 ........
****************************************************************************
********************
I think and I know that variable  "$*" is the base name of target and the
target minus suffix in implicit rule.
Am I wrong?
If so, I think the echo result has to be not bit_ but surfcoei/bit_.
Doesn't it?

What is problem?
I have no idea until now....
please help me and answer it to me.
Thank you for your help and your concern.
and thank you for reading my mail.

bye.

Best Regards,

   Sujin.Kang


_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make



reply via email to

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