| 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 for Redhat Linux 6.2, which has an incompatible Make utility |
|---|
| 6 | # |
|---|
| 7 | # Mark Koennecke, October 2000 |
|---|
| 8 | #-------------------------------------------------------------------------- |
|---|
| 9 | .SUFFIXES: |
|---|
| 10 | .SUFFIXES: .java .class .c .o |
|---|
| 11 | |
|---|
| 12 | ########################################################################### |
|---|
| 13 | # C O N F I G U R A T I O N S E C T I O N # |
|---|
| 14 | ########################################################################### |
|---|
| 15 | # Where to find the HDF libraries: HDF4.1r3 is REQUIRED |
|---|
| 16 | HDFROOT=$(SINQDIR)/linux |
|---|
| 17 | |
|---|
| 18 | #Where to find the napi C stuff |
|---|
| 19 | NAPIROOT=$(SINQDIR)/linux |
|---|
| 20 | |
|---|
| 21 | # Where the Java binaries live |
|---|
| 22 | JAVABIN=/usr/lib/IBMJava2-131/bin |
|---|
| 23 | |
|---|
| 24 | # The classpath for compiling java |
|---|
| 25 | JCP=.: |
|---|
| 26 | |
|---|
| 27 | # The path to the include files for the jni-headers |
|---|
| 28 | JINCLUDE= -I/usr/lib/IBMJava2-131/include |
|---|
| 29 | |
|---|
| 30 | # The C-compiler to use |
|---|
| 31 | CC=gcc |
|---|
| 32 | |
|---|
| 33 | # Compiler flags to use for compiling |
|---|
| 34 | CFLAGS= -g -c $(JINCLUDE) -DHDF4 -DHDF5 -I$(HDFROOT)/include -I$(NAPIROOT) \ |
|---|
| 35 | -Inative |
|---|
| 36 | |
|---|
| 37 | #Compiler flags used for linking |
|---|
| 38 | LFLAGS= -g -shared -L$(HDFROOT)/lib -L$(NAPIROOT) |
|---|
| 39 | |
|---|
| 40 | #Target location for the shared library |
|---|
| 41 | SHLIB=bin/rh62/libjnexus.so |
|---|
| 42 | |
|---|
| 43 | ########################################################################### |
|---|
| 44 | # END OF C O N F I G U R A T I O N S E C T I O N # |
|---|
| 45 | # DO NOT TOUCH ANYTHING BELOW! # |
|---|
| 46 | ########################################################################### |
|---|
| 47 | |
|---|
| 48 | .java.class: |
|---|
| 49 | $(JAVABIN)/javac -g -classpath $(JCP) $*.java |
|---|
| 50 | |
|---|
| 51 | .c.o: |
|---|
| 52 | $(CC) $(CFLAGS) -o $*.o $*.c |
|---|
| 53 | |
|---|
| 54 | JOBJ=ncsa/hdf/hdflib/HDFException.class \ |
|---|
| 55 | ncsa/hdf/hdflib/HDFJavaException.class \ |
|---|
| 56 | ncsa/hdf/hdflib/HDFNotImplementedException.class \ |
|---|
| 57 | ncsa/hdf/hdflib/HDFConstants.class \ |
|---|
| 58 | ncsa/hdf/hdflib/HDFArray.class \ |
|---|
| 59 | ncsa/hdf/hdflib/HDFNativeData.class \ |
|---|
| 60 | neutron/nexus/NexusException.class \ |
|---|
| 61 | neutron/nexus/NXlink.class \ |
|---|
| 62 | neutron/nexus/NeXusFileInterface.class \ |
|---|
| 63 | neutron/nexus/AttributeEntry.class \ |
|---|
| 64 | neutron/nexus/NexusFile.class |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | COBJ=native/hdfnativeImp.o \ |
|---|
| 68 | native/hdfexceptionImp.o \ |
|---|
| 69 | native/handle.o \ |
|---|
| 70 | native/NexusFile.o |
|---|
| 71 | |
|---|
| 72 | du40: all |
|---|
| 73 | rh62: all |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | all: jnexus.jar libjnexus.so test |
|---|
| 77 | |
|---|
| 78 | jnexus.jar: $(JOBJ) |
|---|
| 79 | - rm jnexus.jar |
|---|
| 80 | $(JAVABIN)/jar cvf jnexus.jar $(JOBJ) \ |
|---|
| 81 | ncsa/hdf/hdflib/ArrayDescriptor.class |
|---|
| 82 | |
|---|
| 83 | libjnexus.so: $(COBJ) |
|---|
| 84 | $(CC) $(LFLAGS) -o $(SHLIB) $(COBJ) -lnexus \ |
|---|
| 85 | -lmfhdf -ldf \ |
|---|
| 86 | $(HDFROOT)/lib/libjpeg.a $(HDFROOT)/lib/libhdf5.a -lz -lm |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | header: neutron/nexus/NexusFile.class |
|---|
| 90 | $(JAVABIN)/javah -jni -d native neutron.nexus.NexusFile |
|---|
| 91 | |
|---|
| 92 | test: test/TestJapi.class |
|---|
| 93 | |
|---|
| 94 | clean: |
|---|
| 95 | - rm neutron/nexus/*.class |
|---|
| 96 | - rm ncsa/hdf/hdflib/*.class |
|---|
| 97 | - rm native/*.o |
|---|
| 98 | |
|---|
| 99 | |
|---|