This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Using GCJ to compile Jung (Java Universal Network and Graph... thing)
- From: Mathieu Lacage <Mathieu dot Lacage at sophia dot inria dot fr>
- To: Dan Bolser <dmb at mrc-dunn dot cam dot ac dot uk>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 02 Dec 2004 15:23:25 +0100
- Subject: Re: Using GCJ to compile Jung (Java Universal Network and Graph... thing)
- Organization: INRIA
- References: <Pine.LNX.4.21.0411292244070.28858-100000@mail.mrc-dunn.cam.ac.uk>
I wrote the attached sample Makefile which you might find useful to
build simple java projects with gcj.
Mathieu
--
BUILD_DIR=native
SRC_FILES= \
treegrowth/simulation/Analysis.java \
treegrowth/simulation/ContributionEngine.java \
treegrowth/simulation/Developper.java \
treegrowth/simulation/DevelopperOSSImpl.java \
treegrowth/simulation/Forest.java \
treegrowth/simulation/ForestImpl.java \
treegrowth/simulation/VisualNode.java \
treegrowth/simulation/Node.java \
treegrowth/simulation/NodeSharedImpl.java \
treegrowth/simulation/NodeImpl.java \
treegrowth/simulation/NodeIterator.java \
treegrowth/simulation/TreeImpl.java \
treegrowth/simulation/NodeVirtualImpl.java \
treegrowth/simulation/PotentialContribution.java \
treegrowth/simulation/PotentialContributionCollection.java \
treegrowth/simulation/SimulationParameters.java \
treegrowth/simulation/Tree.java \
treegrowth/simulation/iterators/CountIterator.java \
treegrowth/simulation/iterators/GiniUtilityIterator.java \
treegrowth/simulation/iterators/ContributionAccumulationIterator.java \
treegrowth/simulation/iterators/LayoutIterator.java \
treegrowth/simulation/Contribution.java \
treegrowth/simulation/ContributionImpl.java \
treegrowth/simulation/InitialContributionImpl.java \
treegrowth/simulation/PotentialContributionFactory.java \
treegrowth/simulation/VisualNodeIterator.java \
treegrowth/simulation/VisualForest.java \
treegrowth/utils/Compare.java \
treegrowth/utils/Count.java \
treegrowth/utils/EmptyIterator.java \
treegrowth/utils/Gini.java \
treegrowth/utils/HeapSort.java \
treegrowth/utils/IntPoint.java \
treegrowth/utils/LinearRegression.java \
treegrowth/utils/PackageVersion.java \
treegrowth/utils/PopulationAnalysis.java \
treegrowth/utils/SocialUtility.java \
treegrowth/utils/tFunction.java \
treegrowth/utils/CompareDoubleImpl.java \
treegrowth/utils/CompareSharedImpl.java \
treegrowth/utils/TestResult.java \
treegrowth/utils/RunningAverage.java \
MAIN_FILES=\
treegrowth/main/MainSimulation.java \
treegrowth/main/MainLambdaGamma.java \
treegrowth/main/MainTest.java \
treegrowth/main/MainTreeNGini.java \
JC=/opt/gcc-3.4.3/bin/gcj
JCFLAGS=-O2 -gdwarf-2
#-fprofile-arcs
BIN_FILES=$(addprefix $(BUILD_DIR)/,$(basename $(notdir $(MAIN_FILES))))
OBJ_FILES=$(addprefix $(BUILD_DIR)/,$(addsuffix .o,$(basename $(SRC_FILES))))
ALL_OBJ_FILES=$(addprefix $(BUILD_DIR)/,$(addsuffix .o,$(basename $(SRC_FILES) $(MAIN_FILES))))
BUILD_DIRS=$(sort $(dir $(ALL_OBJ_FILES)))
all: $(BUILD_DIRS) $(BIN_FILES)
$(BUILD_DIRS):
@mkdir -p $@ 2>/dev/null;
clean:
@rm -rf $(BUILD_DIR) 2>/dev/null
.deps: $(SRC_FILES) Makefile
@rm -f .deps; \
for f in $(SRC_FILES) $(MAIN_FILES); do \
OBJ=`echo $$f |sed -e 's/.java/.o/'`; \
SRC=$$f; \
DST=$(BUILD_DIR)/$$OBJ; \
DST_DIR=`dirname $$DST`; \
echo "$$DST: $$SRC" >> .deps; \
echo " $(JC) $(JCFLAGS) -c -o $$DST $$SRC" >> .deps; \
done; \
for f in $(MAIN_FILES); do \
BIN=`basename $$f .java`; \
OBJ=`echo $$f|sed -e 's/.java/.o/'`; \
DST=$(BUILD_DIR)/$$BIN; \
SRC=$(BUILD_DIR)/$$OBJ; \
MAIN=`echo $$f|sed -e 's/.java//' -e 's/\//./g'`; \
echo "$$DST: $$SRC $(OBJ_FILES)" >> .deps; \
echo " $(JC) -o $$DST --main=$$MAIN $$SRC $(OBJ_FILES)" >> .deps; \
done
-include .deps