1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
#--------------------------------------------------------------------------
# Makefile for the NeXus Java API. Builds both the required Java class
# files and the shared library with the native methods.
#
# This version is for Windows 32, using the mingw toolchain
#
# Getting the import libraries for HDF right was a pain:
# The HDF4 library ones were created through:
# > reimp hdf4lib.dll
# where hdf4lib must be replaced with the name of the HDF4 library to
# convert.
#
# The HDF5 libraries seem to have been compiled with a different version of
# MS Visual Schrott and need another treatment:
# > pexport hdf5dll.dll > hdf5dll.def
# > dlltool -d hdf5dll.def -l libhdfdll.a
# Of course, these things may change between versions of MSVC and mingw.....
# Windows is a pain in the ass ............................................
#
# Mark Koennecke, November 2003
#--------------------------------------------------------------------------
.SUFFIXES:
.SUFFIXES: .java .class .c .o
###########################################################################
# C O N F I G U R A T I O N S E C T I O N #
###########################################################################
# Where to find the HDF libraries: HDF4.1r3 is REQUIRED
HDFROOT=/g/hdf
HDF4ROOT=$(HDFROOT)/HDF41r5
HDF5ROOT=$(HDFROOT)/5-161-win2k/c/release
#HDF5ROOT=/c/temp/hdf5-161mingw
#Where to find the napi C stuff
NAPIROOT=$(SINQDIR)/linux
# Where the Java binaries live
JAVAROOT=/java
JAVABIN=$(JAVAROOT)/bin
# The classpath for compiling java
JCP=.:
# The path to the include files for the jni-headers
JINCLUDE= -I$(JAVAROOT)/include -I$(JAVAROOT)/include/win32
# The C-compiler to use
CC=gcc
# Compiler flags to use for compiling
CFLAGS= -g -c $(JINCLUDE) -DHDF4 -DHDF5 -D_HDF5USEDLL_ -I$(HDF4ROOT)/include \
-I$(HDF5ROOT)/include -I../../include -Inative \
-D_JNI_IMPLEMENTATION_ -Wl,--kill-at
#Compiler flags used for linking
LFLAGS= -g -shared \
-D_JNI_IMPLEMENTATION_ -Wl,--kill-at
#Target location for the shared library
SHLIB=bin/win32/jnexus.dll
###########################################################################
# END OF C O N F I G U R A T I O N S E C T I O N #
# DO NOT TOUCH ANYTHING BELOW! #
###########################################################################
.java.class:
$(JAVABIN)/javac -g -target 1.1 $*.java
.c.o:
$(CC) $(CFLAGS) -o $*.o $*.c
JOBJ=ncsa/hdf/hdflib/HDFException.class \
ncsa/hdf/hdflib/HDFJavaException.class \
ncsa/hdf/hdflib/HDFNotImplementedException.class \
ncsa/hdf/hdflib/HDFConstants.class \
ncsa/hdf/hdflib/HDFArray.class \
ncsa/hdf/hdflib/HDFNativeData.class \
neutron/nexus/NexusException.class \
neutron/nexus/NXlink.class \
neutron/nexus/NeXusFileInterface.class \
neutron/nexus/AttributeEntry.class \
neutron/nexus/NexusFile.class
COBJ=native/hdfnativeImp.o \
native/hdfexceptionImp.o \
native/handle.o \
../../src/napi.o \
native/NexusFile.o
du40: all
rh62: all
../../src/napi.o:../../src/napi.c ../../src/napi4.c ../../src/napi5.c
$(CC) $(CFLAGS) -I../../src -o ../../src/napi.o ../../src/napi.c
all: jnexus.jar libjnexus.so test
jnexus.jar: $(JOBJ)
- rm jnexus.jar
$(JAVABIN)/jar cvf jnexus.jar $(JOBJ) \
ncsa/hdf/hdflib/ArrayDescriptor.class
libjnexus.so: $(COBJ)
$(CC) $(LFLAGS) -o $(SHLIB) $(COBJ) --enable-stdcall-fixup\
--enable-auto-import \
-L$(HDF4ROOT)/dlllib \
-L$(HDF5ROOT)/dll -lhdf5dll -lhm415m -lhd415m
header: neutron/nexus/NexusFile.class
$(JAVABIN)/javah -jni -d native neutron.nexus.NexusFile
test: test/TestJapi.class
clean:
- rm neutron/nexus/*.class
- rm ncsa/hdf/hdflib/*.class
- rm native/*.o
- rm ../../src/napi.o
|