help-make
[Top][All Lists]
Advanced

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

Filtering dependencies


From: Maxime Boissonneault
Subject: Filtering dependencies
Date: Thu, 18 Jun 2009 16:10:29 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; fr; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.0

Hello,
I have a directory structure of this form :
user_exes/
user_exes/exe1/
user_exes/exe1/somefiles.h and .cpp
user_exes/exe2/
user_exes/exe2/somefiles.h and .cpp

I have the following rules :
$(USER_EXES_SUBDIRS_EXES): %$(EXE_EXTENSION) : %.cpp $(filter $(@D)%,$(USER_EXES_SUBDIRS_OBJECTS)) $(GSL_OPENMP_OBJECTS) $(CPP) $(DIRECTIVES) $(CPPFLAGS) $(INCLUDEDIRS) $(LIBDIRS) $*.cpp $(filter $(@D)%,$(USER_EXES_SUBDIRS_OBJECTS)) $(GSL_OPENMP_OBJECTS) $(LIBRARIES) -o $*$(EXE_EXTENSION) $(LIBS)

$(USER_EXES_SUBDIRS): $(filter $*%,$(USER_EXES_SUBDIRS_EXES))

$(USER_EXES_SUBDIRS) contains user_exes/exe1/ and user_exes/exe2/
while
$(USER_EXES_SUBDIRS_EXES) contains the name of the executables that are to be made.


My problem is that it always builds the 2 executables. How can I make a rule such that the dependencies is filtered to contain only those which are required, so that only the required stuff is built ?

By the way, I don't want to explicitely list the dependencies/directories, since the number of directories will grow.

Thanks

--
--------
Put a ladder if there's a wall, don't be afraid to slip and fall, speak for  
yourself or they'll speak for you.
--------
Si l'on savait ce que l'on fait, on n'appellerait pas ça de la recherche. 
(Albert Einstein)
--------

Maxime Boissonneault
Étudiant chercheur au doctorat en physique
Président de l'AGLEBUS
--------------------------------------------
address@hidden
address@hidden
(819) 821-8000 #63043 (jour)
(819) 823-1913 (soirs et fins de semaine)






reply via email to

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