home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / sc621_3.zip / src / Makefile.sun_bsd < prev    next >
Makefile  |  1992-06-01  |  13KB  |  491 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.  
  193. # Use this for system V.4
  194. #CFLAGS=  -DSYSV4 -DSYSV3 -O
  195. #LDFLAGS= -s
  196. #LIB=-lm -lcurses -lgen
  197. # with gcc also use:
  198. #CC=gcc
  199. #CFLAGS=  -DSYSV3 -O -pipe
  200.  
  201. # Microport
  202. #CFLAGS= -DSYSV2 -O -DUPORT -Ml
  203. #LDFLAGS=-Ml
  204. #LIB=-lm -lcurses -lPW
  205.  
  206. # Use this for BSD 4.2
  207. #CFLAGS= -O -DBSD42
  208. #LDFLAGS=
  209. #LIB=-lm -lcurses -ltermcap
  210. # with gcc also use:
  211. #CC=gcc
  212.  
  213. # Use this for Sequent boxes
  214. #CC=atscc
  215. #CFLAGS=-O -DBSD42
  216. #LDFLAGS= 
  217. #LIB=-lm -lcurses  -ltermcap
  218. #PSCLIB=-lseq
  219. # with gcc also use:
  220. #CC=gcc
  221. #CFLAGS= -O -DBSD42 -pipe
  222.  
  223. # Use this for BSD 4.3
  224. CFLAGS= -O -DBSD43    #-O or -g
  225. LDFLAGS=    # -lg might help if -g used in CFLAGS
  226. LIB=-lm -lcurses -ltermcap
  227.  
  228. # Use this for SunOS 4.X if you have the System V package installed.
  229. # This will link with the System V curses which is preferable to the
  230. # BSD curses (especially helps scrolling on slow (9600bps or less)
  231. # serial lines).
  232. #
  233. # Be sure to define SIGVOID and RE_COMP above.
  234. #CC=/usr/5bin/cc
  235. #CFLAGS= -O -DSYSV3 
  236. #LDFLAGS=
  237. #LIB=-lm -lcurses 
  238.  
  239. # Use this for system III (XENIX)
  240. #CFLAGS= -O -DSYSIII
  241. #LDFLAGS= -i
  242. #LIB=-lm -lcurses -ltermcap
  243.  
  244. # Use this for XENIX Version 2.3
  245. #CFLAGS= -O -DSYSIII -DXENIX2_3
  246. #LDFLAGS= -i
  247. #LIB=-lm -lcurses -ltermcap
  248.  
  249. # Use this for VENIX
  250. #CFLAGS= -DVENIX -DBSD42 -DV7
  251. #LDFLAGS= -z -i 
  252. #LIB=-lm -lcurses -ltermcap
  253.  
  254. # For SCO Unix V rel. 3.2.0
  255. #       -compile using rcc, cc does not cope with gram.c
  256. #       -edit /usr/include/curses.h, rcc does not understand #error
  257. #       -link: make CC=cc, rcc's loader gets unresolved __cclass, __range
  258. #               (rather strange,?)
  259. #CC=rcc
  260. #CC=cc
  261. #CC=gcc -fstrength-reduce
  262. #SIGVOID=-DSIGVOID
  263. #CFLAGS= -O -DSYSV3
  264. #LDFLAGS=
  265. #LIB=-lm -lcurses -ltinfo -lPW
  266. #YACC=yacc -Sm10000
  267.  
  268. # Use this for SCO Unix 3.2.2 and ODT 1.1
  269. #CC=cc
  270. #CFLAGS= -O -DSYSV3
  271. #LDFLAGS=
  272. #LIB=-lm -lcurses -lPW -lmalloc -lc_s
  273. #YACC=yacc -Sm10000
  274.  
  275. # Use this for MS-DOS, Microsoft C 5.1 and NDMAKE
  276. #CC=cl
  277. #CFLAGS= -AL -O -Fo$*.o
  278. #LDFLAGS=/noi /st:0x4000
  279. #LIB=lcurses
  280. #YACC=bison -y
  281. #
  282. #.SUFFIXES : .o .c
  283. #.c.o:
  284. #    $(CC) $(CFLAGS) -c $*.c
  285.  
  286. # All of the source files
  287. SRC=Makefile cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
  288.     lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
  289.     vi.c vmtbl.c xmalloc.c
  290.  
  291. # The objects
  292. OBJS=cmds.o crypt.o format.o gram.o help.o interp.o lex.o range.o sc.o \
  293.     screen.o version.o vi.o vmtbl.o xmalloc.o
  294.  
  295. # The documents in the Archive
  296. DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev build.com
  297.  
  298. all:    $(name) p$(name) $(name)qref
  299.  
  300. $(name):$(PAR)     $(OBJS)
  301.     $(CC) ${LDFLAGS} ${OBJS} ${LIB} -o $(name)
  302.  
  303. # Alternative link for MS-DOS
  304. #$(name):     $(OBJS)
  305. #    link ${LDFLAGS} ${OBJS},$(name),,${LIB};
  306.  
  307. gram.c:    gram.y
  308.     $(YACC) -d gram.y
  309.     mv $(YTAB).c gram.c
  310.  
  311. $(YTAB).h:    gram.y
  312.  
  313. p$(name):    psc.c pvmtbl.o pxmalloc.o
  314.     $(CC) $(CFLAGS) ${LDFLAGS} -o p$(name) psc.c pvmtbl.o pxmalloc.o ${PSCLIB}
  315.  
  316. # Alternative link for MS-DOS (NB: MSC 5.1 has no getopt.c)
  317. #p$(name):     psc.o pvmtbl.o pxmalloc.o getopt.o
  318. #    link ${LDFLAGS} psc.o pvmtbl.o pxmalloc.o getopt.o,p$(name);
  319.  
  320. qhelp.c: help.c
  321.     -rm -f qhelp.c
  322.     ${LN} help.c qhelp.c
  323.  
  324. $(name)qref:    qhelp.c sc.h
  325.     $(CC) $(CFLAGS) $(LDFLAGS) -DQREF $(QREF_FMT) -DSCNAME=\"$(NAME)\" -o $(name)qref qhelp.c
  326.  
  327. # Alternative link for MS-DOS
  328. #$(name)qref:    qhelp.c sc.h
  329. #    $(CC) -AL -O -Foqhelp.o -c -DQREF -DSCNAME=\"$(name)\" qhelp.c
  330. #    link ${LDFLAGS} qhelp.o,$(name)qref;
  331.  
  332. pvmtbl.c: vmtbl.c
  333.     -rm -f pvmtbl.c
  334.     ${LN} vmtbl.c pvmtbl.c
  335.  
  336. pvmtbl.o: sc.h pvmtbl.c
  337.     $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  338.  
  339. pxmalloc.c: xmalloc.c
  340.     -rm -f pxmalloc.c
  341.     ${LN} xmalloc.c pxmalloc.c
  342.  
  343. # Objects
  344.  
  345. cmds.o: cmds.c sc.h
  346.     $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  347.  
  348. crypt.o: crypt.c sc.h
  349.     $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  350.  
  351. format.o: format.c
  352.  
  353. help.o: help.c sc.h
  354.     $(CC) ${CFLAGS} ${CRYPT} -c help.c
  355.  
  356. qhelp.o: qhelp.c sc.h
  357.     $(CC) ${CFLAGS} ${CRYPT} -c qhelp.c
  358.  
  359. interp.o:    interp.c sc.h
  360.     $(CC) ${CFLAGS} ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  361.  
  362. gram.o:    sc.h $(YTAB).h gram.c
  363.     $(CC) ${CFLAGS} -c gram.c
  364.     sed < gram.y > experres.h -f eres.sed
  365.     sed < gram.y > statres.h -f sres.sed
  366.  
  367. lex.o:    sc.h $(YTAB).h gram.o lex.c
  368.     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NO_NOTIMEOUT} -c lex.c
  369.  
  370. pxmalloc.o: sc.h pxmalloc.c
  371.     $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  372.  
  373. range.o: range.c sc.h
  374.  
  375. sc.o:    sc.h sc.c
  376.     $(CC) ${CFLAGS} ${DFLT_PAGER} ${SIGVOID} ${SAVE} -c sc.c
  377.  
  378. screen.o:    sc.h screen.c
  379.     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c screen.c
  380.  
  381. vi.o: vi.c sc.h
  382.  
  383. # other stuff
  384.  
  385. clean:
  386.     rm -f *.o *res.h $(YTAB).h debug core gram.c $(name).1 \
  387.     p$(name).1 y.output pxmalloc.c pvmtbl.c qhelp.c
  388.  
  389. clobber:
  390.     rm -f *.o *res.h $(YTAB).h $(name) p$(name) debug core gram.c $(name).1 \
  391.     $(name).man p$(name).man p$(name).1 y.output $(name)qref \
  392.     pxmalloc.c pvmtbl.c qhelp.c
  393.  
  394. shar: ${SRC} ${DOCS}
  395.     shar -c -m 64000 -f shar ${DOCS} ${SRC}
  396.  
  397. sshar: ${SRC}
  398.     shar -c -m 1000000 -f shar ${SRC}
  399.  
  400. lint: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c range.c help.c \
  401.      vi.c version.c xmalloc.c format.c vmtbl.c
  402.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} sc.c lex.c gram.c interp.c \
  403.      cmds.c crypt.c range.c help.c vi.c version.c xmalloc.c format.c \
  404.      vmtbl.c -lcurses -lm 
  405.     make lintqref
  406.  
  407. lintqref: help.c
  408.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} -DQREF help.c
  409.  
  410. lintpsc: psc.c vmtbl.c
  411.     lint ${LINTFLAGS} ${CFLAGS} ${SIMPLE} -DPSC psc.c vmtbl.c
  412.  
  413. inspect: sc.h sc.c lex.c gram.c interp.c cmds.c crypt.c
  414.     /bruces/ianj/bin/i386/inspect -abv -t 8 sc.c lex.c gram.c interp.c \
  415.     cmds.c crypt.c range.c xmalloc.c help.c vi.c
  416.  
  417. print: sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c 
  418.     prc sc.h gram.y sc.c lex.c interp.c cmds.c crypt.c | lpr
  419.  
  420. $(name).1:    sc.doc
  421.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  422. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  423. #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  424. #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.21 $(
  425. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  426. #        -e s%#LIBDIR#%$(LIBDIR)%g \
  427. #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  428.  
  429. $(name).man:    $(name).1
  430.     nroff -man $(name).1 > $(name).man
  431.  
  432. laser:    $(name).1
  433.     itpf -x -Pim2 -man $(name).1
  434.  
  435. p$(name).1:    psc.doc
  436.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
  437. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc >  p$(name).1
  438.  
  439. p$(name).man:    p$(name).1
  440.     nroff -man p$(name).1 > p$(name).man
  441.  
  442. install: $(EXDIR)/$(name) $(EXDIR)/$(name)qref $(EXDIR)/p$(name) \
  443.      $(LIBDIR)/tutorial \
  444.      $(MANDIR)/$(name).$(MANEXT) $(MANDIR)/p$(name).$(MANEXT)
  445.  
  446. $(EXDIR)/$(name): $(name)
  447.     cp $(name) $(EXDIR)
  448.     strip $(EXDIR)/$(name)
  449.  
  450. $(EXDIR)/$(name)qref: $(name)qref
  451.     cp $(name)qref $(EXDIR)
  452.     strip $(EXDIR)/$(name)qref
  453.  
  454. $(EXDIR)/p$(name): p$(name)
  455.     cp p$(name) $(EXDIR)
  456.     strip $(EXDIR)/p$(name)
  457.  
  458. $(LIBDIR)/tutorial: tutorial.sc $(LIBDIR)
  459.     cp tutorial.sc $(LIBDIR)/tutorial.$(name)
  460.     chmod $(MANMODE) $(LIBDIR)/tutorial.$(name)
  461.  
  462. $(LIBDIR):
  463.     mkdir $(LIBDIR)
  464.  
  465. $(MANDIR)/$(name).$(MANEXT): $(name).1
  466.     cp $(name).1 $(MANDIR)/$(name).$(MANEXT)
  467.     chmod $(MANMODE) $(MANDIR)/$(name).$(MANEXT)
  468.  
  469. $(MANDIR)/p$(name).$(MANEXT): p$(name).1
  470.     cp p$(name).1 $(MANDIR)/p$(name).$(MANEXT)
  471.     chmod $(MANMODE) $(MANDIR)/p$(name).$(MANEXT)
  472.  
  473. diffs: ${SRC}
  474.     for i in ${DOCS} ${SRC}  ;\
  475.         do \
  476.         rcsdiff -c -r6.18 $$i ;\
  477.         done
  478.  
  479. # THA 10/14/90  Added code to make a patchfile
  480. patchfile: ${SRC} ${DOCS}
  481.     rm -f patchfile
  482.     for i in ${SRC} ${DOCS} ;\
  483.         do \
  484.         diffc $$i /users/toma/sc/sc6.12/$$i >> patchfile ;\
  485.         done
  486.  
  487. files:
  488.     @find $(DOCS) $(SRC) -print
  489.