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

Last change on this file since 36531 was 36531, checked in by davidb, 3 months ago

Changed to a more careful way of determining whether javah (used in older JDKs) should be used or not. Need to do this in a way that doesn't accidentally pick up on an older system-wide installed JDK (that has a javah), given that we use JAVA_HOME to precisely determine which java/javac that should be used

  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 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
10#
11# Since we're committed to JAVA_HOME being set, so jni.h header files can be found,
12# then we can lean on JAVA_HOME here to more precisely check for the existence of javah
13# within JAVA_HOME, and not accidentally pick up on another (older) JDK that is also
14# installed on the system, and does come with a 'javah' but is unlikely to be able
15# to cope with newer (e.g. JDK 11) version class files
16JAVAH = $(JAVA_HOME)/javah
17JAR = jar
18
19JAVACFLAGS = @JAVACFLAGS@
20
21JAVAGDBMHOME=../
22JAVACLASSDIR=./classes
23JAVASRCDIR=.
24JAVACOPTIONS= -deprecation -g -O
25JAVACLASSPATH=$(JAVACLASSDIR):
26
27all: setup compile
28
29setup:
30 mkdir -p $(JAVACLASSDIR)
31
32compile: setup
33 $(JAVAC) $(JAVACFLAGS) -d $(JAVACLASSDIR) -sourcepath $(JAVASRCDIR) $(JAVACOPTIONS) au/com/pharos/*/*.java
34# $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java
35 @echo Checking for javah ...
36# $(eval found = $(shell which javah 2>/dev/null | wc -l))
37 $(eval found = $(shell command -v $(JAVAH) | wc -l))
38 @if test "$(found)" = "1" ; then \
39 echo "... found" ; \
40 echo $(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile ; \
41 $(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile ; \
42 else \
43 echo "... not found => using 'javac -h'" ; \
44 echo $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java ; \
45 $(JAVAC) -h $(JAVAGDBMHOME)/jni -classpath $(JAVACLASSPATH) -d java au/com/pharos/gdbm/GdbmFile.java ; \
46 fi
47 jar cf $(JAVAGDBMHOME)/javagdbm.jar -C $(JAVACLASSDIR) au
48
49clean:
50 rm -rf $(JAVACLASSDIR) $(JAVAGDBMHOME)/javagdbm.jar $(JAVAGDBMHOME)/jni/GdbmFile.h
51
52install:
53
54distclean: clean
55 rm -f Makefile
56
Note: See TracBrowser for help on using the repository browser.