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