source: main/trunk/greenstone3/src/packages/javagdbm/java/Makefile.in@ 35313

Last change on this file since 35313 was 35313, checked in by davidb, 3 years ago

Nightly builds setup looks to still be using a JDK 1.7, which does not support 'javac -h'. Needs to be at least a JDK1.8. SO, this commit returns things to the key JNI Makefiles testing for 'javah' and using it if found. While essentially a flip-flop back to how the code was before, as few additional things have been learnt along the way: 'command -v' is a better way to test for the existance of a script in comparison to 'which' where things can be meddled with and (for which) one cannot even assume the exit value gets set appropriately based on whether or not the program was found. Some refinement and tidy up of the JAVACOMPILEFLAGS has also been done; and the comment next to the JAVAH line has been rewritten to describe more precisely what is going on around javah and 'javac -h'

  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1# Makefile for Java part of JavaGDBM
2# Katherine Don, 2005
3
4#JAVAC = $(JAVA_HOME)/bin/javac
5#JAVAH = $(JAVA_HOME)/bin/javah
6#JAR = $(JAVA_HOME)/bin/jar
7JAVAC = @JAVAC@
8# 'javah' existed until JDK 1.7, transitional in JDK 1.8, then removed by JDK 1.9 (use 'javac -h' instead)
9# Makefile rules below test for 'javah' and use it if it found, otherwise runs with 'javac -h' version
10JAVAH = javah
11JAR = jar
12
13JAVAGDBMHOME=../
14JAVACLASSDIR=./classes
15JAVASRCDIR=.
16JAVACOPTIONS= -deprecation -g -O
17JAVACLASSPATH=$(JAVACLASSDIR):
18
19all: setup compile
20
21setup:
22 mkdir -p $(JAVACLASSDIR)
23
24compile: setup
25 $(JAVAC) $(JAVACFLAGS) -d $(JAVACLASSDIR) -sourcepath $(JAVASRCDIR) $(JAVACOPTIONS) au/com/pharos/*/*.java
26# $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java
27 @echo Checking for javah ...
28# $(eval found = $(shell which javah 2>/dev/null | wc -l))
29 $(eval found = $(shell command -v javah | wc -l))
30 @if test "$(found)" = "1" ; then \
31 echo ... found ; \
32 echo $(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile ; \
33 $(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile ; \
34 else \
35 echo ... not found => using 'javac -h' ; \
36 echo $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java ; \
37 $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java ; \
38 fi
39 jar cf $(JAVAGDBMHOME)/javagdbm.jar -C $(JAVACLASSDIR) au
40
41clean:
42 rm -rf $(JAVACLASSDIR) $(JAVAGDBMHOME)/javagdbm.jar $(JAVAGDBMHOME)/jni/GdbmFile.h
43
44install:
45
46distclean: clean
47 rm -f Makefile
48
Note: See TracBrowser for help on using the repository browser.