home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CURS13_2.ZIP / MAKEFILE.OS2 < prev    next >
Text File  |  1989-12-11  |  13KB  |  333 lines

  1. #################################################################
  2. #                           PCCURSES                            #
  3. # Makefile to generate scursesp.lib, ccursesp.lib, mcursesp.lib,#
  4. # lcursesp.lib for MicroSoft 'C' v.5.1                          #
  5. #                                                               #
  6. # This makefile will generate subdirectories and call itself    #
  7. # recursively...                                                #
  8. #################################################################
  9. # 1.3-2: Modified for OS/2                              891211  #
  10. # 1.3:  Release:                                        881005  #
  11. #################################################################
  12.  
  13. # The following are the directories where your lib and include files
  14. # will be installed. These need to be edited for your system.
  15.  
  16. LIBDIR= \usr\lib
  17. INCDIR= \usr\include
  18.  
  19. # General definitions:
  20.  
  21. CFLAGS=         -M$(MODEL) -Ox -W3 -c -DOS2 -G2
  22.  
  23. COBJS=          attrib.obj   beep.obj     border.obj   boxes.obj     \
  24.                 charadd.obj  chardel.obj  charget.obj  charins.obj   \
  25.                 charpick.obj clrtobot.obj clrtoeol.obj endwin.obj    \
  26.                 initscr.obj  linedel.obj  lineins.obj  longname.obj  \
  27.                 move.obj     mvcursor.obj newwin.obj   options.obj   \
  28.                 overlay.obj  prntscan.obj refresh.obj  scrreg.obj    \
  29.                 setmode.obj  setterm.obj  stradd.obj   strget.obj    \
  30.                 tabsize.obj  termmisc.obj unctrl.obj   update.obj    \
  31.                 winclear.obj windel.obj   winerase.obj winmove.obj   \
  32.                 winscrol.obj wintouch.obj
  33.  
  34. ASMOBJS=        cursesio.obj
  35.  
  36. OBJS=           $(COBJS) $(ASMOBJS)
  37.  
  38. CC=             cl
  39.  
  40. CHMOD=          attrib
  41.  
  42. #################################################################
  43. # 'all' is all that can (and usually is) done                   #
  44. #################################################################
  45.  
  46. all:            small compact medium large
  47.  
  48. #################################################################
  49. # The following copies the header files to their proper place   #
  50. #################################################################
  51.  
  52. headers:        $(INCDIR)\curses.h $(INCDIR)\curspriv.h
  53.  
  54. $(INCDIR)\curses.h:     curses.h
  55.         $(CHMOD) -r $(INCDIR)\curses.h
  56.         copy curses.h $(INCDIR)\curses.h
  57.         $(CHMOD) +r $(INCDIR)\curses.h
  58.  
  59. $(INCDIR)\curspriv.h:   curspriv.h
  60.         $(CHMOD) -r $(INCDIR)\curspriv.h
  61.         copy curspriv.h $(INCDIR)\curspriv.h
  62.         $(CHMOD) +r $(INCDIR)\curspriv.h
  63.  
  64. #################################################################
  65. # The following will create a subdirectory for each memory      #
  66. # model, and initiate the make:ing in each one.                 #
  67. #################################################################
  68.  
  69. #################################################################
  70. # Create work directory if non-existent, go to it, and          #
  71. # perform the job - small model                                 #
  72. #################################################################
  73.  
  74. small:          headers                 \
  75.                 smodel                  \
  76.                 smodel\farnear.inc      \
  77.                 smodel\smalhuge.inc
  78.         (cd     smodel;\
  79.         make  -f ..\makefile.os2 $(MAKEFLAGS) "MODEL=s" $(LIBDIR)\scursesp.lib;\
  80.         cd      ..)
  81.  
  82. smodel:
  83.         mkdir   smodel
  84.  
  85. smodel\farnear.inc:     nearcall.inc
  86.         copy    nearcall.inc    smodel\farnear.inc
  87.  
  88. smodel\smalhuge.inc:    smaldata.inc
  89.         copy    smaldata.inc    smodel\smalhuge.inc
  90.  
  91. #################################################################
  92. # Create work directory if non-existent, go to it, and          #
  93. # perform the job - compact model                               #
  94. #################################################################
  95.  
  96. compact:        headers                 \
  97.                 cmodel                  \
  98.                 cmodel\farnear.inc      \
  99.                 cmodel\smalhuge.inc
  100.         (cd     cmodel;\
  101.         make  -f ..\makefile.os2 $(MAKEFLAGS) "MODEL=c" $(LIBDIR)\ccursesp.lib;\
  102.         cd      ..)
  103.  
  104. cmodel:
  105.         mkdir   cmodel
  106.  
  107. cmodel\farnear.inc:     nearcall.inc
  108.         copy    nearcall.inc    cmodel\farnear.inc
  109.  
  110. cmodel\smalhuge.inc:    hugedata.inc
  111.         copy    hugedata.inc    cmodel\smalhuge.inc
  112.  
  113. #################################################################
  114. # Create work directory if non-existent, go to it, and          #
  115. # perform the job - medium model                                #
  116. #################################################################
  117.  
  118. medium:         headers                 \
  119.                 mmodel                  \
  120.                 mmodel\farnear.inc      \
  121.                 mmodel\smalhuge.inc
  122.         (cd     mmodel;\
  123.         make  -f ..\makefile.os2 $(MAKEFLAGS) "MODEL=m" $(LIBDIR)\mcursesp.lib;\
  124.         cd      ..)
  125.  
  126. mmodel:
  127.         mkdir   mmodel
  128.  
  129. mmodel\farnear.inc:     farcall.inc
  130.         copy    farcall.inc     mmodel\farnear.inc
  131.  
  132. mmodel\smalhuge.inc:    smaldata.inc
  133.         copy    smaldata.inc    mmodel\smalhuge.inc
  134.  
  135. #################################################################
  136. # Create work directory if non-existent, go to it, and          #
  137. # perform the job - large model                                 #
  138. #################################################################
  139.  
  140. large:          headers                 \
  141.                 lmodel                  \
  142.                 lmodel\farnear.inc      \
  143.                 lmodel\smalhuge.inc
  144.         (cd     lmodel;\
  145.         make  -f ..\makefile.os2 $(MAKEFLAGS) "MODEL=l" $(LIBDIR)\lcursesp.lib;\
  146.         cd      ..)
  147.  
  148. lmodel:
  149.         mkdir   lmodel
  150.  
  151. lmodel\farnear.inc:     farcall.inc
  152.         copy    farcall.inc     lmodel\farnear.inc
  153.  
  154. lmodel\smalhuge.inc:    hugedata.inc
  155.         copy    hugedata.inc    lmodel\smalhuge.inc
  156.  
  157. #################################################################
  158. # Put together the library in file tmp.lib, then copy it to     #
  159. # the appropriate name for the memory model in question, and    #
  160. # delete the temporary file                                     #
  161. #################################################################
  162.  
  163. $(LIBDIR)\$(MODEL)curses.lib:   $(OBJS)
  164.         del     tmp.lib
  165.         lib @..\curses.cmd
  166.         $(CHMOD) -r $(LIBDIR)\$(MODEL)cursesp.lib
  167.         copy    tmp.lib $(LIBDIR)\$(MODEL)cursesp.lib
  168.         $(CHMOD) +r $(LIBDIR)\$(MODEL)cursesp.lib
  169.         del     tmp.lib
  170.  
  171. #################################################################
  172. # Commands and dependencies for individual modules              #
  173. #################################################################
  174.  
  175. attrib.obj:     ..\attrib.c ..\curses.h ..\curspriv.h
  176.         $(CC) $(CFLAGS) -Foattrib ..\attrib.c
  177.  
  178. beep.obj:       ..\beep.c ..\curses.h ..\curspriv.h
  179.         $(CC) $(CFLAGS) -Fobeep ..\beep.c
  180.  
  181. border.obj:     ..\border.c ..\curses.h ..\curspriv.h
  182.         $(CC) $(CFLAGS) -Foborder ..\border.c
  183.  
  184. boxes.obj:      ..\boxes.c ..\curses.h ..\curspriv.h
  185.         $(CC) $(CFLAGS) -Foboxes ..\boxes.c
  186.  
  187. charadd.obj:    ..\charadd.c ..\curses.h ..\curspriv.h
  188.         $(CC) $(CFLAGS) -Focharadd ..\charadd.c
  189.  
  190. chardel.obj:    ..\chardel.c ..\curses.h ..\curspriv.h
  191.         $(CC) $(CFLAGS) -Fochardel ..\chardel.c
  192.  
  193. charget.obj:    ..\charget.c ..\curses.h ..\curspriv.h
  194.         $(CC) $(CFLAGS) -Focharget ..\charget.c
  195.  
  196. charins.obj:    ..\charins.c ..\curses.h ..\curspriv.h
  197.         $(CC) $(CFLAGS) -Focharins ..\charins.c
  198.  
  199. charpick.obj:   ..\charpick.c ..\curses.h ..\curspriv.h
  200.         $(CC) $(CFLAGS) -Focharpick ..\charpick.c
  201.  
  202. clrtobot.obj:   ..\clrtobot.c ..\curses.h ..\curspriv.h
  203.         $(CC) $(CFLAGS) -Foclrtobot ..\clrtobot.c
  204.  
  205. clrtoeol.obj:   ..\clrtoeol.c ..\curses.h ..\curspriv.h
  206.         $(CC) $(CFLAGS) -Foclrtoeol ..\clrtoeol.c
  207.  
  208. endwin.obj:     ..\endwin.c ..\curses.h ..\curspriv.h
  209.         $(CC) $(CFLAGS) -Foendwin ..\endwin.c
  210.  
  211. initscr.obj:    ..\initscr.c ..\curses.h ..\curspriv.h
  212.         $(CC) $(CFLAGS) -Foinitscr ..\initscr.c
  213.  
  214. linedel.obj:    ..\linedel.c ..\curses.h ..\curspriv.h
  215.         $(CC) $(CFLAGS) -Folinedel ..\linedel.c
  216.  
  217. lineins.obj:    ..\lineins.c ..\curses.h ..\curspriv.h
  218.         $(CC) $(CFLAGS) -Folineins ..\lineins.c
  219.  
  220. longname.obj:   ..\longname.c ..\curses.h ..\curspriv.h
  221.         $(CC) $(CFLAGS) -Folongname ..\longname.c
  222.  
  223. move.obj:       ..\move.c ..\curses.h ..\curspriv.h
  224.         $(CC) $(CFLAGS) -Fomove ..\move.c
  225.  
  226. mvcursor.obj:   ..\mvcursor.c ..\curses.h ..\curspriv.h
  227.         $(CC) $(CFLAGS) -Fomvcursor ..\mvcursor.c
  228.  
  229. newwin.obj:     ..\newwin.c ..\curses.h ..\curspriv.h
  230.         $(CC) $(CFLAGS) -Fonewwin ..\newwin.c
  231.  
  232. options.obj:    ..\options.c ..\curses.h ..\curspriv.h
  233.         $(CC) $(CFLAGS) -Fooptions ..\options.c
  234.  
  235. overlay.obj:    ..\overlay.c ..\curses.h ..\curspriv.h
  236.         $(CC) $(CFLAGS) -Fooverlay ..\overlay.c
  237.  
  238. prntscan.obj:   ..\prntscan.c ..\curses.h ..\curspriv.h
  239.         $(CC) -M$(MODEL) -c -Oat -W3 -Foprntscan ..\prntscan.c
  240.  
  241. refresh.obj:    ..\refresh.c ..\curses.h ..\curspriv.h
  242.         $(CC) $(CFLAGS) -Forefresh ..\refresh.c
  243.  
  244. scrreg.obj:     ..\scrreg.c ..\curses.h ..\curspriv.h
  245.         $(CC) $(CFLAGS) -Foscrreg ..\scrreg.c
  246.  
  247. setmode.obj:    ..\setmode.c ..\curses.h ..\curspriv.h
  248.         $(CC) $(CFLAGS) -Fosetmode ..\setmode.c
  249.  
  250. setterm.obj:    ..\setterm.c ..\curses.h ..\curspriv.h
  251.         $(CC) $(CFLAGS) -Fosetterm ..\setterm.c
  252.  
  253. stradd.obj:     ..\stradd.c ..\curses.h ..\curspriv.h
  254.         $(CC) $(CFLAGS) -Fostradd ..\stradd.c
  255.  
  256. strget.obj:     ..\strget.c ..\curses.h ..\curspriv.h
  257.         $(CC) $(CFLAGS) -Fostrget ..\strget.c
  258.  
  259. tabsize.obj:    ..\tabsize.c ..\curses.h ..\curspriv.h
  260.         $(CC) $(CFLAGS) -Fotabsize ..\tabsize.c
  261.  
  262. termmisc.obj:   ..\termmisc.c ..\curses.h ..\curspriv.h
  263.         $(CC) $(CFLAGS) -Fotermmisc ..\termmisc.c
  264.  
  265. unctrl.obj:     ..\unctrl.c ..\curses.h ..\curspriv.h
  266.         $(CC) $(CFLAGS) -Founctrl ..\unctrl.c
  267.  
  268. update.obj:     ..\update.c ..\curses.h ..\curspriv.h
  269.         $(CC) $(CFLAGS) -Foupdate ..\update.c
  270.  
  271. winclear.obj:   ..\winclear.c ..\curses.h ..\curspriv.h
  272.         $(CC) $(CFLAGS) -Fowinclear ..\winclear.c
  273.  
  274. windel.obj:     ..\windel.c ..\curses.h ..\curspriv.h
  275.         $(CC) $(CFLAGS) -Fowindel ..\windel.c
  276.  
  277. winerase.obj:   ..\winerase.c ..\curses.h ..\curspriv.h
  278.         $(CC) $(CFLAGS) -Fowinerase ..\winerase.c
  279.  
  280. winmove.obj:    ..\winmove.c ..\curses.h ..\curspriv.h
  281.         $(CC) $(CFLAGS) -Fowinmove ..\winmove.c
  282.  
  283. winscrol.obj:   ..\winscrol.c ..\curses.h ..\curspriv.h
  284.         $(CC) $(CFLAGS) -Fowinscrol ..\winscrol.c
  285.  
  286. wintouch.obj:   ..\wintouch.c ..\curses.h ..\curspriv.h
  287.         $(CC) $(CFLAGS) -Fowintouch ..\wintouch.c
  288.  
  289. #################################################################
  290. # You have to choose one of the two following ways to make a    #
  291. # CURSESIO.OBJ - either the 'C' version or the 'ASM' version.   #
  292. # Comment out the one you do not like.                          #
  293. # (NOTE: the ASM version has NOT been ported to OS/2 yet....)   #
  294. #################################################################
  295.  
  296. cursesio.obj:   ..\cursesio.c
  297.         $(CC) $(CFLAGS) -Focursesio ..\cursesio.c
  298.  
  299. #cursesio.obj:  ..\cursesio.asm
  300. #       masm ..\cursesio.asm/mx,cursesio.obj,nul,nul;
  301.  
  302. #################################################################
  303. # Perform a backup of the files in the directory where the      #
  304. # 'make backup' command was issued - copies all files to the    #
  305. # floppy in drive A:                                            #
  306. #################################################################
  307.  
  308. backup:
  309.         @echo ***** Backup of PCcurses *****
  310.         @echo Insert backup diskette in drive A: and hit any key!
  311.         @pause
  312.         @echo Y > yes.txt
  313.         del a:\*.* < yes.txt >NUL
  314.         @del yes.txt
  315.         copy *.* a:
  316.  
  317. #################################################################
  318. # Remove all temporary files and work directories that were     #
  319. # created                                                       #
  320. #################################################################
  321.  
  322. clean:
  323.         @echo Y > yes.txt
  324.         del smodel\*.* < yes.txt >NUL
  325.         del cmodel\*.* < yes.txt >NUL
  326.         del mmodel\*.* < yes.txt >NUL
  327.         del lmodel\*.* < yes.txt >NUL
  328.         @del yes.txt
  329.         rmdir smodel
  330.         rmdir cmodel
  331.         rmdir mmodel
  332.         rmdir lmodel
  333.