> Keith T. Garner wrote:
> > >
> > > On Mon, Sep 14, 1998 at 07:17:17, David Warnock said:
> > > > I thought I should be able to connect "find . -name *.class" to
> > "rm"
> > > > somehow using redirection or pipes but cannot get it to work.
> > >
> > > You were very close to one possible solution :)
> > >
> > > find . -name *.class | xargs rm
> > >
>
> Paul Revis wrote:
> > All of which is more complicated than my favorite method, which is to
> > specify a separate .class file directory with the "-d" option (javac
> > or
> > jikes); then it's just
> >
> > rm -r classes\*
>
> I have a problem with this approach and using make, (probably because
> I'm not using make correctly), in that if I use the -d option and use a
> separate .class directory tree, make doesn't recognize the up-to-date
> files there and recompiles everything anyway. I can never get the
> "Nothing to be done for `CLASSES'" message when my Makefile looks like
>
>
> CP = $(ROOT):$$CLASSPATH
> COMPILER = jikes
> VM = java
> COPTIONS = -g -deprecation -depend -d $(ROOT)/classes
> ROPTIONS = -Daxiomroot=$(ROOT)
>
> [a listing of java files here]
>
> %.class: %.java
> cd $(@D); $(COMPILER) $(COPTIONS) -classpath $(CP) $(<F)
>
> run: $(CLASSES)
> $(VM) $(ROPTIONS) -classpath $(CP) axiomsl.PMRunner
>
>
>
> Any ideas?
> -A.
Worst still with packaged java source files. However the following
extracts works fo Xsql and me.
# Makefile
PROGRAMS = test
JCLSS1 = \
xenon/util/ApplicationResources.class \
test.class
JSRCS1 = \
xenon/util/ApplicationResources.java \
test.java
# Set up Java compiler and flags
JAVAC = javac
JAVAC_FLAGS = -deprecation -g
# Add the suffixes
.SUFFIXES: .class .java
#
# Rule to compile `java' files
#
.java.class:
$(JAVAC) $(JAVAC_FLAGS) $<
all:: $(PROGRAMS)
# This should rebuild all java classes from source
test:: $(JCLSS1)
# Run a shell program to generate launcher script
test::
make-javaruntime-stub test
...
The command `make all' or `make test' should now work for you.
Cheers
Peter
--
import java.std.disclaimer.*; // "Dontcha just love the API, baby bop!"
Peter Pilgrim Dept:OTC Derivatives IT,
Deutsche Bank (UK) Ltd, Groundfloor 133 Houndsditch, London, EC3A 7DX
Tel: +44-545-8000 Direct: +44 (0)171-545-9977 Fax: 0171-545-4313
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-