home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pstoedit.zip / source.zip / pstoedit.2.50 / src / makefile < prev    next >
Makefile  |  1997-01-02  |  8KB  |  278 lines

  1. # Makefile for pstoedit. 
  2.  
  3. BINDIR=/home/sun11b/local/sun4/bin
  4. MANDIR=/home/sun11b/local/man
  5.  
  6. AWK=gawk
  7.  
  8.  
  9. # uncommment one of the following CCC lines for Un*x like systems
  10. # For users of GNU g++
  11. CCC=g++ -Wall 
  12. # For Sun's SparcCompiler (You may need to change SCC4 to CC)
  13. #CCC=SCC4.1 +w
  14. # For CenterLine (You may need to change clCC to CC)
  15. #CCC=clCC +w -ptv 
  16.  
  17. # rest of flags for Un*x systems
  18. CCFLAGS=-DDEFAULTGS=gs
  19. LDFLAGS=-lm
  20. INSTALL=cp
  21. OBJEXT=o
  22. EXEEXT=
  23. OUTPUT=-o pstoedit
  24. SPECIFICDRIVERS= drvtgif.$(OBJEXT)  drvfig.$(OBJEXT)  drvgnplt.$(OBJEXT) 
  25. MAIN=cmdmain
  26. target=pstoedit
  27. #############################################################
  28.  
  29. # For AIX xlC users
  30. #CCC=xlC
  31. #CCFLAGS=-g -+ -I/usr/lpp/xlC/src/nihC/aixinclude 
  32.  
  33.  
  34. # uncomment for Win32 / Borland C++
  35. #CCC=bcc32
  36. ## add -v to CCFLAGS for debugging
  37. #CCFLAGS= -DINTERNALBOOL -P  -DDEFAULTGS=gswin32 -I.;../cd1.2x 
  38. #LDFLAGS= 
  39. #LDLIBS= owlwf.lib bidsf.lib import32.lib cw32.lib
  40. #OBJEXT=obj
  41. #EXEEXT=.exe
  42. #OUTPUT=-epstoedit
  43. #SPECIFICDRIVERS=drvwmf.$(OBJEXT)
  44. #MAIN=cmdmain
  45. #target=pstoedit.exe
  46. #############################################################
  47.  
  48. # uncomment for DOS / Turbo C++
  49. #CCC=tcc
  50. #CCFLAGS=-P -I. -ml -DDEFAULTGS=gs386
  51. #LDFLAGS=
  52. #OBJEXT=obj
  53. #EXEEXT=.exe
  54. #OUTPUT=-epstoedit
  55. #SPECIFICDRIVERS=
  56. #MAIN=cmdmain
  57. #target=pstoedit.exe
  58. #############################################################
  59.  
  60. # uncomment for Win32 / Visual C++
  61. #CCC=cl
  62. ## /Ze is used in version 4.2 to enable language extensions like bool
  63. ## unfortunately this does not work as expected
  64. ## so we have to #define bool,false and true
  65. #CCFLAGS= /Zi /MLd /W3 /I. -Dbool=BOOL -Dfalse=FALSE -Dtrue=TRUE -DDEFAULTGS=gswin32 
  66. #FORCECPPFLAGS=/Tp
  67. #LDFLAGS=
  68. #OBJEXT=obj
  69. #EXEEXT=.exe
  70. #OUTPUT=/Fepstoedit
  71. #SPECIFICDRIVERS=
  72. #MAIN=cmdmain
  73. #target=pstoedit.exe
  74. #############################################################
  75.  
  76. # uncomment for OS2 using VisualAge C++
  77. #CCC=icc
  78. # # Tdp forces C++
  79. # # Gm+ enables threads
  80. # # Ti activates debug mode
  81. #CCFLAGS= -I. /Tdp /Gm+ -DDEFAULTGS=gsos2
  82. #OBJEXT=obj
  83. #EXEEXT=.exe
  84. #OUTPUT=-Fepstoedit
  85. #LDFLAGS=
  86. #DEFFILE=pstoedit.def
  87. #SPECIFICDRIVERS=drvmet.obj
  88. #MAIN=cmdmain
  89. #target=pstoedit.exe
  90. #############################################################
  91.  
  92. # uncomment for OS2 using gcc
  93. #CCC=gcc
  94. #CCFLAGS=-Zexe -Zmt -D__OS2__='' -DDEFAULTGS=gsos2
  95. #OBJEXT=o
  96. #EXEEXT=
  97. #OUTPUT=-o pstoedit
  98. #LDFLAGS=-lstdcpp
  99. #DEFFILE=pstoedit.def
  100. #SPECIFICDRIVERS=drvmet.o
  101. #MAIN=cmdmain
  102. #target=pstoedit
  103. #############################################################
  104.  
  105.  
  106. # uncomment if you want to use the CGM driver and have installed the 
  107. # cd-library in $CDDIR
  108. CDDIR=../cd1.2x
  109. LOCALDEFINES=-I$(CDDIR) -DWITHCGM
  110. LOCALDRIVERS=drvcgm.$(OBJEXT) cdlib.$(OBJEXT)
  111. #############################################################
  112.  
  113. # For developers only: 
  114. # Uncomment the following lines (LEXSOURCE= and PSHEADER=) if you  have 
  115. # pstoedit.pro and makeedit.l and need to make some changes in these files.
  116. #LEXSOURCE=lexyy.cpp
  117. # This is some sort ot hack. If LEXSOURCE is not defined, the make rule below
  118. # only relates to dummy.cpp, which is not used by the main target.
  119. #PSHEADER=pstoedit.ph
  120. # same comment applies to PSHEADER variable
  121. #############################################################
  122.  
  123.  
  124. default : $(target)
  125. # No changes should be necessary below this line
  126.  
  127. .SUFFIXES: .cpp .obj .o 
  128. .cpp.o:
  129.     $(CCC) -c $(LOCALDEFINES) $(CCFLAGS) $(FORCECPPFLAGS) $<
  130.  
  131. .cpp.obj:
  132.     $(CCC) /c $(LOCALDEFINES) $(CCFLAGS) $(FORCECPPFLAGS) $<
  133.  
  134. #    $(CCC) /c $(LOCALDEFINES) $(CCFLAGS) $&.cpp
  135.  
  136. HEADERS=\
  137.     drvlwo.h \
  138.     drvrib.h \
  139.     drvrpl.h \
  140.     drvtgif.h \
  141.     drvmif.h \
  142.     drvfig.h \
  143.     drvgnplt.h \
  144.     drvdxf.h \
  145.     drvmet.h \
  146.     drvpdf.h \
  147.     drvcgm.h \
  148.     drvjava.h \
  149.     drvsampl.h \
  150.     drvbase.h drvfuncs.h pstoedit.h pstoedit.ph version.h config.h
  151.  
  152. # Standard Drivers (for all systems)
  153. STANDARDDRIVERS=\
  154.     drvlwo.$(OBJEXT) \
  155.     drvrib.$(OBJEXT) \
  156.     drvrpl.$(OBJEXT) \
  157.     drvmif.$(OBJEXT) \
  158.     drvdxf.$(OBJEXT) \
  159.     drvjava.$(OBJEXT) \
  160.     drvpdf.$(OBJEXT) 
  161.  
  162. SAMPLEDRIVER=drvsampl.$(OBJEXT) 
  163.  
  164. DRIVERS=$(STANDARDDRIVERS) $(LOCALDRIVERS) $(SAMPLEDRIVER) $(SPECIFICDRIVERS)
  165. OBJECTS=$(MAIN).$(OBJEXT) pstoedit.$(OBJEXT) lexyy.$(OBJEXT) drvbase.$(OBJEXT) $(DRIVERS)
  166.  
  167. # this does not work with GNU make
  168. #OBJECTS:sh =ls drv*.c | sed 's/\.c/\.$(OBJEXT)/'
  169. #OBJECTS += lexyy.$(OBJEXT)
  170.  
  171. pstoedit : $(OBJECTS) 
  172.     $(CCC) $(OUTPUT)  $(CCFLAGS) $(OBJECTS) $(LDFLAGS) $(DEFFILE) 
  173.  
  174. pstoedit.pure : $(OBJECTS) 
  175.     purify $(CCC) -o pstoedit.pure  $(CCFLAGS) $(OBJECTS) $(LDFLAGS) $(DEFFILE) 
  176.  
  177. pstoedit.proof : $(OBJECTS) 
  178.     proof $(CCC) -o pstoedit.proof  $(CCFLAGS) $(OBJECTS) $(LDFLAGS) $(DEFFILE) 
  179.  
  180. pstoedit.exe : $(OBJECTS) 
  181. #    echo pstoedit.$(OBJEXT) lexyy.$(OBJEXT) drvbase.$(OBJEXT) > link.rsp
  182. # distribute the above objects among the following lines, in case
  183. # one of the driver variable is empty
  184.     echo $(MAIN).$(OBJEXT) pstoedit.$(OBJEXT) $(STANDARDDRIVERS)  > link.rsp
  185.     echo lexyy.$(OBJEXT) $(LOCALDRIVERS)  >> link.rsp
  186.     echo $(SAMPLEDRIVER)  $(SPECIFICDRIVERS)  >> link.rsp
  187.     echo drvbase.$(OBJEXT) $(LDLIBS)  >> link.rsp
  188.     $(CCC) $(OUTPUT)  $(LDFLAGS) $(CCFLAGS) @link.rsp
  189.     -del link.rsp
  190.  
  191. dummy.cpp $(LEXSOURCE) : makeedit.l
  192.     flex  -L -8 makeedit.l 
  193.     -mv lex.yy.c lexyy.cpp
  194.     -mv lexyy.c lexyy.cpp
  195.  
  196. clean:
  197.     rm -f core pstoedit.pure pstoedit.proof pstoedit$(EXEEXT) *.$(OBJEXT)
  198.  
  199. test: pstoedit$(EXEEXT)
  200.     cd ../examples;\
  201.     ../src/pstoedit -f tgif illusion.ps illusion.ps.obj;\
  202.     tgif illusion.ps.obj;\
  203.     ../src/pstoedit -s 2 -f tgif illusion.ps illusion.ps.obj;\
  204.     tgif illusion.ps.obj;\
  205.     ../src/pstoedit -dt -f tgif illusion.ps illusion.ps.obj;\
  206.     tgif illusion.ps.obj;\
  207.     ../src/pstoedit -f tgif eschertr.ps eschertr.ps.obj;\
  208.     tgif eschertr.ps.obj;\
  209.     ../src/pstoedit -f fig illusion.ps illusion.ps.fig;\
  210.     xfig illusion.ps.fig;\
  211.     ../src/pstoedit -f fig eschertr.ps eschertr.ps.fig;\
  212.     xfig eschertr.ps.fig;\
  213.     ../src/pstoedit -f fig spiral.ps spiral.ps.fig;\
  214.     xfig spiral.ps.fig;\
  215.     echo "now trying ps from groff";\
  216.     groff -man ../src/pstoedit.man > pstoedit.man.ps;\
  217.     ../src/pstoedit -f ps pstoedit.man.ps pstoedit.man.ps.ps;\
  218.     gs pstoedit.man.ps.ps;\
  219.     echo "now trying MIF for Frame ";\
  220.     ../src/pstoedit -f mif illusion.ps illusion.ps.mif ;\
  221.     ../src/pstoedit -f mif eschertr.ps eschertr.ps.mif ;\
  222.     echo "now trying RIB for RenderMan ";\
  223.     ../src/pstoedit -dt -f rib illusion.ps illusion.ps.rib ;\
  224.     ../src/pstoedit -dt -f rib eschertr.ps eschertr.ps.rib ;\
  225.     echo "now trying LWO for LightWave 3D ";\
  226.     ../src/pstoedit -dt -f lwo illusion.ps illusion.ps.lwo ;\
  227.     ../src/pstoedit -dt -f lwo eschertr.ps eschertr.ps.lwo ;\
  228.     echo "now trying RPL for Real3D ";\
  229.     ../src/pstoedit -dt -f rpl illusion.ps illusion.ps.rpl ;\
  230.     ../src/pstoedit -dt -f rpl eschertr.ps eschertr.ps.rpl ;\
  231.     echo "tests done";
  232.  
  233. # if you don't have groff, try the following instead
  234. #    troff -man -Tpsc pstoedit.man | psdit > pstoedit.man.ps
  235.  
  236. dummy.ph $(PSHEADER) : pstoedit.pro
  237.     $(AWK) 'BEGIN { \
  238.         print "// DO NOT CHANGE THIS FILE. THIS FILE IS GENERATED FROM pstoedit.pro "; \
  239.         print "// You can get pstoedit.pro from the author of pstoedit"; \
  240.         print "// pstoedit.pro contains a lot more comments and explanations than pstoedit.ph"; \
  241.         print "const char * PS_prologue[] = "; print "{"; } \
  242.           /^%\/\//      { gsub(/%/,""); print $$0; next;}    \
  243.           /^[ \t]*%/      { next; }    \
  244.           /^[ \t]*$$/      { next; }    \
  245.           { gsub(/^[ \t]*/,""); gsub(/\\/,"\\\\"); gsub(/"/,"\\\""); print " \" " $$0 " \","; } \
  246.           END   { print "0"; print "};" } ' < pstoedit.pro > pstoedit.ph
  247.  
  248. install: pstoedit pstoedit.man
  249.     $(INSTALL) pstoedit $(BINDIR)
  250.     $(INSTALL) pstoedit.man $(MANDIR)/manl/pstoedit.l
  251.  
  252. mtest:    
  253.     echo $(OBJECTS)
  254. #depend: 
  255. #    makedepend *.cpp
  256. # DO NOT DELETE
  257.  
  258.  
  259. lexyy.$(OBJEXT): drvbase.h drvfuncs.h 
  260. drvbase.$(OBJEXT): drvbase.h drvfuncs.h
  261. pstoedit.$(OBJEXT): $(HEADERS) 
  262. $(MAIN).$(OBJEXT): pstoedit.h
  263.  
  264. drvtgif.$(OBJEXT): drvtgif.h drvbase.h drvfuncs.h 
  265. drvlwo.$(OBJEXT): drvlwo.h drvbase.h drvfuncs.h 
  266. drvrib.$(OBJEXT): drvrib.h drvbase.h drvfuncs.h 
  267. drvrpl.$(OBJEXT): drvrpl.h drvbase.h drvfuncs.h 
  268. drvmif.$(OBJEXT): drvmif.h drvbase.h drvfuncs.h 
  269. drvfig.$(OBJEXT): drvfig.h drvbase.h drvfuncs.h
  270. drvgnplt.$(OBJEXT): drvgnplt.h drvbase.h drvfuncs.h 
  271. drvdxf.$(OBJEXT): drvdxf.h drvbase.h drvfuncs.h
  272. drvmet.$(OBJEXT): drvmet.h drvbase.h drvfuncs.h 
  273. drvpdf.$(OBJEXT): drvpdf.h drvbase.h drvfuncs.h
  274. drvcgm.$(OBJEXT): drvcgm.h drvbase.h drvfuncs.h
  275. drvsampl.$(OBJEXT): drvbase.h drvsampl.h drvfuncs.h
  276. drvjava.$(OBJEXT): drvbase.h drvjava.h drvfuncs.h
  277. drvwmf.$(OBJEXT): drvbase.h drvwmf.h drvfuncs.h
  278.