News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

-o option for compiler

Started by frankie, August 02, 2007, 06:28:16 PM

Previous topic - Next topic

frankie

Pelle could you please add the option '-o <outfilename>' so it's possible to use pocc with unix makefiles?
Thank you very much.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

AlexN

Quote from: frankie on August 02, 2007, 06:28:16 PM
Pelle could you please add the option '-o <outfilename>' so it's possible to use pocc with unix makefiles?
Thank you very much.

Pelle has the option '-Fo <outfilename', isn't that enough?
best regards
Alex ;)

frankie

#2
Yes unless you like to modify tenths of makefiles automatically generated while compiling under unix emulation  ::)
Pelle please also for the polink.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Pelle

No big deal to add, but I'm worried that if I add it to POCC and POLINK soon someone wants it in POASM, PORC, POCB too (for convenience)... and then there may be another "UNIX compatible" option to add, and so on, and so on, ...
/Pelle

frankie

I agree with you, but maybe that to be partially compatible with gcc is not so bad... ;)
Anyway at your choice.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Pelle

I think the most appropriate place for the -o option is in CC (and only CC); it can both compile and link. Somewhere between the existing -Fo and -Fe option - I'm not sure about the details yet...
/Pelle

frankie

This could be the natural place.
But it is also important that cc exhibits the same behaviour as gcc to replace it with makefiles.
I tested pomake with some unix makefiles and it works well enaugh  ;)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Pelle

This is starting to become confusing. I think you have to provide a small example of what you want - otherwise my guesses may be completely wrong...
/Pelle

frankie

I meant just to can use your compiler driver as the gcc command passing source, object and library files to compile or link depending on file extensions.
The -o switch should work only on the final output file, i.e. a command like:
cc -c -o foo.o foo.c
Will only compile the source "foo.c" in the object "foo.o"
The command line:
cc foo.c bar.c -o out.exe
Will compile the sources and will output an executable named "out.exe"
Another example:
cc foo.obj bar.obj lib.lib -o sample.exe
As above but will only link the two objects and the library, the output file is named "sample.exe"
I hope to have been clear enaugh.
Thanks Pelle.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Pelle

OK. I have to think about this, but should be doable...
/Pelle