home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 334_02 / makefile.x11 < prev    next >
Makefile  |  1991-02-05  |  8KB  |  230 lines

  1. #
  2. # GNUPLOT Makefile (Unix X11 Motif/Athena support)
  3. #
  4.  
  5. # directory where to install executables on 'make install'
  6. DEST=/usr/local/bin
  7. # directory for installing man page on 'make man_install'
  8. MANDEST=/usr/man/manl
  9. # where to install help file gnuplot.gih
  10. #HELPDEST=/usr/local/lib/gnuplot.gih
  11. HELPDEST=docs/gnuplot.gih
  12. # Where to send email about bugs and comments (locally)
  13. EMAIL=\"pixar\!bug-gnuplot@sun.com\"
  14.  
  15. # -DVFORK if you have vfork()
  16. # -DBCOPY if your memcpy() is called bcopy() (a Berkeleyism, right?)
  17. # -DBZERO if you need to use bzero() (another BSD feature) instead of memset() 
  18. # -DNOCOPY if you don't have a memcpy() by any name
  19. # -DGAMMA=gamma if you've got gamma(3)
  20. # -DNOCWDRC to inhibit check of ".gnuplot" in current directory
  21. #    (for security reasons)
  22. # -DGETCWD if your unix uses getcwd() instead of getcd()
  23. #    this is needed by HP-UX and Cray Unicos systems.
  24. # -Dunix is required to explicitly define "unix" for SCO 
  25. # -fswitch if you are compiling on a Sun3 (or even -f68881)
  26. #    (but -fswitch is buggy on some systems, so watch out)
  27. # -O if you trust your compiler's optimizer
  28. CFLAGS = -DVFORK -DBCOPY -DBZERO -DGAMMA=gamma #-gx #-O
  29.  
  30. # -lplot if you have -DUNIXPLOT
  31. # -lsuntool -lsunwindow -lpixrect  if you have -DSUN
  32. # -lgl_s if IRIS4D
  33. # -lccgi if -DCGI
  34. LIBS = -lm -lplot
  35.  
  36. # -DMOTIF if Motif rather then Athena
  37. X11FLAGS = #-DMOTIF
  38.  
  39. # standard MIT X11 R4:  -lXaw -lXmu -lXt -lXext -lX11
  40. # Apollo DomainOS 10.3 (R3/Athena): -L/usr/lib/X11 -lXaw -lXmu -lXt -lX11
  41. # Apollo DomainOS 10.3 (R3/Motif): -L/usr/lib/X11 -lXm -lXtm -lX11
  42. # IBM RS/6000 AIX 3.1 (R3/Athena): -L/usr/lpp/X11/Xamples/lib/Xmu \
  43. #                -L/usr/lpp/X11/Xamples/lib/Xaw \
  44. #                        -lXaw -lXmu -lXt -lXext -lX11
  45. # IBM RS/6000 AIX 3.1 (R3/Motif): -lXm -lXt -lX11
  46. # HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -lXm -lXt -lX11
  47. X11LIBS = -lXaw -lXmu -lXt -lXext -lX11
  48.  
  49. # standard MIT X11 R4: -I/usr/include/X11 -I/usr/include/X11/Xaw 
  50. # Apollo DomainOS 10.3 (R3/Athena): -I/usr/include/X11
  51. # Apollo DomainOS 10.3 (R3/Motif): -I/usr/include/Xm
  52. # IBM RS/6000 AIX 3.1 (R3/Athena): -I/usr/include/X11 \
  53. #                   -I/usr/lpp/X11/Xamples/lib/Xaw \
  54. #                               -I/usr/lpp/X11/Xamples/lib/Xaw/X11
  55. # IBM RS/6000 AIX 3.1 (R3/Motif): -I/usr/include/Xm
  56. # HP 9000/375 HP-UX 6.5 and 7.0 (R3/Motif): -I/usr/include/Xm
  57. X11INCLUDES = -I/usr/include/X11 -I/usr/include/X11/Xaw
  58.  
  59. # -D<terminal> in TERMFLAGS iff you wish to support <terminal>
  60. # see other terminal defines in term.h
  61. # -DCGI        SCO CGI
  62. # -DFIG         Fig graphics language (requires object.h from TransFig)
  63. # -DIRIS4D      IRIS4D series computer
  64. # -DSUN         Sun Microsystems Workstation
  65. # -DUNIXPLOT    unixplot
  66. # -DX11         X11 Window System
  67.  
  68. TERMFLAGS =  -Iterm -DUNIXPLOT -DX11
  69.  
  70. OBJS = bitmap.o command.o eval.o graphics.o help.o internal.o misc.o parse.o\
  71.     plot.o scanner.o setshow.o standard.o term.o util.o 
  72.  
  73. DIRS = term demo bugtest docs docs/latextut translate
  74. CSOURCE1 = command.c setshow.c 
  75. CSOURCE2 = help.c graphics.c internal.c 
  76. CSOURCE3 = misc.c eval.c parse.c plot.c scanner.c standard.c 
  77. CSOURCE4 = bitmap.c term.c util.c version.c
  78. CSOURCE5 = term/aed.trm term/cgi.trm term/dxy.trm term/eepic.trm \
  79.     term/epson.trm term/fig.trm term/hp26.trm term/hp2648.trm \
  80.     term/hpgl.trm term/hpljii.trm 
  81. CSOURCE6 = term/imPcodes.h term/imagen.trm term/object.h \
  82.     term/iris4d.trm term/kyo.trm term/latex.trm term/pc.trm 
  83. CSOURCE7 = term/post.trm term/qms.trm term/regis.trm term/sun.trm \
  84.     term/t410x.trm term/tek.trm term/unixpc.trm term/unixplot.trm \
  85.     term/v384.trm term/x11.trm gnuplot_x11.c
  86. # not C code, but still needed
  87. ETC = Copyright README README.gnutex makefile.unx makefile.vms  \
  88.     README.x11 makefile.x11 \
  89.     makefile.3b1 plot.h help.h setshow.h bitmap.h term.h lasergnu \
  90.      demo/1.dat demo/2.dat demo/3.dat demo/controls.demo \
  91.     demo/simple.demo demo/polar.demo demo/electron.demo \
  92.     demo/param.demo demo/using.demo demo/using.dat \
  93.     bugtest/README bugtest/printf.c bugtest/scanf.c \
  94.     bugtest/mscbug.c term/README \
  95.     linkopt.vms buildvms.com
  96. # PC-specific files
  97. PC = corgraph.asm corplot.c header.mac hrcgraph.asm lineproc.mac \
  98.     linkopt.msc linkopt.tc makefile.msc makefile.tc pcgraph.asm 
  99. # Documentation and help files
  100. DOCS1 = docs/Makefile docs/README docs/checkdoc.c docs/doc2gih.c \
  101.     docs/doc2hlp.c docs/doc2hlp.com docs/doc2ms.c docs/doc2tex.c \
  102.     docs/gnuplot.1 docs/lasergnu.1 \
  103.     docs/titlepage.ms docs/titlepage.tex
  104. DOCS2 = docs/gnuplot.doc
  105. DOCS3 = docs/latextut/Makefile docs/latextut/eg1.plt \
  106.     docs/latextut/eg2.plt docs/latextut/eg3.dat docs/latextut/eg3.plt \
  107.     docs/latextut/eg4.plt docs/latextut/eg5.plt docs/latextut/eg6.plt \
  108.     docs/latextut/header.tex docs/latextut/tutorial.tex
  109. # gnutex->gnuplot translator
  110. TSOURCE1 = translate/Makefile translate/README translate/command.c \
  111.     translate/eval.c translate/gnut2p.1 translate/internal.c \
  112.     translate/misc.c translate/parse.c translate/plot.c
  113. TSOURCE2 = \
  114.     translate/plot.h translate/scanner.c translate/standard.c \
  115.     translate/test1 translate/test2 translate/util.c
  116.  
  117. all:    gnuplot gnuplot_x11 doc
  118.  
  119. gnuplot: $(OBJS) version.o
  120.     $(CC) $(CFLAGS) $(OBJS) version.o $(LIBS) -o gnuplot
  121.  
  122. doc:
  123.     ( cd docs; make gnuplot.gih )
  124.  
  125. translate:
  126.     (cd translate; make)
  127.  
  128. gnuplot_x11: gnuplot_x11.c
  129.     $(CC) $(CFLAGS) $(X11FLAGS) $(X11INCLUDES) -o gnuplot_x11 gnuplot_x11.c $(X11LIBS)
  130.  
  131. install: gnuplot gnuplot_x11 doc man_install
  132.     cp gnuplot gnuplot_x11 lasergnu $(DEST)
  133.     strip $(DEST)/gnuplot
  134.     strip $(DEST)/gnuplot_x11
  135.     (cd docs; make install-unix HELPDEST=$(HELPDEST))
  136.  
  137. man_install: docs/gnuplot.1 docs/lasergnu.1
  138.     cp docs/gnuplot.1 docs/lasergnu.1 $(MANDEST)
  139.  
  140. plot.o: plot.c
  141.     $(CC) $(CFLAGS) -DX11 -c plot.c
  142.  
  143. term.o: term.h term.c $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  144.     $(CC) $(CFLAGS) $(TERMFLAGS) -c term.c
  145.  
  146. version.o:
  147.     $(CC) $(CFLAGS) -DCONTACT=$(EMAIL) -c version.c
  148.  
  149. $(OBJS): plot.h
  150.  
  151. command.o:
  152.     $(CC) $(CFLAGS) -c command.c -DHELPFILE=\"$(HELPDEST)\"
  153.  
  154. command.o help.o misc.o: help.h
  155.  
  156. command.o graphics.o misc.o plot.o setshow.o term.o: setshow.h
  157.  
  158. bitmap.o term.o: bitmap.h
  159.  
  160. SOURCES=plot.h help.h setshow.h bitmap.h term.h $(CSOURCE1) $(CSOURCE2) \
  161.     $(CSOURCE3) $(CSOURCE4) $(CSOURCE5) $(CSOURCE6) $(CSOURCE7)
  162.  
  163. lint:
  164.     lint -hx $(SOURCES)
  165.  
  166. clean:
  167.     rm -f *.o *~ term/*~
  168.     (cd docs; make clean)
  169.     (cd docs/latextut; make clean)
  170.     (cd translate; make clean)
  171.  
  172. spotless:
  173.     rm -f *.o *~ term/*~ TAGS gnuplot gnuplot_x11
  174.     (cd docs; make clean)
  175.     (cd docs/latextut; make spotless)
  176.     (cd translate; make spotless)
  177.  
  178. shar: gnuplot.sh00 gnuplot.sh01 gnuplot.sh02 gnuplot.sh03 gnuplot.sh04 \
  179.     gnuplot.sh05 gnuplot.sh06 gnuplot.sh07 gnuplot.sh08 \
  180.     gnuplot.sh09 gnuplot.sh10 gnuplot.sh11 gnuplot.sh12 \
  181.     gnuplot.sh13 gnuplot.sh14
  182.  
  183. gnuplot.sh00:
  184.     echo '#!/bin/sh' > gnuplot.sh00
  185.     echo '# This is a shell file to make directories' >> gnuplot.sh00
  186.     echo mkdir $(DIRS) >> gnuplot.sh00
  187.  
  188. gnuplot.sh01: $(ETC)
  189.     shar $(ETC) > gnuplot.sh01
  190.  
  191. gnuplot.sh02: $(DOCS1)
  192.     shar $(DOCS1) > gnuplot.sh02
  193.  
  194. gnuplot.sh03: $(DOCS2)
  195.     shar $(DOCS2) > gnuplot.sh03
  196.  
  197. gnuplot.sh04: $(DOCS3)
  198.     shar $(DOCS3) > gnuplot.sh04
  199.  
  200. gnuplot.sh05: $(CSOURCE1)
  201.     shar $(CSOURCE1) > gnuplot.sh05
  202.  
  203. gnuplot.sh06: $(CSOURCE2)
  204.     shar $(CSOURCE2) > gnuplot.sh06
  205.  
  206. gnuplot.sh07: $(CSOURCE3)
  207.     shar $(CSOURCE3) > gnuplot.sh07
  208.  
  209. gnuplot.sh08: $(CSOURCE4)
  210.     shar $(CSOURCE4) > gnuplot.sh08
  211.  
  212. gnuplot.sh09: $(CSOURCE5)
  213.     shar $(CSOURCE5) > gnuplot.sh09
  214.  
  215. gnuplot.sh10: $(CSOURCE6)
  216.     shar $(CSOURCE6) > gnuplot.sh10
  217.  
  218. gnuplot.sh11: $(CSOURCE7)
  219.     shar $(CSOURCE7) > gnuplot.sh11
  220.  
  221. gnuplot.sh12: $(PC)
  222.     shar $(PC) > gnuplot.sh12
  223.  
  224. gnuplot.sh13: $(TSOURCE1)
  225.     shar $(TSOURCE1) > gnuplot.sh13
  226.  
  227. gnuplot.sh14: $(TSOURCE2)
  228.     shar $(TSOURCE2) > gnuplot.sh14
  229.  
  230.