Skip to content

Commit 92f2eda

Browse files
committed
java: Improve build rules
* Fix builds in subdirectories: * Add srcdir to Manifest.txt. * Remove srcdir from piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar. * Add dependency of SCROLLVIEW_CLASSES on SCROLLVIEW_LIBS. The SCROLLVIEW_LIBS are now automatically fetched when needed. * Add .PHONY target for fetch-jars. * Improve rule for clean target. Signed-off-by: Stefan Weil <[email protected]>
1 parent 49401e6 commit 92f2eda

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

java/Makefile.am

+8-7
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@ SCROLLVIEW_CLASSES = \
3636
com/google/scrollview/ScrollView.class
3737

3838
SCROLLVIEW_LIBS = \
39-
$(srcdir)/piccolo2d-core-3.0.jar \
40-
$(srcdir)/piccolo2d-extras-3.0.jar
39+
piccolo2d-core-3.0.jar \
40+
piccolo2d-extras-3.0.jar
4141

42-
CLASSPATH = $(srcdir)/piccolo2d-core-3.0.jar:$(srcdir)/piccolo2d-extras-3.0.jar
42+
CLASSPATH = piccolo2d-core-3.0.jar:piccolo2d-extras-3.0.jar
4343

4444
ScrollView.jar : $(SCROLLVIEW_CLASSES)
45-
$(JAR) cfm $@ Manifest.txt com/google/scrollview/*.class \
45+
$(JAR) cfm $@ $(srcdir)/Manifest.txt com/google/scrollview/*.class \
4646
com/google/scrollview/events/*.class com/google/scrollview/ui/*.class
4747

48-
$(SCROLLVIEW_CLASSES) : $(SCROLLVIEW_FILES)
48+
$(SCROLLVIEW_CLASSES) : $(SCROLLVIEW_FILES) $(SCROLLVIEW_LIBS)
4949
$(JAVAC) -encoding UTF8 -sourcepath $(srcdir) -classpath $(CLASSPATH) $(SCROLLVIEW_FILES) -d $(builddir)
5050

51-
fetch-jars :
51+
.PHONY: fetch-jars
52+
fetch-jars $(SCROLLVIEW_LIBS):
5253
curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar > piccolo2d-core-3.0.jar
5354
curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar > piccolo2d-extras-3.0.jar
5455

@@ -64,7 +65,7 @@ uninstall:
6465
endif
6566

6667
clean :
67-
rm -f ScrollView.jar *.class $(srcdir)/*.class
68+
rm -f ScrollView.jar $(SCROLLVIEW_CLASSES)
6869

6970
# all-am does nothing, to make the java part optional.
7071
all all-am install :

0 commit comments

Comments
 (0)