gcj -c -d ?

Per Bothner per@bothner.com
Tue Jul 30 09:03:00 GMT 2002


Norman Hendrich wrote:
> Three questions about gcj usability:
> 
> 1) Why does gcj allow "-d <directory>" when compiling to bytecode,
>    but not when compiling to object files?

It doesn't realy fit with gcc's way of doing things.
For one thing, it would be inconsistent with compiling from
source if the source file defines multiple classes.  Basically,
each invocation of cc1java (the actual compiler) can only generate
a single .o file.

>    For quick and dirty
>    development without hand-tuned makefiles, I really like the Java
>    (javac/jikes) way of compiling:
>    
>    gcj -C -d . org/foo/bar/Baz.java
>    gcj -c -d . org/foo/bar/Baz.class
>    
>    and:
>    
>    gcj -c -d . */*/*/*.class
>    gcj -o baz.exe --main=org.foo.bar.Baz */*/*/*.o
> 
>    instead of:
> 
>    gcj -c -o org/foo/bar/Baz.o org/foo/bar/Baz.class 
>    
>    and dozens of separate Makefiles, one per package directory.

Why not just:

gcj -o baz.exe --main=org.foo.bar.Baz */*/*/*.class

or:

gcj -c -d . */*/*/*.class -o Baz.o
gcj -o baz.exe --main=org.foo.bar.Baz Baz.o

Faster compilation time; simple Makefile.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Java mailing list