compiling target of same makefile

A

AnandA

I have a requirement where I need to compile a target twice in the
same makefile. I'm compiling a C code and then linking but using
linker utility to generate an output file.
This output file I want to use to compile again the same C code and
then link for final output generation.

I'm compiling for our own processor. I was wondering how I can write
makefile for achieving this.

Thanks,
Anand.
 
K

Kenny McCormack

I have a requirement where I need to compile a target twice in the
same makefile. I'm compiling a C code and then linking but using
linker utility to generate an output file.
This output file I want to use to compile again the same C code and
then link for final output generation.

I'm compiling for our own processor. I was wondering how I can write
makefile for achieving this.

Thanks,
Anand.

Makefiles are off-topic in CLC.

Please try comp.lang.make or something like that.
 
K

Keith Thompson

AnandA said:
I have a requirement where I need to compile a target twice in the
same makefile. I'm compiling a C code and then linking but using
linker utility to generate an output file.
This output file I want to use to compile again the same C code and
then link for final output generation.

I'm compiling for our own processor. I was wondering how I can write
makefile for achieving this.

That's really not a C question. You might try asking in
comp.unix.programmer if you're using a Unix-like system, or on some
other system-specific newsgroup if you're not. (They'll probably ask
you why you want to compile the same file twice.)
 
A

Antoninus Twink

I have a requirement where I need to compile a target twice in the
same makefile. I'm compiling a C code and then linking but using
linker utility to generate an output file. This output file I want to
use to compile again the same C code and then link for final output
generation.

It's difficult to imagine exactly what your situation is without more
details, but what's wrong with a bespoke rule like

myfile.o : myfile.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
# call the linker to generate linker.out
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(SPECIAL_FLAGS_TO_USE_LINKER_OUT) $<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top