| 1 | #==================================================================== |
|---|
| 2 | # NeXus - Neutron & X-ray Common Data Format |
|---|
| 3 | # |
|---|
| 4 | # Makefile for compiling NeXus with MinGW gcc/g77 distribution |
|---|
| 5 | # (see http://www.mingw.org/ for compiler details) |
|---|
| 6 | # |
|---|
| 7 | # run this file with: mingw32-make -f makefile.mingw |
|---|
| 8 | # |
|---|
| 9 | # Copyright (C) 2002 Freddie Akeroyd, CCLRC Rutherford Appleton Laboratory |
|---|
| 10 | # |
|---|
| 11 | # This library is free software; you can redistribute it and/or |
|---|
| 12 | # modify it under the terms of the GNU Lesser General Public |
|---|
| 13 | # License as published by the Free Software Foundation; either |
|---|
| 14 | # version 2 of the License, or (at your option) any later version. |
|---|
| 15 | # |
|---|
| 16 | # This library is distributed in the hope that it will be useful, |
|---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 19 | # Lesser General Public License for more details. |
|---|
| 20 | # |
|---|
| 21 | # You should have received a copy of the GNU Lesser General Public |
|---|
| 22 | # License along with this library; if not, write to the Free |
|---|
| 23 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|---|
| 24 | # MA 02111-1307 USA |
|---|
| 25 | # |
|---|
| 26 | # For further information, see <http://www.nexusformat.org> |
|---|
| 27 | # |
|---|
| 28 | # $Id$ |
|---|
| 29 | # |
|---|
| 30 | #==================================================================== |
|---|
| 31 | |
|---|
| 32 | # |
|---|
| 33 | # set these values for your HDF distribution |
|---|
| 34 | # |
|---|
| 35 | HDF4ROOT=c:\program files\hdf41r5 |
|---|
| 36 | HDFLIBS=-lhm415m -lhd415m |
|---|
| 37 | |
|---|
| 38 | # |
|---|
| 39 | # these should not need to be changed |
|---|
| 40 | # |
|---|
| 41 | LIBNEXUS_OBJ=napi.o napif.o |
|---|
| 42 | TEST4_OBJ=napi4_test.o |
|---|
| 43 | NXBROWSE_OBJ=NXbrowse.o |
|---|
| 44 | NXTOXML_OBJ=NXtoXML.o |
|---|
| 45 | NXTODTD_OBJ=NXtoDTD.o |
|---|
| 46 | CC=gcc |
|---|
| 47 | FC=g77 |
|---|
| 48 | EXTRA_LIBS=-lwsock32 -lg2c |
|---|
| 49 | # |
|---|
| 50 | |
|---|
| 51 | all: nexusdll.lib napif_test napi4_test NXbrowse NXtoXML NXtoDTD |
|---|
| 52 | |
|---|
| 53 | napi.o : napi.c |
|---|
| 54 | $(CC) -c -DHDF4 -D__unix -D_WIN32 -D_DLL -DNX45DLL_EXPORTS -I"$(HDF4ROOT)\include" $< |
|---|
| 55 | |
|---|
| 56 | .c.o : |
|---|
| 57 | $(CC) -c -DHDF4 -D__unix -D_WIN32 -D_DLL -I"$(HDF4ROOT)\include" $< |
|---|
| 58 | |
|---|
| 59 | .f.o : |
|---|
| 60 | g77 -c $< |
|---|
| 61 | |
|---|
| 62 | # |
|---|
| 63 | # nexusdll.lib is the DLL import library to link your program against. |
|---|
| 64 | # At run time, your program will then need access to nexus.dll |
|---|
| 65 | # |
|---|
| 66 | nexusdll.lib : $(LIBNEXUS_OBJ) |
|---|
| 67 | - rm -f $@ |
|---|
| 68 | dllwrap --output-lib=$@ --export-all-symbols --dllname=nexus.dll --driver-name=gcc \ |
|---|
| 69 | $(LIBNEXUS_OBJ) -L"$(HDF4ROOT)\dlllib" $(HDFLIBS) $(EXTRA_LIBS) |
|---|
| 70 | |
|---|
| 71 | napi4_test : nexusdll.lib $(TEST4_OBJ) |
|---|
| 72 | $(CC) $(CFLAGS) -o napi4_test $(TEST4_OBJ) nexusdll.lib \ |
|---|
| 73 | -L"$(HDF4ROOT)\dlllib" $(HDFLIBS) $(EXTRA_LIBS) |
|---|
| 74 | |
|---|
| 75 | napif_test: nexusdll.lib napif_test.o |
|---|
| 76 | $(FC) $(FFLAGS) -o napif_test napif_test.o nexusdll.lib \ |
|---|
| 77 | -L"$(HDF4ROOT)\dlllib" -lfrtbegin $(HDFLIBS) $(EXTRA_LIBS) |
|---|
| 78 | |
|---|
| 79 | NXbrowse: nexusdll.lib $(NXBROWSE_OBJ) |
|---|
| 80 | $(CC) $(CFLAGS) -o NXbrowse $(NXBROWSE_OBJ) nexusdll.lib \ |
|---|
| 81 | -L"$(HDF4ROOT)\dlllib" $(HDFLIBS) $(EXTRA_LIBS) |
|---|
| 82 | |
|---|
| 83 | NXtoXML: nexusdll.lib $(NXTOXML_OBJ) |
|---|
| 84 | $(CC) $(CFLAGS) -o NXtoXML $(NXTOXML_OBJ) nexusdll.lib \ |
|---|
| 85 | -L"$(HDF4ROOT)\dlllib" $(HDFLIBS) $(EXTRA_LIBS) |
|---|
| 86 | |
|---|
| 87 | NXtoDTD: nexusdll.lib $(NXTODTD_OBJ) |
|---|
| 88 | $(CC) $(CFLAGS) -o NXtoDTD $(NXTODTD_OBJ) nexusdll.lib \ |
|---|
| 89 | -L"$(HDF4ROOT)\dlllib" $(HDFLIBS) $(EXTRA_LIBS) |
|---|