help-make
[Top][All Lists]
Advanced

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

Naming object files according to target


From: t-timmy
Subject: Naming object files according to target
Date: Sun, 3 May 2009 11:25:10 -0700 (PDT)

Hello,

I know this may sound newbie-ish, but I really need some help.

I want to name each of my object files prefixed with the current target
name.
That way when I change targets, I won't have to recompile everything to make
sure there is no residue from the previous compilation (which may have been
for a different target).

For example:

target1: c_flags = -DSOMETHING
target1: main.o

target2: c_flags = -DSOMETHING_ELSE
target2: main.o

main.o:
gcc $(c_flags) etc...

The only way I can avoid recompiling every time is by manually making a rule
for, let's say, target1-main.o and target2-main.o, but I have a lot of
source files and it's a real hassle.

Sorry again for the newbie-ish question.
-- 
View this message in context: 
http://www.nabble.com/Naming-object-files-according-to-target-tp23358342p23358342.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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