classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preprocessing java source


From: Peter Moulder
Subject: Re: preprocessing java source
Date: Sun, 24 Jun 2001 14:08:22 +1000 (EST)

On Sat, 23 Jun 2001, Tony Kimball wrote:

> Quoth Anthony Green on Saturday, 23 June:
> : 
> : Any ideas/opinions?
> : 
> 
> ClassName.jpp  -[cpp]-> ClassName.java -[gcj -C]-> ClassName.class -[gcj 
> -o]-> ClassName.o

cpp produces `#' lines, which aren't valid in Java source.  [I don't know
whether or not some compilers accept `#' lines as an extension.]

I use this in my makefiles.  Make sure to add .cpp to .SUFFIXES
dependencies (or SUFFIXES variable if using automake).

.cpp:
#       # The two-step process is to remove `#LINENUM' strings while
#       # keeping line numbers the same as the input file (so long as no
#       # #include's).
#       # Note that `-P' isn't enough: it doesn't keep line numbers in
#       # sync (e.g. it doesn't leave a line corresponding to `#endif').
        $(CXXCPP) -C $(JAVACDEFINES) $< > address@hidden
        sed -f $(srcdir)/cppjava.sed address@hidden > $@
        rm -f address@hidden

pjm.





reply via email to

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