home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / may94 / biz / misc / asc.lha / ASC / Makefile < prev    next >
Encoding:
Makefile  |  1993-11-02  |  12.6 KB  |  492 lines

  1. # Makefile $Revision: 6.21 $
  2. #
  3. # 1) Select the proper EXDIR (path), MANDIR, MANEXT, LIBDIR, SIGVOID,
  4. #    RE_COMP/REGCMP, DFLT_PAGER, and FMOD. Most of the other things aren't
  5. #    normally changed (see the comments with each)
  6. # 2) Select the proper machine/compiler/OS section of code
  7. #    for MS-DOS look for the pattern 'MS-DOS'
  8. # 3) make install
  9. # 4) If you have the command 'file' that uses /etc/magic add the line:
  10. #    38    string        Spreadsheet    sc file
  11.  
  12.  
  13. # Specify the name of the program.
  14. # All documentation and installation keys on this value.
  15. name=sc
  16. NAME=SC
  17.  
  18. # This is where the install step puts it.
  19. #EXDIR=/site/bin
  20. EXDIR=/usr/local/bin
  21.  
  22. # This is where the man page goes.
  23. #MANDIR=/usr/local/src/man/man1    # reno
  24. #MANEXT=1            # reno
  25. MANDIR=/usr/man/manl
  26. MANEXT=l
  27. MANMODE=644
  28.  
  29. # This is where the library file (tutorial) goes.
  30. #LIBDIR=/usr/local/share/$(name) # reno
  31. LIBDIR=/usr/local/lib/$(name)
  32.  
  33. # Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
  34. SIMPLE=
  35. #SIMPLE=-DSIMPLE
  36.  
  37. # Set BROKENCURSES if your curses has the nl/nonl bug
  38. # if it does and you don't set BROKENCURSES, the display will
  39. # be staggered across the screen. Also try IDLOKBAD below.
  40. BROKENCURSES=
  41. #BROKENCURSES=-DBROKENCURSES
  42.  
  43. # Set DOBACKUPS if you would like a backup copy of a source file on a save
  44. #DOBACKUPS=
  45. DOBACKUPS=-DDOBACKUPS
  46.  
  47. # Set INTERNATIONAL if you need 8 bit characters.  You should
  48. # not set this if you are running 5.3.0.  I think it is OK in 5.3.1.
  49. #INTERNATIONAL=-DINTERNATIONAL
  50. INTERNATIONAL=
  51.  
  52. # Set SIGVOID if signal routines are type void.
  53. # use: SIGVOID=-DSIGVOID for:
  54. #    System 5.3, SunOS 4.X, VMS, BSD4.4 (reno), and ANSI C Compliant systems
  55. # use: SIGVOID=        for:
  56. #  BSD systems (excluding reno, BSD4.4), and the UNIXPC 'cc'
  57. SIGVOID=-DSIGVOID
  58. #SIGVOID=
  59.  
  60. # Set IEEE_MATH if you need setsticky() calls in your signal handlers
  61. #
  62. #IEEE_MATH=-DIEEE_MATH
  63. IEEE_MATH=
  64.  
  65. # Set RINT=-DRINT if you do not have rint() in math.h
  66. # Set RINT=    on/with (they have rint):
  67. #    SunOS 4.0.3c compiler
  68. #    BSD4.4 (reno)
  69. RINT=
  70. #RINT=-DRINT
  71.  
  72. # Set RE_COMP if you have the re_comp/re_exec regular expression routines
  73. # (most BSD based systems do).
  74. #RE_COMP=-DRE_COMP
  75. RE_COMP=
  76.  
  77. # Set REGCMP if you have the regcmp/regex regular expression routines
  78. # (most System V based systems do)
  79. #REGCMP=-DREGCMP
  80. REGCMP=
  81.  
  82. # This is the name of a pager like "more".
  83. # "pg" may be appropriate for SYSV.
  84. DFLT_PAGER=-DDFLT_PAGER=\"less\"
  85. #DFLT_PAGER=-DDFLT_PAGER=\"more\"    # generic && reno
  86.  
  87. # this is the name to save back ups in
  88. SAVE=-DSAVENAME=\"$(NAME).SAVE\"
  89.  
  90. # path to crypt, do not define if you don't have crypt
  91. # most systems
  92. #CRYPT=-DCRYPT_PATH=\"/bin/crypt\"
  93. # BSD
  94. #CRYPT=-DCRYPT_PATH=\"/usr/bin/crypt\"
  95. CRYPT=
  96. # other people?
  97. #CRYPT=-DCRYPT_PATH=\"/usr/local/bin/crypt\"
  98.  
  99. # If you get errors about fmod being undefined when you try to
  100. # compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  101. #FMOD=-DNO_FMOD
  102. FMOD=
  103.  
  104. # If your system doesn't have notimeout() in curses define NONOTIMEOUT
  105. NO_NOTIMEOUT=
  106. #NO_NOTIMEOUT=-DNONOTIMEOUT
  107.  
  108. # flags for lint
  109. LINTFLAGS=-abchxv
  110.  
  111. # Format of quick reference guide generated by $(name)qref
  112. # Leave undefined for normal text output.
  113. #QREF_FMT=
  114. QREF_FMT=-DTROFF
  115.  
  116. # *** SPECIAL NOTES ***
  117. # For ULTRIX: define the BSD4.2 section and SIGVOID above
  118. #    tdw@cl.cam.ac.uk tested on Ultrix 3.1C-0
  119. # HP-UX 7.0: Do NOT use -O
  120. #    (known broken, try sc's boolean operators if you wish)
  121. #
  122. # **** SYSV curses bugs... ****
  123. # Try setting IDLOKBAD to fix (with an empty spreadsheet):
  124. #    a) Redrawing the bottom half of the screen when you
  125. #         move between row 9 <-> 10
  126. #    b) the highlighted row labels being trash when you
  127. #        move between row 9 <-> 10
  128. #    c) On an xterm on Esix Rev. D+ from eating lines
  129. #         -goto (or move) a few lines (or more) past the bottom
  130. #         of the screen, goto (or move) to the top line on the
  131. #         screen, move upward and the current line is deleted, the
  132. #         others move up even when they should not, check by
  133. #         noticing the rows become 2, 3, 40, 41, 42... (etc).
  134. #    Known systems/terminfos w/ curses problems:
  135. #    {Esix Rev. D+, AT&T SysV3.2.1}:at386-m,xterm, HP-UX7.0:(not sure)
  136. IDLOKISBAD=-DIDLOKBAD
  137. #IDLOKISBAD=
  138.  
  139. # If you don't have idlok() in your curses define NOIDLOK
  140. NO_IDLOK=
  141. #NO_IDLOK=-DNOIDLOK
  142.  
  143. # If moving right off the screen causes the screen to not redraw
  144. # properly, define RIGHT_CBUG to get around a curses problem on some
  145. # boxes, this forces screen redraws when going right off the screen
  146. RIGHTBUG=
  147. #RIGHTBUG=-DRIGHT_CBUG
  148.  
  149. # IF you have problems w/ your yacc try bison, Berkeley yacc, or
  150. # some other yacc. Some systems don't allow you to
  151. # increase the number of terminals (mostly AT&T), SCO's does though.
  152. #YACC=yacc
  153. # NOTE: Do not use with bison 1.16! Get a new version....
  154. YACC=bison -y
  155.  
  156. # MS-DOS needs y_tab instead of the normal y.tab
  157. #YTAB=y_tab
  158. YTAB=y.tab
  159.  
  160. # Command to use to make temporary copies of some source files.
  161. LN=copy
  162. #LN=ln -s
  163. #LN=cp
  164. MV=rename
  165.  
  166. #### SYSTEM DEFINES ####
  167.  
  168. # Use this for system AIX V3.1
  169. #CFLAGS= -O -DSYSV2 -DCHTYPE=int -DNLS
  170. #LDFLAGS=
  171. #LIB=-lm -lPW -lcurses
  172.  
  173. # Use this for system V.2 (includes: HP-UX 7.05, UNIXPC)
  174. #CFLAGS= -O -DSYSV2 
  175. #LDFLAGS=
  176. #LIB=-lm -lPW -lcurses
  177. # with gcc on a Sequent also use:
  178. #CC=att gcc
  179. #CFLAGS=  -DSYSV2 -g -pipe -traditional
  180.  
  181. # Use this for system V.3
  182. #CFLAGS=  -DSYSV3 -O
  183. #LDFLAGS= -s
  184. #CFLAGS=  -DSYSV3 -g
  185. #LDFLAGS= -g
  186. #LIB=-lm -lcurses -lPW
  187. # with gcc also use:
  188. #CC=gcc
  189. #CFLAGS=  -DSYSV3 -O -pipe -traditional
  190. # debugging bison (bison 1.16 is broken)
  191. #CFLAGS=  -DSYSV3 -g -pipe -traditional
  192. #YACC=bison -y -v -t -l
  193.  
  194. # Use this for system V.4
  195. #CFLAGS=  -DSYSV4 -DSYSV3 -O
  196. #LDFLAGS= -s
  197. #LIB=-lm -lcurses -lgen
  198. # with gcc also use:
  199. #CC=gcc
  200. #CFLAGS=  -DSYSV3 -O -pipe
  201.  
  202. # Microport
  203. #CFLAGS= -DSYSV2 -O -DUPORT -Ml
  204. #LDFLAGS=-Ml
  205. #LIB=-lm -lcurses -lPW
  206.  
  207. # Use this for BSD 4.2
  208. CFLAGS= -DBSD42
  209. LDFLAGS=
  210. LIB=-lm -lcurses -ltermcap
  211. # with gcc also use:
  212. CC=gcc
  213.  
  214. # Use this for Sequent boxes
  215. #CC=atscc
  216. #CFLAGS=-O -DBSD42
  217. #LDFLAGS= 
  218. #LIB=-lm -lcurses  -ltermcap
  219. #PSCLIB=-lseq
  220. # with gcc also use:
  221. #CC=gcc
  222. #CFLAGS= -O -DBSD42 -pipe
  223.  
  224. # Use this for BSD 4.3
  225. #CFLAGS= -O -DBSD43
  226. #LDFLAGS=
  227. #LIB=-lm -lcurses -ltermcap
  228.  
  229. # Use this for SunOS 4.X if you have the System V package installed.
  230. # This will link with the System V curses which is preferable to the
  231. # BSD curses (especially helps scrolling on slow (9600bps or less)
  232. # serial lines).
  233. #
  234. # Be sure to define SIGVOID and RE_COMP above.
  235. #CC=/usr/5bin/cc
  236. #CFLAGS= -O -DSYSV3 
  237. #LDFLAGS=
  238. #LIB=-lm -lcurses 
  239.  
  240. # Use this for system III (XENIX)
  241. #CFLAGS= -O -DSYSIII
  242. #LDFLAGS= -i
  243. #LIB=-lm -lcurses -ltermcap
  244.  
  245. # Use this for XENIX Version 2.3
  246. #CFLAGS= -O -DSYSIII -DXENIX2_3
  247. #LDFLAGS= -i
  248. #LIB=-lm -lcurses -ltermcap
  249.  
  250. # Use this for VENIX
  251. #CFLAGS= -DVENIX -DBSD42 -DV7
  252. #LDFLAGS= -z -i 
  253. #LIB=-lm -lcurses -ltermcap
  254.  
  255. # For SCO Unix V rel. 3.2.0
  256. #       -compile using rcc, cc does not cope with gram.c
  257. #       -edit /usr/include/curses.h, rcc does not understand #error
  258. #       -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
  259. #               (rather strange,?)
  260. #CC=rcc
  261. #CC=cc
  262. #CC=gcc -fstrength-reduce
  263. #SIGVOID=-DSIGVOID
  264. #CFLAGS= -O -DSYSV3
  265. #LDFLAGS=
  266. #LIB=-lm -lcurses -ltinfo -lPW
  267. #YACC=yacc -Sm10000
  268.  
  269. # Use this for SCO Unix 3.2.2 and ODT 1.1
  270. #CC=cc
  271. #CFLAGS= -O -DSYSV3
  272. #LDFLAGS=
  273. #LIB=-lm -lcurses -lPW -lmalloc -lc_s
  274. #YACC=yacc -Sm10000
  275.  
  276. # Use this for MS-DOS, Microsoft C 5.1 and NDMAKE
  277. #CC=cl
  278. #CFLAGS= -AL -O -Fo$*.o
  279. #LDFLAGS=/noi /st:0x4000
  280. #LIB=lcurses
  281. #YACC=bison -y
  282. #
  283. #.SUFFIXES : .o .c
  284. #.c.o:
  285. #    $(CC) $(CFLAGS) -c $*.c
  286.  
  287. # All of the source files
  288. SRC=Makefile cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
  289.     lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
  290.     vi.c vmtbl.c xmalloc.c
  291.  
  292. # The objects
  293. OBJS=cmds.o crypt.o format.o gram.o help.o interp.o lex.o range.o sc.o \
  294.     screen.o version.o vi.o vmtbl.o xmalloc.o
  295.  
  296. # The documents in the Archive
  297. DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev build.com
  298.  
  299. all:    $(name) p$(name) $(name)qref
  300.  
  301. $(name):$(PAR)     $(OBJS)
  302.     $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  303.  
  304. # Alternative link for MS-DOS
  305. #$(name):     $(OBJS)
  306. #    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  307.  
  308. gram.c:    gram.y
  309.     $(YACC) -d gram.y
  310.     $(MV) $(YTAB).c gram.c
  311.  
  312. $(YTAB).h:    gram.y
  313.  
  314. p$(name):    psc.c pvmtbl.o pxmalloc.o
  315.     $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  316.  
  317. # Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  318. #p$(name):     psc.o pvmtbl.o pxmalloc.o getopt.o
  319. #    link ${LDFLAGS} psc.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  320.  
  321. qhelp.c: help.c
  322.     -rm -f qhelp.c
  323.     ${LN} help.c qhelp.c
  324.  
  325. $(name)qref:    qhelp.c sc.h
  326.     $(CC) $(CFLAGS) $(LDFLAGS) -DQREF $(QREF_FMT) -DSCNAME=\"$(NAME)\" -o $(name)qref qhelp.c
  327.  
  328. # Alternative link for MS-DOS
  329. #$(name)qref:    qhelp.c sc.h
  330. #    $(CC) -AL -O -Foqhelp.o -c -DQREF -DSCNAME=\"$(name)\" qhelp.c
  331. #    link ${LDFLAGS} qhelp.o,$(name)qref;
  332.  
  333. pvmtbl.c: vmtbl.c
  334.     -rm -f pvmtbl.c
  335.     ${LN} vmtbl.c pvmtbl.c
  336.  
  337. pvmtbl.o: sc.h pvmtbl.c
  338.     $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  339.  
  340. pxmalloc.c: xmalloc.c
  341.     -rm -f pxmalloc.c
  342.     ${LN} xmalloc.c pxmalloc.c
  343.  
  344. # Objects
  345.  
  346. cmds.o: cmds.c sc.h
  347.     $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  348.  
  349. crypt.o: crypt.c sc.h
  350.     $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  351.  
  352. format.o: format.c
  353.  
  354. help.o: help.c sc.h
  355.     $(CC) ${CFLAGS} ${CRYPT} -c help.c
  356.  
  357. qhelp.o: qhelp.c sc.h
  358.     $(CC) ${CFLAGS} ${CRYPT} -c qhelp.c
  359.  
  360. interp.o:    interp.c sc.h
  361.     $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  362.  
  363. gram.o:    sc.h $(YTAB).h gram.c
  364.     $(CC) ${CFLAGS} -c gram.c
  365. #    sed -f eres.sed gram.y >experres.h
  366. #    sed -f sres.sed gram.y >statres.h
  367.  
  368. lex.o:    sc.h $(YTAB).h gram.o lex.c
  369.     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NO_NOTIMEOUT} -c lex.c
  370.  
  371. pxmalloc.o: sc.h pxmalloc.c
  372.     $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  373.  
  374. range.o: range.c sc.h
  375.  
  376. sc.o:    sc.h sc.c
  377.     $(CC) ${CFLAGS} ${DFLT_PAGER} ${RIGHTBUG} ${SIGVOID} ${SAVE} -c sc.c
  378.  
  379. screen.o:    sc.h screen.c
  380.     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c screen.c
  381.  
  382. vi.o: vi.c sc.h
  383.  
  384. # other stuff
  385.  
  386. clean:
  387.     rm -f *.o *res.h y.tab.h debug core gram.c $(name).1 \
  388.     p$(name).1 y.output pxmalloc.c pvmtbl.c qhelp.c y_tab.h
  389.  
  390. clobber:
  391.     rm -f *.o *res.h $(YTAB).h $(name) p$(name) debug core gram.c $(name).1 \
  392.     $(name).man p$(name).man p$(name).1 y.output $(name)qref \
  393.     pxmalloc.c pvmtbl.c qhelp.c
  394.  
  395. shar: ${SRC} ${DOCS}
  396.     shar -c -m 64000 -f shar ${DOCS} ${SRC}
  397.  
  398. sshar: ${SRC}
  399.     shar -c -m 1000000 -f shar ${SRC}
  400.  
  401. lint: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c range.c help.c \
  402.      vi.c version.c xmalloc.c format.c vmtbl.c
  403.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} sc.c lex.c gram.c interp.c \
  404.      cmds.c crypt.c range.c help.c vi.c version.c xmalloc.c format.c \
  405.      vmtbl.c -lcurses -lm 
  406.     make lintqref
  407.  
  408. lintqref: help.c
  409.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} -DQREF help.c
  410.  
  411. lintpsc: psc.c vmtbl.c
  412.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} -DPSC psc.c vmtbl.c
  413.  
  414. inspect: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c
  415.     /bruces/ianj/bin/i386/inspect -abv -t 8 sc.c lex.c gram.c interp.c \
  416.     cmds.c crypt.c range.c xmalloc.c help.c vi.c
  417.  
  418. print: sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c 
  419.     prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
  420.  
  421. $(name).1:    sc.doc
  422.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  423. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  424. #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  425. #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.21 $(
  426. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  427. #        -e s%#LIBDIR#%$(LIBDIR)%g \
  428. #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  429.  
  430. $(name).man:    $(name).1
  431.     nroff -man $(name).1 > $(name).man
  432.  
  433. laser:    $(name).1
  434.     itpf -x -Pim2 -man $(name).1
  435.  
  436. p$(name).1:    psc.doc
  437.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
  438. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc >  p$(name).1
  439.  
  440. p$(name).man:    p$(name).1
  441.     nroff -man p$(name).1 > p$(name).man
  442.  
  443. install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
  444.      $(LIBDIR)/tutorial \
  445.      $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  446.  
  447. $(EXDIR)/$(name): $(name)
  448.     cp $(name) $(EXDIR)
  449.     strip $(EXDIR)/$(name)
  450.  
  451. $(EXDIR)/$(name)qref: $(name)qref
  452.     cp $(name)qref $(EXDIR)
  453.     strip $(EXDIR)/$(name)qref
  454.  
  455. $(EXDIR)/p$(name): p$(name)
  456.     cp p$(name) $(EXDIR)
  457.     strip $(EXDIR)/p$(name)
  458.  
  459. $(LIBDIR)/tutorial: tutorial.sc $(LIBDIR)
  460.     cp tutorial.sc $(LIBDIR)/tutorial.$(name)
  461.     chmod $(MANMODE) $(LIBDIR)/tutorial.$(name)
  462.  
  463. $(LIBDIR):
  464.     mkdir $(LIBDIR)
  465.  
  466. $(MANDIR)/$(name).$(MANEXT): $(name).1
  467.     cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
  468.     chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  469.  
  470. $(MANDIR)/p$(name).$(MANEXT): p$(name).1
  471.     cp p$(name).1 $(MANDIR)/p$(name).$(MANEXT)
  472.     chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  473.  
  474. diffs: ${SRC}
  475.     for i in ${DOCS} ${SRC}  ;\
  476.         do \
  477.         rcsdiff -c -r6.18 $$i ;\
  478.         done
  479.  
  480. # THA 10/14/90  Added code to make a patchfile
  481. patchfile: ${SRC} ${DOCS}
  482.     rm -f patchfile
  483.     for i in ${SRC} ${DOCS} ;\
  484.         do \
  485.         diffc $$i /users/toma/sc/sc6.12/$$i >> patchfile ;\
  486.         done
  487.  
  488. files:
  489.     @find $(DOCS) $(SRC) -print
  490.