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