help-make
[Top][All Lists]
Advanced

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

Alt. Solution to Incorrectly Applied Target-Specific Variable


From: Sean Smith
Subject: Alt. Solution to Incorrectly Applied Target-Specific Variable
Date: Fri, 12 Jun 2009 14:26:37 -0500
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Initially, I attempted to use a target-specific variable in the following way (simplified example):

LowLevelFunc = LowLevelFunc1.o

a.out : Main1.o MidLevelFunc.o LowLevelFunc1.o
   ${CC} $? ${LowLevelFunc} ${LIB} -o $@

alt_a.out : LowLevelFunc = LowLevelFunc2.o
alt_a.out : Main2.o MidLevelFunc.o LowLevelFunc2.o
   ${CC} $? ${LowLevelFunc} ${LIB} -o $@

Main1.o : MidLevelFunc.o
Main2.o : MidLevelFunc.o

MidLevelFunc.o : ${LowLevelFunc}

LowLevelFunc1.o :
LowLevelFunc2.o :

Ignoring my mistake, you can see the point is this - depending on a different driver program, it should use a different lower-level function to plug into the mid-level function. I have since learned that target-specific variables only work in the command lines, and not as part of prerequisites. Looking in the help-make archive, the two suggestions I came across were to redirect to another rule or to use the eval function. I was unable to understand how to make either of these work for my situation. Any suggestions? The actual situation has more files and is slightly more complicated by fortran modules and handling both the .o and .mod files.

Thanks,
Sean Smith




reply via email to

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