# Makefile for pstoedit. BINDIR=/home/sun11b/local/sun4/bin MANDIR=/home/sun11b/local/man AWK=gawk # uncommment one of the following CCC lines for Un*x like systems # For users of GNU g++ CCC=g++ -Wall # For Sun's SparcCompiler (You may need to change SCC4 to CC) #CCC=SCC4.1 +w # For CenterLine (You may need to change clCC to CC) #CCC=clCC +w -ptv # rest of flags for Un*x systems CCFLAGS=-g -DDEFAULTGS=gs LDFLAGS=-lm INSTALL=cp OBJEXT=o EXEEXT= OUTPUT=-o pstoedit target=pstoedit CONFIGFILE=config.unx SPECIFICDRIVERS= drvtgif.$(OBJEXT) drvfig.$(OBJEXT) drvgnplt.$(OBJEXT) ############################################################# # For AIX xlC users #CCC=xlC #CCFLAGS=-g -+ -I/usr/lpp/xlC/src/nihC/aixinclude # uncomment for DOS / Turbo C++ #CCC=tcc #CCFLAGS=-P -I. -ml -DDEFAULTGS=gs386 #LDFLAGS= #OBJEXT=obj #EXEEXT=.exe #OUTPUT=-epstoedit #target=pstoedit.exe #CONFIGFILE=config.dos #SPECIFICDRIVERS= ############################################################# # uncomment for DOS / Visual C++ #CCC=cl #CCFLAGS= /W4 /I. -DDEFAULTGS=gs386 #FORCECPPFLAGS=/Tp #LDFLAGS= #OBJEXT=obj #EXEEXT=.exe #OUTPUT=/Fepstoedit #target=pstoedit.exe #CONFIGFILE=config.dos #SPECIFICDRIVERS= ############################################################# # uncomment for OS2 using VisualAge C++ #CCC=icc # # Tdp forces C++ # # Gm+ enables threads # # Ti activates debug mode #CCFLAGS= -I. /Tdp /Gm+ -DDEFAULTGS=gsos2 #OBJEXT=obj #EXEEXT=.exe #OUTPUT=-Fepstoedit #LIBS= #DEFFILE=pstoedit.def #target=pstoedit.exe #SPECIFICDRIVERS=drvmet.obj #CONFIGFILE=config.os2 ############################################################# # uncomment for OS2 using gcc #CCC=gcc #CCFLAGS=-Zexe -Zmt -D__OS2__='' -DDEFAULTGS=gsos2 #OBJEXT=o #EXEEXT= #OUTPUT=-o pstoedit #LIBS=-lstdcpp #DEFFILE=pstoedit.def #SPECIFICDRIVERS=drvmet.o #target=pstoedit #CONFIGFILE=config.os2 ############################################################# # uncomment if you want to use the CGM driver and have installed the # cd-library in $CDDIR #CDDIR=../cd #LOCALDEFINES=-I.. -I$(CDDIR) -DWITHCGM #LOCALDRIVERS=drvcgm.$(OBJEXT) $(CDDIR)/cd.$(OBJEXT) ############################################################# # For developers only: # Uncomment the following lines (LEXSOURCE= and PSHEADER=) if you have # pstoedit.pro and makeedit.l and need to make some changes in these files # I have tested this on Un*x only #LEXSOURCE=lexyy.cc # This is some sort ot hack. If LEXSOURCE is not defined, the flex rule below # only relates to dummy.cc, which is not used by the main target. #PSHEADER=pstoedit.ph # same comment applies to PSHEADER variable ############################################################# default : $(target) # No changes should be necessary below this line .SUFFIXES: .cc .obj .o .cc.o: $(CCC) -c -DCONFIGFILE=\"$(CONFIGFILE)\" $(LOCALDEFINES) $(CCFLAGS) $(FORCECPPFLAGS) $< .cc.obj: $(CCC) /c /DCONFIGFILE="$(CONFIGFILE)" $(LOCALDEFINES) $(CCFLAGS) $(FORCECPPFLAGS) $< # $(CCC) /c $(LOCALDEFINES) $(CCFLAGS) $&.cc HEADERS=\ drvtgif.h \ drvmif.h \ drvfig.h \ drvgnplt.h \ drvdxf.h \ drvmet.h \ drvpdf.h \ drvcgm.h \ drvsampl.h \ drvbase.h drvfuncs.h pstoedit.ph # Standard Drivers (for all systems) STANDARDDRIVERS=\ drvmif.$(OBJEXT) \ drvdxf.$(OBJEXT) \ drvpdf.$(OBJEXT) SAMPLEDRIVER=drvsampl.$(OBJEXT) DRIVERS=$(STANDARDDRIVERS) $(LOCALDRIVERS) $(SAMPLEDRIVER) $(SPECIFICDRIVERS) OBJECTS=pstoedit.$(OBJEXT) lexyy.$(OBJEXT) drvbase.$(OBJEXT) $(DRIVERS) # this does not work with GNU make #OBJECTS:sh =ls drv*.c | sed 's/\.c/\.$(OBJEXT)/' #OBJECTS += lexyy.$(OBJEXT) pstoedit : $(OBJECTS) $(CCC) $(OUTPUT) $(LDFLAGS) $(CCFLAGS) $(OBJECTS) $(LIBS) $(DEFFILE) pstoedit.exe : $(OBJECTS) # echo pstoedit.$(OBJEXT) lexyy.$(OBJEXT) drvbase.$(OBJEXT) > link.rsp # distribute the above objects among the following lines, in case # one of the driver variable is empty echo pstoedit.$(OBJEXT) $(STANDARDDRIVERS) > link.rsp echo lexyy.$(OBJEXT) $(LOCALDRIVERS) >> link.rsp echo $(SAMPLEDRIVER) >> link.rsp echo drvbase.$(OBJEXT) $(SPECIFICDRIVERS) >> link.rsp $(CCC) $(OUTPUT) $(LDFLAGS) $(CCFLAGS) @link.rsp del link.rsp $(LEXSOURCE) dummy.cc : makeedit.l flex -8 makeedit.l -mv lex.yy.c lexyy.cc -mv lexyy.c lexyy.cc clean: rm -f core pstoedit$(EXEEXT) *.$(OBJEXT) test: pstoedit$(EXEEXT) cd ../examples;\ ../src/pstoedit -f tgif illusion.ps illusion.ps.obj;\ tgif illusion.ps.obj;\ ../src/pstoedit -s 2 -f tgif illusion.ps illusion.ps.obj;\ tgif illusion.ps.obj;\ ../src/pstoedit -dt -f tgif illusion.ps illusion.ps.obj;\ tgif illusion.ps.obj;\ ../src/pstoedit -f tgif eschertr.ps eschertr.ps.obj;\ tgif eschertr.ps.obj;\ ../src/pstoedit -f fig spiral.ps spiral.ps.fig;\ xfig spiral.ps.fig;\ echo "now trying ps from groff";\ groff -man ../src/pstoedit.man > pstoedit.man.ps;\ ../src/pstoedit -f ps pstoedit.man.ps pstoedit.man.ps.ps;\ gs pstoedit.man.ps.ps;\ echo "now trying MIF for Frame ";\ ../src/pstoedit -f mif illusion.ps illusion.ps.mif ;\ ../src/pstoedit -f mif eschertr.ps eschertr.ps.mif ; # if you don't have groff, try the following instead # troff -man -Tpsc pstoedit.man | psdit > pstoedit.man.ps $(PSHEADER) dummy.ph : pstoedit.pro $(AWK) 'BEGIN { \ print "// DO NOT CHANGE THIS FILE. THIS FILE IS GENERATED FROM pstoedit.pro "; \ print "// You can get pstoedit.pro from the author of pstoedit"; \ print "// pstoedit.pro contains a lot more comments and explanations than pstoedit.ph"; \ print "const char * PS_prologue[] = "; print "{"; } \ /^%\/\// { gsub(/%/,""); print $$0; next;} \ /^[ \t]*%/ { next; } \ /^[ \t]*$$/ { next; } \ { gsub(/^[ \t]*/,""); gsub(/\\/,"\\\\"); gsub(/"/,"\\\""); print " \" " $$0 " \","; } \ END { print "0"; print "};" } ' < pstoedit.pro > pstoedit.ph install: pstoedit pstoedit.man $(INSTALL) pstoedit $(BINDIR) $(INSTALL) pstoedit.man $(MANDIR)/manl/pstoedit.l mtest: echo $(OBJECTS) #depend: # makedepend *.cc # DO NOT DELETE lexyy.$(OBJEXT): drvbase.h drvfuncs.h drvbase.$(OBJEXT): drvbase.h drvfuncs.h pstoedit.$(OBJEXT): $(HEADERS) $(CONFIGFILE) drvtgif.$(OBJEXT): drvtgif.h drvbase.h drvfuncs.h drvmif.$(OBJEXT): drvmif.h drvbase.h drvfuncs.h drvfig.$(OBJEXT): drvfig.h drvbase.h drvfuncs.h drvgnplt.$(OBJEXT): drvgnplt.h drvbase.h drvfuncs.h drvdxf.$(OBJEXT): drvdxf.h drvbase.h drvfuncs.h drvmet.$(OBJEXT): drvmet.h drvbase.h drvfuncs.h drvpdf.$(OBJEXT): drvpdf.h drvbase.h drvfuncs.h drvcgm.$(OBJEXT): drvcgm.h drvbase.h drvfuncs.h drvsampl.$(OBJEXT): drvbase.h drvsampl.h drvfuncs.h