home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / gmt_os2.zip / src / Makefile.os2 < prev    next >
Encoding:
Makefile  |  1996-11-22  |  8.8 KB  |  305 lines

  1. #-----------------    THE GMT-system:    @(#)makefile    1.57  11 Aug 1995    --------------------
  2. #
  3. #        Makefile for GMT Version 3.0 for OS/2
  4. #
  5. #    Follow the instructions in this makefile to customize your setup.
  6. #    To compile/link them, try "make all", then "make install".
  7. #    When done, clean out directory with "make clean".
  8. #    For man pages, try "make man", then "make man_install"
  9. #
  10. #    Authors:    Paul Wessel, SOEST, U. of Hawaii
  11. #             Walter H. F. Smith, N/OES12, NOAA
  12. #
  13. #    Date:        1-JUN-1995
  14. #-------------------------------------------------------------------------------
  15. #    Default setup
  16. #-------------------------------------------------------------------------------
  17. #
  18. DRIVE = e:
  19. AR    = ar
  20. CC    = gcc
  21. CFLAGS = -O 
  22.  
  23. #  Note CPP refers to the C pre-processor, not to the C++ compiler
  24. CPP    = cpp
  25. INSTALL = install -s
  26. AR       = emxomfar
  27. ARFLAGS  = rc
  28. RANLIB    =
  29. #-------------------------------------------------------------------------------
  30. #====>>    I.  Set NETCDF, BINDIR, LIBDIR, and MANDIR before making anything!
  31. #           Uncomment SI if you want SI units as defaults
  32. #-------------------------------------------------------------------------------
  33. #    NETCDF  -> Where to find netcdf sub-directories lib and include
  34. #    BINDIR  -> Where to install executable code
  35. #    LIBDIR  -> Where GMT support data files are installed.  THis path
  36. #               must be hard, i.e., starting from root /
  37. #    MANDIR  -> Where GMT manual pages are installed
  38. #-------------------------------------------------------------------------------
  39. #SI    = -DSI
  40. NETCDF        = $(drive)/unix/netcdf
  41. BINDIR        = $(drive)/unix/gmt/bin
  42. LIBDIR        = $(drive)/unix/gmt/lib
  43. MANDIR        = $(drive)/unix/gmt/man
  44. #-------------------------------------------------------------------------------
  45. NETCDFLIB    = $(NETCDF)/lib
  46. NETCDFINC    = $(NETCDF)/include
  47. #-------------------------------------------------------------------------------
  48. #====>>    II. You may need to modify these macros
  49. #-------------------------------------------------------------------------------
  50. #
  51. # UNcomment INSTALL on machines that DONT use standard BSD install
  52. INSTALL    = copy
  53.  
  54. # UNcomment RANLIB on machines that DONT have ranlib.
  55. #RANLIB    = touch
  56.  
  57. # UNcomment XDR if the xdr library must be included separately
  58. # (Your xdr library may be called something else than -lsun)
  59. XDR    = -lxdr
  60.  
  61. # UNcomment CC_OPT and set if you need machine-specific compiler switches
  62. # (The current setting is _required_ for Dec Alphas)
  63. # CC_OPT    = -ieee_with_inexact -Olimit 1500
  64. #
  65. CC_OPT =
  66.  
  67. #-------------------------------------------------------------------------------
  68. #    !! STOP EDITING HERE, THE REST IS FIXED !!
  69. #-------------------------------------------------------------------------------
  70.  
  71. %.obj : %.c
  72.     $(CC) -c $(CFLAGS) $<
  73. PSL = -lpsl
  74. GMT = -lgmt
  75. LIBM = -llibm
  76.  
  77. SHELL=$(DRIVE)/os2/cmd.exe
  78. CPFLAGS      = -DDATE="\"22 November 1996\"" $(SI)
  79. CFLAGS    = -O  -Zomf -Zsys -Zmt -Zstack 64000 -I$(NETCDFINC)  -DOS2_EMX $(SI) $(CC_OPT)
  80. LDFLAGS = -Zlinker /PM:VIO 
  81. #
  82. #  CFLAGS below designed to define LIBDIR [needed by original GMT code]
  83. #
  84. #CFLAGS    = -O  -Zomf -Zsys -Zmt -I$(NETCDFINC) -DLIBDIR=\"$(LIBDIR)\"   $(SI) $(CC_OPT)
  85. #
  86. CDF      = -L$(NETCDFLIB) -lnetcdf -lxdr
  87. #
  88. LIB_C    = gmt_init.c \
  89.       gmt_plot.c \
  90.       gmt_support.c \
  91.       gmt_stat.c \
  92.       gmt_vector.c \
  93.       gmt_grdio.c \
  94.       gmt_customio.c \
  95.       gmt_cdf.c \
  96.       gmt_shore.c \
  97.       fourt.c \
  98.       gmt_map.c
  99. LIB_O    = gmt_init.obj \
  100.       gmt_plot.obj \
  101.       gmt_support.obj \
  102.       gmt_stat.obj \
  103.       gmt_vector.obj \
  104.       gmt_grdio.obj \
  105.       gmt_customio.obj \
  106.       gmt_cdf.obj \
  107.       gmt_shore.obj \
  108.       fourt.obj \
  109.       gmt_map.obj
  110. LIB     = gmt_init \
  111.       gmt_plot \
  112.       gmt_support \
  113.       gmt_stat \
  114.       gmt_vector \
  115.       gmt_grdio \
  116.       gmt_customio \
  117.       gmt_cdf \
  118.       gmt_shore \
  119.       fourt \
  120.       gmt_map
  121. GMT_H    = gmt.h \
  122.       gmt_shore.h \
  123.       gmt_project.h \
  124.       gmt_grd.h \
  125.       gmt_funcnames.h \
  126.       gmt_colors.h \
  127.       gmt_grdio.h \
  128.       gmt_customio.h \
  129.       gmt_bcr.h \
  130.       pslib.h
  131.  
  132. GMT_I    = gmt_init.h \
  133.       gmt_defaults.h \
  134.       PS_font_names.h \
  135.       PS_font_heights.h
  136.  
  137. PS_H    = pslib.h \
  138.       pslib_inc.h \
  139.       PS_font_names.h \
  140.       PS_font_heights.h
  141. #
  142. # Need to add grdmath to USER_x [before grdpaste]
  143. #
  144. USER = blockmean blockmedian filter1d fitcircle \
  145.       grdfilter gmtdefaults gmtset grd2cpt grd2xyz grdcontour grdcut grdclip grdedit \
  146.       grdfft grdgradient grdhisteq grdimage grdinfo grdlandmask grdmask grdtrack grdreformat \
  147.       grdmath grdpaste grdproject grdsample grdtrend grdvector grdview makecpt \
  148.       mapproject minmax nearneighbor project psbasemap psclip pscoast pshistogram \
  149.       psmask psmegaplot psrose psscale pstext pscontour pswiggle psxy psxyz \
  150.       sample1d spectrum1d splitxyz surface trend1d trend2d triangulate xyz2grd
  151.  
  152.  
  153. USER_C = blockmean.c blockmedian.c filter1d.c fitcircle.c \
  154.       grdfilter.c gmtdefaults.c gmtset.c grd2cpt.c grd2xyz.c grdcontour.c grdcut.c grdclip.c grdedit.c \
  155.       grdfft.c grdgradient.c grdhisteq.c grdimage.c grdinfo.c grdlandmask.c grdmask.c grdtrack.c grdreformat.c \
  156.       grdmath.c grdpaste.c grdproject.c grdsample.c grdtrend.c grdvector.c grdview.c makecpt.c \
  157.       mapproject.c minmax.c nearneighbor.c project.c psbasemap.c psclip.c pscoast.c pshistogram.c \
  158.       psmask.c psmegaplot.c psrose.c psscale.c pstext.c pscontour.c pswiggle.c psxy.c psxyz.c \
  159.       sample1d.c spectrum1d.c splitxyz.c surface.c trend1d.c trend2d.c triangulate.c xyz2grd.c
  160.  
  161. USER_EXE = blockmean.exe blockmedian.exe filter1d.exe fitcircle.exe \
  162.       grdfilter.exe gmtdefaults.exe gmtset.exe grd2cpt.exe grd2xyz.exe grdcontour.exe grdcut.exe grdclip.exe grdedit.exe \
  163.       grdfft.exe grdgradient.exe grdhisteq.exe grdimage.exe grdinfo.exe grdlandmask.exe grdmask.exe grdtrack.exe grdreformat.exe \
  164.       grdmath.exe grdpaste.exe grdproject.exe grdsample.exe grdtrend.exe grdvector.exe grdview.exe makecpt.exe \
  165.       mapproject.exe minmax.exe nearneighbor.exe project.exe psbasemap.exe psclip.exe pscoast.exe pshistogram.exe \
  166.       psmask.exe psmegaplot.exe psrose.exe psscale.exe pstext.exe pscontour.exe pswiggle.exe psxy.exe psxyz.exe \
  167.       sample1d.exe spectrum1d.exe splitxyz.exe surface.exe trend1d.exe trend2d.exe triangulate.exe xyz2grd.exe
  168.  
  169. LIBRARIES = gmt.lib psl.lib fdlibm.lib
  170.  
  171.  
  172. #-------------------------------------------------------------------------------
  173. #    object file dependencies
  174. #-------------------------------------------------------------------------------
  175. %.exe : %.c
  176.     $(CC) $(CFLAGS) $(LDFLAGS) $< -L. $(PSL) $(GMT) $(LIBM) $(CDF)
  177.  
  178. all:    libs $(USER_EXE)
  179.     
  180. install:    all
  181.         for i in $(USER); do \
  182.             $(INSTALL) $$i.exe $(BINDIR); \
  183.         done
  184.         copy fixgmtdefs $(BINDIR)
  185.  
  186. clean:
  187.         delete  *.obj
  188.  
  189. #-------------------------------------------------------------------------------
  190. #    libraries
  191. #-------------------------------------------------------------------------------
  192.  
  193. %.lib : %.obj
  194.     $(AR) $(ARFLAGS) $@ $<
  195.  
  196. libs:    psl.lib gmt.lib libm.lib
  197.  
  198. psl.lib:    pslib.obj
  199.     
  200. gmt.lib : $(LIB_O)
  201.     
  202.  
  203. #-------------------------------------------------------------------------------
  204. #    program dependencies
  205. #-------------------------------------------------------------------------------
  206.  
  207. $(USER) :    psl.lib gmt.lib libm.lib
  208.         $(CC) $(CFLAGS)  $@.obj -L. $(PSL) $(GMT) $(CDF) $(LIBM)
  209.  
  210. #-------------------------------------------------------------------------------
  211. #    Man page management
  212. #-------------------------------------------------------------------------------
  213. #
  214.  
  215. MAN =  blockmean.man \
  216.     blockmedian.man \
  217.     filter1d.man \
  218.     fitcircle.man \
  219.     gmt.man \
  220.     gmtdefaults.man \
  221.     gmtset.man \
  222.     grd2cpt.man \
  223.     grd2xyz.man \
  224.     grdfilter.man \
  225.     grdclip.man \
  226.     grdcontour.man \
  227.     grdcut.man \
  228.     grdedit.man \
  229.     grdfft.man \
  230.     grdgradient.man \
  231.     grdhisteq.man \
  232.     grdimage.man \
  233.     grdinfo.man \
  234.     grdlandmask.man \
  235.     grdmask.man \
  236.     grdmath.man \
  237.     grdpaste.man \
  238.     grdproject.man \
  239.     grdreformat.man \
  240.     grdsample.man \
  241.     grdtrack.man \
  242.     grdtrend.man \
  243.     grdvector.man \
  244.     grdview.man \
  245.     makecpt.man \
  246.     mapproject.man \
  247.     minmax.man \
  248.     nearneighbor.man \
  249.     project.man \
  250.     psbasemap.man \
  251.     psclip.man \
  252.     pscoast.man \
  253.     pscontour.man \
  254.     pshistogram.man \
  255.     psmask.man \
  256.     psmegaplot.man \
  257.     psrose.man \
  258.     psscale.man \
  259.     pstext.man \
  260.     pswiggle.man \
  261.     psxy.man \
  262.     psxyz.man \
  263.     sample1d.man \
  264.     spectrum1d.man \
  265.     splitxyz.man \
  266.     surface.man \
  267.     trend1d.man \
  268.     trend2d.man \
  269.     triangulate.man \
  270.     xyz2grd.man \
  271.     pslib.man
  272.  
  273. M_INC = explain_-B.txt \
  274.     explain_-b.txt \
  275.     explain_-H.txt \
  276.     explain_-J.txt \
  277.     explain_-j.txt \
  278.     explain_-Jz.txt \
  279.     explain_-K.txt \
  280.     explain_-O.txt \
  281.     explain_-P.txt \
  282.     explain_-R.txt \
  283.     explain_-r.txt \
  284.     explain_-U.txt \
  285.     explain_-V.txt \
  286.     explain_-XY.txt \
  287.     explain_-c.txt \
  288.     explain_-t.txt \
  289.     refs.i
  290.  
  291. MANL    = $(MAN:.man=)
  292.  
  293. man:    $(MAN)
  294.  
  295. man_install:
  296.         for i in $(MANL); do \
  297.             copy $$i.man $(MANDIR)/$$i.l; \
  298.         done
  299.  
  300. man_clean:
  301.         del  *.man
  302.  
  303. %.man : %.txt
  304.     $(CPP) $(CPFLAGS) $< | grep -v '^#' | gawk '( if (NF) print $0)' > $(@F:.txt=.man)
  305.