home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 332_01 / makefile.trc < prev    next >
Makefile  |  1990-01-07  |  13KB  |  418 lines

  1. #################################################################
  2. #               PCCURSES                #
  3. #                                #
  4. # Makefile to generate $(MODEL)curses.lib            #
  5. # for Borland Turbo-'C' v.1.0 and 2.0.                #
  6. #                                #
  7. # This makefile will generate subdirectories and call itself    #
  8. # recursively. Some entries in this makefile are only for    #
  9. # the author's personal use (I preferred to keep my own stuff    #
  10. # in the same place). Those are at the end of the makefile.    #
  11. #################################################################
  12. # 1.4:    Release:                    900114    #
  13. #################################################################
  14.  
  15. # The following are the directories where your lib and include
  16. # files will be installed. These need to be edited for your
  17. # system. Here are also the default C compiler and the standard
  18. # compilation flags. Change those if you want to. These are the
  19. # only changes that should be made to the makefile, unless you
  20. # have something special in mind...
  21.  
  22. LIBDIR=\trc\lib
  23. INCDIR=\trc\inc
  24. MANDIR=\man
  25. CC=tcc
  26. CFLAGS=    -m$(MODEL) -c -O -Z -w -w-pro
  27.  
  28. #################################################################
  29. # End of customizable stuff.                    #
  30. #################################################################
  31.  
  32. OBJS=        attrib.obj   beep.obj     border.obj   boxes.obj     \
  33.         charadd.obj  chardel.obj  charget.obj  charins.obj   \
  34.         charpick.obj clrtobot.obj clrtoeol.obj endwin.obj    \
  35.         initscr.obj  linedel.obj  lineins.obj  longname.obj  \
  36.         move.obj     mvcursor.obj newwin.obj   options.obj   \
  37.         overlay.obj  prntscan.obj refresh.obj  scrreg.obj    \
  38.         setmode.obj  setterm.obj  stradd.obj   strget.obj    \
  39.         tabsize.obj  termmisc.obj unctrl.obj   update.obj    \
  40.         winclear.obj windel.obj   winerase.obj winmove.obj   \
  41.         winscrol.obj wintouch.obj cursesio.obj
  42.  
  43. #################################################################
  44. # 'default' is all that can (and usually is) done        #
  45. #################################################################
  46.  
  47. default:    small compact medium large
  48.  
  49. #################################################################
  50. # Install the .lib files in $(LIBDIR) directory. Header files    #
  51. # are already installed - have to be to make make work ;-)    #    
  52. #################################################################
  53.  
  54. install:    iheaders ismall icompact imedium ilarge iman
  55.  
  56. #################################################################
  57. # The following copies the header files to their proper place    #
  58. #################################################################
  59.  
  60. iheaders:    $(INCDIR)\curses.h $(INCDIR)\curspriv.h
  61.  
  62. $(INCDIR)\curses.h:    curses.h
  63.     -attrib    -r $(INCDIR)\curses.h
  64.     copy curses.h $(INCDIR)\curses.h
  65.     attrib    +r $(INCDIR)\curses.h
  66.  
  67. $(INCDIR)\curspriv.h:    curspriv.h
  68.     -attrib    -r $(INCDIR)\curspriv.h
  69.     copy curspriv.h $(INCDIR)\curspriv.h
  70.     attrib    +r $(INCDIR)\curspriv.h
  71.  
  72. #################################################################
  73. # Install the manual pages in the man directory            #
  74. #################################################################
  75.  
  76. iman:    $(MANDIR)\curses.3
  77.  
  78. $(MANDIR)\curses.3: curses.3
  79.     attrib    -r $(MANDIR)\curses.3
  80.     copy curses.3 $(MANDIR)\curses.3
  81.     attrib    +r $(MANDIR)\curses.3
  82.  
  83. #################################################################
  84. # The following will create a subdirectory for each memory    #
  85. # model, and initiate the make:ing in each one.            #
  86. #################################################################
  87. # Create work directory if non-existent, go to it, and        #
  88. # perform the job - small model                    #
  89. #################################################################
  90.  
  91. ismall:        small
  92.         -attrib -r $(LIBDIR)\scurses.lib
  93.         copy smodel.trc\scurses.lib $(LIBDIR)\scurses.lib
  94.         -attrib +r $(LIBDIR)\scurses.lib
  95.  
  96. small:        iheaders        \
  97.         smodel.trc        \
  98.         smodel.trc\farnear.inc    \
  99.         smodel.trc\smalhuge.inc
  100.     cd    smodel.trc
  101.     -make  -f ..\makefile.trc $(MAKEFLAGS) "MODEL=s" scurses.lib
  102.     cd    ..
  103.  
  104. smodel.trc:
  105.     mkdir            smodel.trc
  106.  
  107. smodel.trc\farnear.inc:        nearcall.inc
  108.     copy    nearcall.inc    smodel.trc\farnear.inc
  109.  
  110. smodel.trc\smalhuge.inc:    smaldata.inc
  111.     copy    smaldata.inc    smodel.trc\smalhuge.inc
  112.  
  113. #################################################################
  114. # Create work directory if non-existent, go to it, and        #
  115. # perform the job - compact model                #
  116. #################################################################
  117.  
  118. icompact:    compact
  119.         -attrib -r $(LIBDIR)\ccurses.lib
  120.         copy cmodel.trc\ccurses.lib $(LIBDIR)\ccurses.lib
  121.         -attrib +r $(LIBDIR)\ccurses.lib
  122.  
  123. compact:    iheaders        \
  124.         cmodel.trc        \
  125.         cmodel.trc\farnear.inc    \
  126.         cmodel.trc\smalhuge.inc
  127.     cd    cmodel.trc
  128.     -make  -f ..\makefile.trc $(MAKEFLAGS) "MODEL=c" ccurses.lib
  129.     cd    ..
  130.  
  131. cmodel.trc:
  132.     mkdir            cmodel.trc
  133.  
  134. cmodel.trc\farnear.inc:        nearcall.inc
  135.     copy    nearcall.inc    cmodel.trc\farnear.inc
  136.  
  137. cmodel.trc\smalhuge.inc:    hugedata.inc
  138.     copy    hugedata.inc    cmodel.trc\smalhuge.inc
  139.  
  140. #################################################################
  141. # Create work directory if non-existent, go to it, and        #
  142. # perform the job - medium model                #
  143. #################################################################
  144.  
  145. imedium:    medium
  146.         -attrib -r $(LIBDIR)\mcurses.lib
  147.         copy mmodel.trc\mcurses.lib $(LIBDIR)\mcurses.lib
  148.         -attrib +r $(LIBDIR)\mcurses.lib
  149.  
  150. medium:        iheaders        \
  151.         mmodel.trc        \
  152.         mmodel.trc\farnear.inc    \
  153.         mmodel.trc\smalhuge.inc
  154.     cd    mmodel.trc
  155.     -make  -f ..\makefile.trc $(MAKEFLAGS) "MODEL=m" mcurses.lib
  156.     cd    ..
  157.  
  158. mmodel.trc:
  159.     mkdir            mmodel.trc
  160.  
  161. mmodel.trc\farnear.inc:        farcall.inc
  162.     copy    farcall.inc    mmodel.trc\farnear.inc
  163.  
  164. mmodel.trc\smalhuge.inc:    smaldata.inc
  165.     copy    smaldata.inc    mmodel.trc\smalhuge.inc
  166.  
  167. #################################################################
  168. # Create work directory if non-existent, go to it, and        #
  169. # perform the job - large model                    #
  170. #################################################################
  171.  
  172. ilarge:        large
  173.         -attrib -r $(LIBDIR)\lcurses.lib
  174.         copy lmodel.trc\lcurses.lib $(LIBDIR)\lcurses.lib
  175.         -attrib +r $(LIBDIR)\lcurses.lib
  176.  
  177. large:        iheaders        \
  178.         lmodel.trc        \
  179.         lmodel.trc\farnear.inc    \
  180.         lmodel.trc\smalhuge.inc
  181.     cd    lmodel.trc
  182.     -make  -f ..\makefile.trc $(MAKEFLAGS) "MODEL=l" lcurses.lib
  183.     cd    ..
  184.  
  185. lmodel.trc:
  186.     mkdir            lmodel.trc
  187.  
  188. lmodel.trc\farnear.inc:        farcall.inc
  189.     copy    farcall.inc    lmodel.trc\farnear.inc
  190.  
  191. lmodel.trc\smalhuge.inc:    hugedata.inc
  192.     copy    hugedata.inc    lmodel.trc\smalhuge.inc
  193.  
  194. #################################################################
  195. # Put together the library in file tmp.lib, then rename it to    #
  196. # $(MODEL)curses.lib (You cannot answer 'y' to LIB prompt from    #
  197. # the .CMD file otherwise).                     #
  198. #################################################################
  199.  
  200. $(MODEL)curses.lib:    $(OBJS)
  201.     del    $(MODEL)curses.lib
  202.     lib    @..\curses.cmd
  203.     ren    tmp.lib $(MODEL)curses.lib
  204.  
  205. #################################################################
  206. # Commands and dependencies for individual modules        #
  207. #################################################################
  208.  
  209. attrib.obj:    ..\attrib.c ..\curses.h ..\curspriv.h
  210.     $(CC) $(CFLAGS) -oattrib ..\attrib.c
  211.  
  212. beep.obj:    ..\beep.c ..\curses.h ..\curspriv.h
  213.     $(CC) $(CFLAGS) -obeep ..\beep.c
  214.  
  215. border.obj:    ..\border.c ..\curses.h ..\curspriv.h
  216.     $(CC) $(CFLAGS) -N -oborder ..\border.c
  217.  
  218. boxes.obj:    ..\boxes.c ..\curses.h ..\curspriv.h
  219.     $(CC) $(CFLAGS) -oboxes ..\boxes.c
  220.  
  221. charadd.obj:    ..\charadd.c ..\curses.h ..\curspriv.h
  222.     $(CC) $(CFLAGS) -ocharadd ..\charadd.c
  223.  
  224. chardel.obj:    ..\chardel.c ..\curses.h ..\curspriv.h
  225.     $(CC) $(CFLAGS) -ochardel ..\chardel.c
  226.  
  227. charget.obj:    ..\charget.c ..\curses.h ..\curspriv.h
  228.     $(CC) $(CFLAGS) -ocharget ..\charget.c
  229.  
  230. charins.obj:    ..\charins.c ..\curses.h ..\curspriv.h
  231.     $(CC) $(CFLAGS) -ocharins ..\charins.c
  232.  
  233. charpick.obj:    ..\charpick.c ..\curses.h ..\curspriv.h
  234.     $(CC) $(CFLAGS) -ocharpick ..\charpick.c
  235.  
  236. clrtobot.obj:    ..\clrtobot.c ..\curses.h ..\curspriv.h
  237.     $(CC) $(CFLAGS) -oclrtobot ..\clrtobot.c
  238.  
  239. clrtoeol.obj:    ..\clrtoeol.c ..\curses.h ..\curspriv.h
  240.     $(CC) $(CFLAGS) -oclrtoeol ..\clrtoeol.c
  241.  
  242. endwin.obj:    ..\endwin.c ..\curses.h ..\curspriv.h
  243.     $(CC) $(CFLAGS) -oendwin ..\endwin.c
  244.  
  245. initscr.obj:    ..\initscr.c ..\curses.h ..\curspriv.h
  246.     $(CC) $(CFLAGS) -oinitscr ..\initscr.c
  247.  
  248. linedel.obj:    ..\linedel.c ..\curses.h ..\curspriv.h
  249.     $(CC) $(CFLAGS) -olinedel ..\linedel.c
  250.  
  251. lineins.obj:    ..\lineins.c ..\curses.h ..\curspriv.h
  252.     $(CC) $(CFLAGS) -olineins ..\lineins.c
  253.  
  254. longname.obj:    ..\longname.c ..\curses.h ..\curspriv.h
  255.     $(CC) $(CFLAGS) -olongname ..\longname.c
  256.  
  257. move.obj:    ..\move.c ..\curses.h ..\curspriv.h
  258.     $(CC) $(CFLAGS) -omove ..\move.c
  259.  
  260. mvcursor.obj:    ..\mvcursor.c ..\curses.h ..\curspriv.h
  261.     $(CC) $(CFLAGS) -w-par -omvcursor ..\mvcursor.c
  262.  
  263. newwin.obj:    ..\newwin.c ..\curses.h ..\curspriv.h
  264.     $(CC) $(CFLAGS) -onewwin ..\newwin.c
  265.  
  266. options.obj:    ..\options.c ..\curses.h ..\curspriv.h
  267.     $(CC) $(CFLAGS) -ooptions ..\options.c
  268.  
  269. overlay.obj:    ..\overlay.c ..\curses.h ..\curspriv.h
  270.     $(CC) $(CFLAGS) -ooverlay ..\overlay.c
  271.  
  272. prntscan.obj:    ..\prntscan.c ..\curses.h ..\curspriv.h
  273.     $(CC) $(CFLAGS) -N -oprntscan ..\prntscan.c
  274.  
  275. refresh.obj:    ..\refresh.c ..\curses.h ..\curspriv.h
  276.     $(CC) $(CFLAGS) -orefresh ..\refresh.c
  277.  
  278. scrreg.obj:    ..\scrreg.c ..\curses.h ..\curspriv.h
  279.     $(CC) $(CFLAGS) -oscrreg ..\scrreg.c
  280.  
  281. setmode.obj:    ..\setmode.c ..\curses.h ..\curspriv.h
  282.     $(CC) $(CFLAGS) -osetmode ..\setmode.c
  283.  
  284. setterm.obj:    ..\setterm.c ..\curses.h ..\curspriv.h
  285.     $(CC) $(CFLAGS) -osetterm ..\setterm.c
  286.  
  287. stradd.obj:    ..\stradd.c ..\curses.h ..\curspriv.h
  288.     $(CC) $(CFLAGS) -ostradd ..\stradd.c
  289.  
  290. strget.obj:    ..\strget.c ..\curses.h ..\curspriv.h
  291.     $(CC) $(CFLAGS) -ostrget ..\strget.c
  292.  
  293. tabsize.obj:    ..\tabsize.c ..\curses.h ..\curspriv.h
  294.     $(CC) $(CFLAGS) -otabsize ..\tabsize.c
  295.  
  296. termmisc.obj:    ..\termmisc.c ..\curses.h ..\curspriv.h
  297.     $(CC) $(CFLAGS) -otermmisc ..\termmisc.c
  298.  
  299. unctrl.obj:    ..\unctrl.c ..\curses.h ..\curspriv.h
  300.     $(CC) $(CFLAGS) -ounctrl ..\unctrl.c
  301.  
  302. update.obj:    ..\update.c ..\curses.h ..\curspriv.h
  303.     $(CC) $(CFLAGS) -oupdate ..\update.c
  304.  
  305. winclear.obj:    ..\winclear.c ..\curses.h ..\curspriv.h
  306.     $(CC) $(CFLAGS) -owinclear ..\winclear.c
  307.  
  308. windel.obj:    ..\windel.c ..\curses.h ..\curspriv.h
  309.     $(CC) $(CFLAGS) -owindel ..\windel.c
  310.  
  311. winerase.obj:    ..\winerase.c ..\curses.h ..\curspriv.h
  312.     $(CC) $(CFLAGS) -owinerase ..\winerase.c
  313.  
  314. winmove.obj:    ..\winmove.c ..\curses.h ..\curspriv.h
  315.     $(CC) $(CFLAGS) -owinmove ..\winmove.c
  316.  
  317. winscrol.obj:    ..\winscrol.c ..\curses.h ..\curspriv.h
  318.     $(CC) $(CFLAGS) -owinscrol ..\winscrol.c
  319.  
  320. wintouch.obj:    ..\wintouch.c ..\curses.h ..\curspriv.h
  321.     $(CC) $(CFLAGS) -owintouch ..\wintouch.c
  322.  
  323. cursesio.obj:    ..\cursesio.asm
  324.     masm ..\cursesio.asm/mx,cursesio.obj,nul,nul;
  325.  
  326. #################################################################
  327. # Perform a backup of the files in the directory where the    #
  328. # 'make backup' command was issued - copies all files to the    #
  329. # floppy in drive A: or B:                    #
  330. #################################################################
  331.  
  332. A_backup:
  333.     @echo ***** Backup of PCcurses *****
  334.     @echo Insert backup diskette in drive A: and hit any key!
  335.     @pause
  336.     @echo Y > yes.txt
  337.     del a:\*.* < yes.txt >NUL
  338.     @del yes.txt
  339.     copy *.* a:
  340.  
  341. B_backup:
  342.     @echo ***** Backup of PCcurses *****
  343.     @echo Insert backup diskette in drive B: and hit any key!
  344.     @pause
  345.     @echo Y > yes.txt
  346.     del b:\*.* < yes.txt >NUL
  347.     @del yes.txt
  348.     copy *.* b:
  349.  
  350. #################################################################
  351. # Remove all temporary files and work directories that were    #
  352. # created                            #
  353. #################################################################
  354.  
  355. clean:
  356.     @echo Y > yes.txt
  357.     del smodel.trc\*.* < yes.txt >NUL
  358.     del cmodel.trc\*.* < yes.txt >NUL
  359.     del mmodel.trc\*.* < yes.txt >NUL
  360.     del lmodel.trc\*.* < yes.txt >NUL
  361.     @del yes.txt
  362.     rmdir smodel.trc
  363.     rmdir cmodel.trc
  364.     rmdir mmodel.trc
  365.     rmdir lmodel.trc
  366.  
  367. #################################################################
  368. # The following is only for the authors installation of his    #
  369. # special libraries.                        #
  370. #################################################################
  371.  
  372. iau:    iheaders isau icau imau ilau iman
  373.  
  374. isau:    small
  375.     cd    smodel.trc
  376.     copy    scurses.lib bltmp.lib
  377.     -attrib    -r $(LIBDIR)\sbllibc.lib
  378.     -attrib    -r $(LIBDIR)\sbllibc.bak
  379.     -lib    $(LIBDIR)\sbllibc.lib @..\bllibc.cmd
  380.     -attrib    +r $(LIBDIR)\sbllibc.lib
  381.     del    bltmp.lib
  382.     cd ..
  383.  
  384. icau:    compact
  385.     cd    cmodel.trc
  386.     copy    ccurses.lib bltmp.lib
  387.     -attrib    -r $(LIBDIR)\cbllibc.lib
  388.     -attrib    -r $(LIBDIR)\cbllibc.bak
  389.     -lib    $(LIBDIR)\cbllibc.lib @..\bllibc.cmd
  390.     -attrib    +r $(LIBDIR)\cbllibc.lib
  391.     del    bltmp.lib
  392.     cd ..
  393.  
  394. imau:    medium
  395.     cd    mmodel.trc
  396.     copy    mcurses.lib bltmp.lib
  397.     -attrib    -r $(LIBDIR)\mbllibc.lib
  398.     -attrib    -r $(LIBDIR)\mbllibc.bak
  399.     -lib    $(LIBDIR)\mbllibc.lib @..\bllibc.cmd
  400.     -attrib    +r $(LIBDIR)\mbllibc.lib
  401.     del    bltmp.lib
  402.     cd ..
  403.  
  404. ilau:    large
  405.     cd    lmodel.trc
  406.     copy    lcurses.lib bltmp.lib
  407.     -attrib    -r $(LIBDIR)\lbllibc.lib
  408.     -attrib    -r $(LIBDIR)\lbllibc.bak
  409.     -lib    $(LIBDIR)\lbllibc.lib @..\bllibc.cmd
  410.     -attrib    +r $(LIBDIR)\lbllibc.lib
  411.     del    bltmp.lib
  412.     cd ..
  413.  
  414. shar:
  415.     command -c makekit -x *.* >manifest
  416.     makekit -m *.*
  417.     del manifest.*
  418.