source: trunk/bindings/java/Make.mingw @ 1822

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