Changeset 18813


Ignore:
Timestamp:
03/26/09 12:30:59 (12 years ago)
Author:
mdewsnip
Message:

Improved LuceneWrapper Makefile to avoid recompiling all the Java files and generating the LuceneWrapper.jar file each time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indexers/trunk/lucene-gs/Makefile

    r18806 r18813  
    33
    44LUCENE_JAR = ./lib/lucene-core-2.3.2.jar
    5 CLASSPATH = $(LUCENE_JAR):classes
    65
    7 all: compile jar
    86
    9 compile:
    10     mkdir -p classes
    11     $(JAVAC) -classpath $(CLASSPATH):. -d classes -sourcepath src/ src/org/greenstone/LuceneWrapper/*.java
     7LUCENE_WRAPPER_OBJECTS = \
     8    classes/org/greenstone/LuceneWrapper/GS2Analyzer.class \
     9    classes/org/greenstone/LuceneWrapper/GS2IndexModifier.class \
     10    classes/org/greenstone/LuceneWrapper/GS2LuceneDelete.class \
     11    classes/org/greenstone/LuceneWrapper/GS2LuceneEditor.class \
     12    classes/org/greenstone/LuceneWrapper/GS2LuceneIndexer.class \
     13    classes/org/greenstone/LuceneWrapper/GS2LuceneQuery.class \
     14    classes/org/greenstone/LuceneWrapper/LuceneQueryResult.class \
    1215
    13 jar:
    14     cd classes && $(JAR) xf ../$(LUCENE_JAR)
    15     $(JAR) cf LuceneWrapper.jar -C classes .
     16LUCENE_WRAPPER_JAR = LuceneWrapper.jar
    1617
    17 install:
     18
     19classes/%.class: src/%.java
     20    mkdir -p classes && $(JAVAC) -classpath $(LUCENE_JAR):classes:. -d classes -sourcepath src/ src/$*.java
     21
     22LuceneWrapper.jar: $(LUCENE_WRAPPER_OBJECTS)
     23    cd classes && jar xf ../$(LUCENE_JAR)
     24    $(JAR) cf $(LUCENE_WRAPPER_JAR) -C classes .
     25
     26all: $(LUCENE_WRAPPER_JAR)
     27
     28install: $(LUCENE_WRAPPER_JAR)
    1829
    1930clean:
    20     /bin/rm -f classes/org/greenstone/LuceneWrapper/*.class
     31    /bin/rm -f $(LUCENE_WRAPPER_OBJECTS) $(LUCENE_WRAPPER_JAR)
    2132
    2233distclean: clean
    2334    if test -e classes; then /bin/rm -r classes; fi
    24     if test -e LuceneWrapper.jar; then /bin/rm -r LuceneWrapper.jar; fi
     35    if test -e $(LUCENE_WRAPPER_JAR); then /bin/rm -r $(LUCENE_WRAPPER_JAR); fi
Note: See TracChangeset for help on using the changeset viewer.