List Info

Thread: Need help coping files to a directory




Need help coping files to a directory
user name
2008-03-26 18:22:00
Hello all.

I'm new to make and need some help.  My make file creates a
few files, 
(shared libraries and executables), and I want to write a
target that 
copies said files into a separate directory.  A pretty
simple need.  I 
gather that I could manually declare rules like:

somedir/foobar: foobar
    cp foobar somedir

somedir/dog: dog
    cp dog somedir

copythefiles: somedir/foobar somedir/dog

But I don't like repeating myself.  What I'd really like is
to have a 
rule pattern like:

somedir/%: $*
    cp $* somedir

copythefiles: somedir/foobar somedir/dog

This doesn't seem to work.  If I invoke "make
copythefiles" I also 
expect it to take appropriate actions to build foobar and
dog but this 
does not seem to be happening.

Am I going about this wrongly?  Help is much appreciated.
- Adam



Videx Inc. 1105 N. E. Circle Blvd. Corvallis OR 97330 (541)
758-0521
CONFIDENTIAL COMMUNICATION: The email message and any
attachments are intended only for the addressee.  They may
be privileged, confidential, and protected from disclosure.
If you are not the intended recipient, any dissemination,
distribution, or copying is expressly prohibited.  If you
received this email message in error, please notify the
sender immediately by replying to this e-mail message or by
telephone



_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: Need help coping files to a directory
user name
2008-03-26 19:31:18
On Wed, 2008-03-26 at 16:22 -0700, Adam Bennett wrote:
> somedir/%: $*
>     cp $* somedir

somedir/%: %
    cp $* somedir

Read up on "Pattern Rules" in the GNU make
manual.

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.mad-scientis
t.us
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: Need help coping files to a directory
user name
2008-03-27 10:28:37
Works like a charm   Thanks,
Paul.

Paul Smith wrote:
> On Wed, 2008-03-26 at 16:22 -0700, Adam Bennett wrote:
>   
>> somedir/%: $*
>>     cp $* somedir
>>     
>
> somedir/%: %
>     cp $* somedir
>
> Read up on "Pattern Rules" in the GNU make
manual.
>
>   




Videx Inc. 1105 N. E. Circle Blvd. Corvallis OR 97330 (541)
758-0521
CONFIDENTIAL COMMUNICATION: The email message and any
attachments are intended only for the addressee.  They may
be privileged, confidential, and protected from disclosure.
If you are not the intended recipient, any dissemination,
distribution, or copying is expressly prohibited.  If you
received this email message in error, please notify the
sender immediately by replying to this e-mail message or by
telephone



_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )