help-make
[Top][All Lists]
Advanced

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

Re: duplicated targets


From: Maciej Walezak
Subject: Re: duplicated targets
Date: Tue, 26 Feb 2002 12:14:28 +0100

Hi,

I did as you advised and it works fine.
But what if I want more complicated command e.g. like this:

remove:
        @echo
        @echo removing ...
        ar -d $(LIB) $(MEM)

If I write it in one line separating by semicolons and use '@' at the beginning 
then no command will be echoed and if I omit '@' then all commands will be 
echoed. And neither case is what I want.


> You can do recursive makes (I don't advise this, but it will work) or
> you can just define clean1 and clean2 to actually run the command
> instead of depending on another target to do it:
> 
>   REMOVE-FROM-LIB = ar -d $(LIB) $(MEM)
> 
>   clean1: LIB = dir1/libymy.a
>   clean1: MEM = obj.o
>   clean1: ; $(REMOVE-FROM-LIB)
> 
>   clean2: LIB = dir2/libymy.a
>   clean2: MEM = obj.o
>   clean2: ; $(REMOVE-FROM-LIB)
> 
>   clean: clean1 clean2

--
Maciej Walezak
-GDN-



reply via email to

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