home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / jove-4.16-src.tgz / tar.out / bsd / jove / Makefile.bcc < prev    next >
Makefile  |  1996-09-28  |  6KB  |  179 lines

  1. ########################################################################
  2. # This program is Copyright (C) 1986-1996 by Jonathan Payne.  JOVE is  #
  3. # provided to you without charge, and with no warranty.  You may give  #
  4. # away copies of JOVE, including sources, provided that this notice is #
  5. # included in all the files.                                           #
  6. ########################################################################
  7.  
  8. # Makefile for Borland C/C++ 3.1
  9. #
  10. # - supported targets:
  11. #   + jjove.exe (build JOVE, but don't install it)
  12. #   + jovedosx.zoo (build executable JOVE kit)
  13. #   + jovedosx.zip (build executable JOVE kit)
  14. #   + clean
  15. #
  16. # - to install, do the following:
  17. #   + copy jjove.exe where you wish
  18. #   + copy doc/cmds.doc to <SHAREDIR>/cmds.doc
  19. #   + optional: copy some jove rc (none supplied) file to <SHAREDIR>/jove.rc
  20.  
  21. # ===================================================================
  22. # Jove configuration: default JOVE paths.
  23. # Note that all these can be set from environment variables as well;
  24. # see README.DOS for details.
  25. #
  26. # TMPDIR is where the tmp files get stored, usually /tmp or /usr/tmp.
  27. # RECDIR is the directory in which RECOVER looks for JOVE's tempfiles.
  28. # LIBDIR is for the PORTSRV and RECOVER programs.
  29. # SHAREDIR is for online documentation, and the system-wide jove.rc file.
  30. ## BINDIR is where to put the executables JOVE and TEACHJOVE.
  31. # DFLTSHELL is the default shell invoked by JOVE and TEACHJOVE.
  32.  
  33. TMPDIR = c:/tmp
  34. RECDIR = c:/tmp
  35. LIBDIR = c:/jove
  36. SHAREDIR = $(LIBDIR)
  37. # BINDIR = c:/jove
  38. DFLTSHELL = command
  39.  
  40. # Compiler:
  41.  
  42. CC = bcc
  43.  
  44. # Compiler options
  45. #
  46. # Memory model: 'm' for medium or 'l' for large
  47. # MEM = -ml
  48.  
  49. # Medium-model:
  50. #   Uses a smaller buffer cache (3K vs 64K in large model), but can
  51. #   still use (up to) all available memory for editing.  If you have
  52. #   a disk cache (e.g. smartdrv) running, you probably won't notice.
  53. #   The medium model saves about 30K in size of jove.exe
  54. MEM = -mm
  55.  
  56. # No floating point
  57. FP = -f-
  58.  
  59. # Use 386 instructions
  60. # CPU = -3
  61.  
  62. # Optimizations: -Ox is untested
  63. # -Ox : fastest
  64. # -O1 : smallest
  65. # -Od : none at all
  66. OPT = -O1
  67.  
  68. # Suppress warnings about functions defined first but
  69. # not prototyped (pro) & structures declared but undefined (stu).
  70. # There are still a few unused variable warnings.
  71. WARN = -w-pro -w-stu
  72.  
  73. # Debugging options:
  74. # -v : source level debugging
  75. # -N : compile in stack checking
  76. DEB =
  77.  
  78. CFLAGS = $(MEM) $(FP) $(CPU) $(OPT) $(WARN) $(DEB) $(SYSDEFS)
  79.  
  80. # Linker:
  81.  
  82. LD = $(CC)
  83.  
  84. # Flags peculiar to link step.  Use '-l' to $(CC) to specify
  85. # a flag that is passed to the linker
  86. # m : create map file
  87. # LINKFLAGS = -lm
  88. LINKFLAGS =
  89.  
  90. LDFLAGS = $(CFLAGS) $(LINKFLAGS)
  91.  
  92. # ===================================================================
  93. # Don't rely on Borland make's builtin rules
  94.  
  95. .SUFFIXES .exe .obj .c
  96.  
  97. .c.obj:
  98.     $(CC) $(CFLAGS) -c $<
  99.  
  100. .obj.exe:
  101.     $(LD) $(LDFLAGS) $<
  102.  
  103. # Location of BCC libraries (needed to find wildargs.obj)
  104. # for BC/C++ v3.1:
  105. BCCLIB = c:/borlandc/lib
  106. # for BC/C++ v4.0:
  107. #BCCLIB = c:/borlandc/lib/16bit
  108.  
  109. OBJECTS = keys.obj commands.obj abbrev.obj ask.obj buf.obj c.obj \
  110.     case.obj jctype.obj delete.obj extend.obj argcount.obj insert.obj \
  111.     io.obj jove.obj macros.obj marks.obj misc.obj mouse.obj move.obj \
  112.     paragrap.obj proc.obj re.obj reapp.obj scandir.obj list.obj \
  113.     keymaps.obj util.obj vars.obj wind.obj fmt.obj disp.obj term.obj \
  114.     fp.obj screen.obj msgetch.obj ibmpcdos.obj
  115.  
  116. HEADERS = abbrev.h argcount.h ask.h buf.h c.h case.h chars.h commands.h \
  117.     jctype.h dataobj.h delete.h disp.h extend.h externs.h \
  118.     fmt.h fp.h insert.h io.h iproc.h jove.h \
  119.     keymaps.h list.h loadavg.h mac.h macros.h marks.h \
  120.     misc.h mouse.h move.h paragraph.h proc.h \
  121.     re.h reapp.h rec.h scandir.h screen.h \
  122.     sysdep.h sysprocs.h temp.h term.h ttystate.h \
  123.     tune.h util.h vars.h version.h wind.h
  124.  
  125. # This is what we really want to use, but Borland's make complains
  126. # when a target appears in more than one rule.  So, as it stands,
  127. # changing a header will *not* force recompilation :-(
  128. #
  129. # $(OBJECTS):    $(HEADERS)
  130. #
  131. # For this reason, we can only force the building of paths.h
  132. # by adding it to the dependencies for explicit targets.
  133. # In the hope that it is built soon enough, we put it at the front.
  134.  
  135. jjove.exe:    paths.h $(OBJECTS)
  136.     $(LD) $(LDFLAGS) -e$* @&&!
  137. $(BCCLIB)/wildargs.obj $(OBJECTS)
  138. !
  139.  
  140. jovedosx.zoo:    paths.h jjove.exe
  141.     -del jovedosx.zoo
  142.     -del jove.exe
  143.     rename jjove.exe jove.exe
  144.     zoo -add jovedosx.zoo jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.dos
  145.  
  146. jovedosx.zip:    paths.h jjove.exe
  147.     -del jovedosx.zip
  148.     -del jove.exe
  149.     rename jjove.exe jove.exe
  150.     pkzip -aP jovedosx.zip jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.dos
  151.  
  152. # Note that quotes are not stripped by the shell that will
  153. # execute the recipe for paths.h
  154. # The truly bizarre quoting is necessary to quote the pound
  155. # character and the double quotes for Borland make (v3.6).
  156. # This 'feature' is undocumented and fragile.  Use at your own risk!
  157.  
  158. paths.h:    makefile.bcc
  159.     echo "/* Changes should be made in Makefile, not to this file! */" > paths.h
  160.     echo "#"define TMPDIR    '"$(TMPDIR)"'    >> paths.h
  161.     echo "#"define RECDIR    '"$(RECDIR)"'    >> paths.h
  162.     echo "#"define LIBDIR    '"$(LIBDIR)"'    >> paths.h
  163.     echo "#"define SHAREDIR  '"$(SHAREDIR)"'  >> paths.h
  164.     echo "#"define DFLTSHELL '"$(DFLTSHELL)"' >> paths.h
  165.  
  166. setmaps.exe:    commands.tab keys.txt setmaps.c
  167.     $(CC) $(CFLAGS) setmaps.c
  168.  
  169. keys.c:    setmaps.exe keys.txt
  170.     setmaps < keys.txt > keys.c
  171.  
  172. clean:
  173.     -del *.obj
  174.     -del *.exe
  175.     -del *.bak
  176.     -del *.map
  177.     -del keys.c
  178.     -rename paths.h paths.old    # don't delete (a possibly hand-built) paths.h
  179.