help-make
[Top][All Lists]
Advanced

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

VPATH


From: MENETRIER, Jerome
Subject: VPATH
Date: Wed, 23 Sep 2009 15:33:13 +0200

Hi,

I try to write un makefile with different possible paths to find source file.

I use for this VPATH to precise where file can be find.
But my problème is to exclude current directory.

If source file is in current directory, the vpath is not used and ./file.c is 
taken instead of src/file.c for example.

How can I exclude current directory without precise all the possible 
directories in directive ?
I don't want to do something like
        %.o : src/%.c
                cc -c $(CFLAGS) $^ -o $@ 
        %.o : src_c/%.c
                cc -c $(CFLAGS) $^ -o $@ 
        %.o : src_cpp/%.c      
                cc -c $(CFLAGS) $^ -o $@ 
# I like only the first match even if %.c found in multiple directories

but 

        VPATH = src:src_c:src_cpp:src_tools  # but NOT in "."
        %.o : %.c

Does gnu make allow this ?
Can I use a "exclude vpath" ?

Thank you for you help




The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other than the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.





reply via email to

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