"File types"
Alexey Toptygin
alexeyt at freeshell.org
Tue Aug 29 20:45:00 CDT 2006
On Tue, 29 Aug 2006, Sean Conner wrote:
>> To return to the original question, how far back do you have to go for
>> unix's cc(1) to require .c on C source files, .o on object files (to be
>> linked it), and so on?
[snip tests]
> So it looks like GCC doesn't like arbitrary extentions.
This is because gcc is a compiler and linker _driver_. It needs to know if
the input file is source in c, c++, objective-c, assembler, ada, f77, f95,
java, treelang, or is an object file in a.out, elf, coff, etc. format so
it can invoke the right backend. You can tell gcc what to do explicitly
with the -x option:
$ ls
test.foo
$ gcc -x c -c test.foo
$ ls
test.foo test.o
$ rm test.o
$ ls
test.foo
$ gcc -x c test.foo
$ ls
a.out test.foo
Remember, gcc stands for "GNU Compiler Collection", not "GNU C Compiler".
Alexey
More information about the cctalk
mailing list