home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / sc621_3.zip / src / Makefile.os2 < prev    next >
Makefile  |  1994-03-15  |  7KB  |  244 lines

  1. # Makefile for sc
  2. #
  3. # - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
  4. # - for Microsoft C 6.00A      [executables for OS/2 or MSDOS (16-bit)]
  5.  
  6. # To use, enter "make -f Makefile.os2" (this makefile depends on its
  7. # name being "Makefile.os2").
  8. #
  9. # Tested with dmake 3.8 and GNU make 3.68 under OS/2
  10.  
  11. SHELL=/bin/sh
  12.  
  13. default:
  14.     @echo "Enter $(MAKE) -f Makefile.os2 target                     "
  15.     @echo " where 'target' is chosen from                          " 
  16.     @echo "   msc      OS/2 exe [Microsoft C 6.00a]                "
  17.     @echo "   mscbnd   OS/2 and DOS exe [Microsoft C 6.00a]        "
  18.     @echo "   mscdos   DOS exe [Microsoft C 6.00a]                 "
  19.     @echo "   emx      OS/2 32-bit exe [EMX/gcc; uses emxlibc.dll] "
  20.     @echo "   emxbnd   OS/2 and DOS 32-bit exe [EMX/gcc]           "
  21.  
  22. msc: 
  23.     $(MAKE) -f Makefile.os2 all \
  24.     CC="cl -nologo -AL" O=".obj" \
  25.     CFLAGS="-D__STDC__ -D__OS2__ -UMSDOS" RINT="-DRINT"\
  26.     OBJ2="time.obj" \
  27.     OBJ3="getopt.obj" \
  28.     LDFLAGS="-Lp" \
  29.     LIB="setargv.obj lcurses.lib sc.def -link /NOE /st:0x4000"
  30.  
  31. mscbnd: 
  32.     $(MAKE) -f Makefile.os2 all \
  33.     CC="cl -nologo -AL" O=".obj" \
  34.     CFLAGS="-D__STDC__ -D__OS2__" RINT="-DRINT" \
  35.     OBJ2="time.obj popen.obj" \
  36.     OBJ3="getopt.obj" \
  37.     LDFLAGS="-Lp" LBIND="-Fb" \
  38.     LIB="setargv.obj lcurses.lib sc.def -link /NOE /st:0x4000" \
  39.     BIND="bind sc /n DOSMAKEPIPE DOSCWAIT DOSQFSATTACH"
  40.  
  41. mscdos: 
  42.     $(MAKE) -f Makefile.os2 all \
  43.     CC="cl -nologo -AL" O=".obj" \
  44.     CFLAGS="-D__STDC__" RINT="-DRINT" \
  45.     OBJ2="time.obj popen.obj" \
  46.     OBJ3="getopt.obj" \
  47.     LDFLAGS="-Lr" \
  48.     LIB="setargv.obj lcursesr.lib -link /NOE /st:0x4000"
  49.  
  50. emx:  
  51.     $(MAKE) -f Makefile.os2 all \
  52.     CC="gcc -Zomf -Zmtd -O -s" O=".obj" \
  53.     CFLAGS="-D__OS2__" FLOAT_STORE="-ffloat-store" \
  54.     LDFLAGS="" \
  55.     LIB="-lcurses sc-32.def"
  56.  
  57. emxbnd:  
  58.     $(MAKE) -f Makefile.os2 all \
  59.     CC="gcc -O -s" O=".o" \
  60.     CFLAGS="-D__OS2__ -DMSDOS" FLOAT_STORE="-ffloat-store" \
  61.     OBJ2="popen.o" \
  62.     LDFLAGS="" \
  63.     LIB="-lcurses sc-32.def"
  64.  
  65. name=sc
  66. NAME=SC
  67.  
  68. # This is where the library file (tutorial) goes.
  69. #LIBDIR=/usr/local/share/$(name) # reno
  70. LIBDIR=/usr/local/lib/$(name)
  71.  
  72. # Set DOBACKUPS if you would like a backup copy of a source file on a save
  73. DOBACKUPS=-DDOBACKUPS
  74.  
  75. # Set SIGVOID if signal routines are type void.
  76. SIGVOID=-DSIGVOID
  77.  
  78. # Set RINT=-DRINT if you do not have rint() in math.h
  79. #RINT=-DRINT
  80.  
  81. # Set RE_COMP if you have the re_comp/re_exec regular expression routines
  82. # (most BSD based systems do).
  83. RE_COMP=-DRE_COMP
  84. #RE_COMP=
  85.  
  86. # Set REGCMP if you have the regcmp/regex regular expression routines
  87. # (most System V based systems do)
  88. #REGCMP=-DREGCMP
  89. #REGCMP=
  90.  
  91. # This is the name of a pager like "more".
  92. DFLT_PAGER=-DDFLT_PAGER=\"less\"
  93.  
  94. # this is the name to save back ups in
  95. SAVE=-DSAVENAME=\"$(NAME).bak\"
  96.  
  97. # path to crypt, do not define if you don't have crypt
  98. #CRYPT=-DCRYPT_PATH=\"c:\mks\os2\mksos2\crypt.exe\"
  99.  
  100. # If you get errors about fmod being undefined when you try to
  101. # compile, then define NO_FMOD (most likely BSD4.3 and Mt Xinu).
  102. #FMOD=-DNO_FMOD
  103. FMOD=
  104.  
  105. # If your system doesn't have notimeout() in curses define NONOTIMEOUT
  106. NO_NOTIMEOUT=-DNONOTIMEOUT
  107.  
  108. # Format of quick reference guide generated by $(name)qref
  109. # Leave undefined for normal text output.
  110. QREF_FMT=
  111. #QREF_FMT=-DTROFF
  112.  
  113. YACC=bison -y
  114.  
  115. # MS-DOS needs y_tab instead of the normal y.tab
  116. YTAB=y.tab
  117.  
  118. # Command to use to make temporary copies of some source files.
  119. LN=cp
  120.  
  121. #### SYSTEM DEFINES ####
  122.  
  123. .c$O: 
  124.     $(CC) $(CFLAGS) -c $<
  125.  
  126. # All of the source files
  127. SRC= cmds.c crypt.c eres.sed format.c gram.y help.c interp.c \
  128.     lex.c psc.c range.c sc.c sc.h screen.c sres.sed version.c \
  129.     vi.c vmtbl.c xmalloc.c
  130.  
  131. # The objects
  132. SCOBJS=cmds$O crypt$O format$O gram$O help$O interp$O lex$O range$O sc$O \
  133.     screen$O version$O vi$O vmtbl$O xmalloc$O 
  134. OBJS=$(SCOBJS) $(OBJ2) regex$O
  135.  
  136. # The documents in the Archive
  137. DOCS=CHANGES README sc.doc psc.doc tutorial.sc VMS_NOTES torev build.com
  138.  
  139. all:    $(name).exe p$(name).exe $(name)qref.exe 
  140.  
  141. $(name).exe: $(OBJS)
  142.     $(CC) -o $@ ${LDFLAGS} $(OBJS) $(LIB)
  143.     $(BIND)
  144.  
  145. gram.c:    gram.y
  146.     $(YACC) -d gram.y
  147.     mv $(YTAB).c gram.c
  148.  
  149. $(YTAB).h:    gram.y
  150.  
  151. p$(name).exe: psc.c pvmtbl$O pxmalloc$O $(OBJ3)
  152.     $(CC) $(LDFLAGS) $(LBIND) -o $@ psc.c pvmtbl$O pxmalloc$O $(OBJ3) $(LIB)
  153.  
  154. $(name)qref.exe: qhelp.c sc.h
  155.     $(CC) $(LDFLAGS) $(LBIND) -o $@ -DQREF $(QREF_FMT) -DSCNAME=\"$(NAME)\" qhelp.c $(LIB)
  156.  
  157. pvmtbl.c: vmtbl.c
  158.     -rm -f pvmtbl.c
  159.     $(LN) vmtbl.c pvmtbl.c
  160.  
  161. pvmtbl$O: pvmtbl.c sc.h
  162.     $(CC) ${CFLAGS} -c -DPSC pvmtbl.c
  163.  
  164. pxmalloc.c: xmalloc.c
  165.     -rm -f pxmalloc.c
  166.     $(LN) xmalloc.c pxmalloc.c
  167.  
  168. # Objects
  169.  
  170. cmds$O: cmds.c sc.h
  171.     $(CC) ${CFLAGS} ${DOBACKUPS} ${CRYPT} -c cmds.c
  172.  
  173. crypt$O: crypt.c sc.h
  174.     $(CC) ${CFLAGS} ${CRYPT} ${DOBACKUPS} -c crypt.c
  175.  
  176. format$O: format.c
  177.     $(CC) ${CFLAGS} -c format.c
  178.  
  179. help$O: help.c sc.h
  180.     $(CC) ${CFLAGS} ${CRYPT} -c help.c
  181.  
  182. qhelp.c: help.c
  183.     -cp -f help.c qhelp.c
  184.  
  185. interp$O:    interp.c sc.h
  186.     $(CC) ${CFLAGS} $(FLOAT_STORE) ${IEEE_MATH} ${SIGVOID} ${RINT} ${RE_COMP} ${REGCMP} ${FMOD} -c interp.c
  187.  
  188. gram$O:    sc.h $(YTAB).h gram.c
  189.     $(CC) ${CFLAGS} -c gram.c
  190.     sed < gram.y > experres.h -f eres.sed
  191.     sed < gram.y > statres.h -f sres.sed
  192.  
  193. lex$O:    sc.h $(YTAB).h gram$O lex.c
  194.     $(CC) ${CFLAGS} ${SIMPLE} ${IEEE_MATH} ${SIGVOID} ${NO_NOTIMEOUT} -c lex.c
  195.  
  196. pxmalloc$O: sc.h pxmalloc.c
  197.     $(CC) ${CFLAGS} -c -DPSC pxmalloc.c
  198.  
  199. range$O: range.c sc.h
  200.     $(CC) ${CFLAGS} -c range.c
  201.  
  202. sc$O:    sc.h sc.c
  203.     $(CC) ${CFLAGS} ${DFLT_PAGER} ${RIGHTBUG} ${SIGVOID} ${SAVE} -c sc.c
  204.  
  205. screen$O:    sc.h screen.c
  206.     $(CC) ${CFLAGS} ${BROKENCURSES} ${IDLOKISBAD} ${INTERNATIONAL} ${RIGHTBUG} ${SIGVOID} ${NO_IDLOK} -c screen.c
  207.  
  208. vi$O: vi.c sc.h
  209.     $(CC) ${CFLAGS} -c vi.c
  210.  
  211. vmtbl$O: vmtbl.c sc.h
  212.     $(CC) ${CFLAGS} -c vmtbl.c
  213.  
  214. xmalloc$O: xmalloc.c sc.h
  215.     $(CC) ${CFLAGS} -c xmalloc.c
  216.  
  217. version$O: xmalloc.c sc.h
  218.     $(CC) ${CFLAGS} -c version.c
  219.  
  220. # other stuff
  221.  
  222. clean:
  223.     rm -f *.obj *.o *.exe *.i *.err *.out
  224.  
  225. $(name).1:    sc.doc
  226.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev sc.doc >  $(name).1
  227. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  228. #       -e s%#LIBDIR#%$(LIBDIR)%g sc.doc >  $(name).1
  229. #    REVISION=`sed -e '/Revision/!D' -e 's/.*$Revision: 6.21 $(
  230. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g \
  231. #        -e s%#LIBDIR#%$(LIBDIR)%g \
  232. #        -e 's/#REVISION#/$(REVISION)/' sc.doc >  $(name).1
  233.  
  234. $(name).man:    $(name).1
  235.     groff -man $(name).1 > $(name).man
  236.  
  237. p$(name).1:    psc.doc
  238.     name=$(name) NAME=$(NAME) LIBDIR=$(LIBDIR) sh torev psc.doc > p$(name).1
  239. #    sed -e s/pname/$(name)/g -e s/PNAME/$(NAME)/g psc.doc >  p$(name).1
  240.  
  241. p$(name).man:    p$(name).1
  242.     groff -man p$(name).1 > p$(name).man
  243.  
  244.