[Top][All Lists]

[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)


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
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

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:
Sent from the Gnu - Make - Help mailing list archive at

reply via email to

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