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.msc < prev    next >
Makefile  |  1996-09-28  |  6KB  |  214 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 Microsoft C version 8.0 (Visual C)
  9. # should also work with earlier versions
  10. #
  11. # - supported targets:
  12. #   + jjove.exe (build JOVE, but don't install it)
  13. #   + jovedosx.zoo (build executable JOVE kit for DOS)
  14. #   + jovedosx.zip (build executable JOVE kit for DOS)
  15. #   + jovew32x.zoo (build executable JOVE kit for Win32)
  16. #   + jovew32x.zip (build executable JOVE kit for Win32)
  17. #   + clean
  18. #
  19. # - to install, do the following:
  20. #   + copy jjove.exe where you wish
  21. #   + copy doc/cmds.doc to <SHAREDIR>/cmds.doc
  22. #   + optional: copy some jove rc (none supplied) file to <SHAREDIR>/jove.rc
  23.  
  24. # Options (specify on MAKE command line with -D)
  25. # DEBUG=1 : enable debugging, disable optimizations
  26. # ARCH=0|2|3 : compile for 086/286/386 (-G option). Still 16-bit though.
  27.  
  28. !if "$(DEBUG)" != ""
  29. DEB = -Gs -Od -Zi -DDEBUG
  30. !else
  31. DEB = -Ox -D_NDEBUG
  32. DEBLDFLAGS=
  33. !endif
  34.  
  35. !IF "$(WIN32)" != ""
  36. SYSCFLAGS =    -DWIN32
  37. SYSLDFLAGS    =    /SUBSYSTEM:Console
  38. SYSOBJS        =    win32.obj
  39. LIBS        = /DEFAULTLIB:USER32 /DEFAULTLIB:KERNEL32 /DEFAULTLIB:COMDLG32
  40. OS    =    W32
  41. !if "$(DEBUG)" != ""
  42. DEBLDFLAGS= /DEBUG
  43. !else
  44. DEBLDFLAGS=
  45. !endif
  46.  
  47. !ELSE # Not WIN32 - 16-bit DOS
  48.  
  49. !IF "$(ARCH)" == ""
  50. ARCH    =    0        # Default to 8086
  51. !ENDIF
  52.  
  53. OS    =    DOS
  54. MEM = L                # M for medium or L for large
  55.  
  56. SYSCFLAGS = -A$(MEM) -J -Zp -G$(ARCH)
  57. SYSLDFLAGS    =    /PACKC/NOE/NOI/MAP/E/STACK:0x2000
  58. SYSOBJS        =    msgetch.obj ibmpcdos.obj
  59. !if "$(DEBUG)" != ""
  60. DEBLDFLAGS=/CO/F/B
  61. !endif
  62. !ENDIF # WIN32
  63.  
  64. !IF "$(BROWSE)" != ""
  65. BROWSE_FLG = -FR
  66. BROWSE_TGT = jjove.bsc
  67. !ENDIF
  68.  
  69. CFLAGS = $(SYSCFLAGS) $(BROWSE_FLG) -nologo $(DEB)
  70.  
  71. #
  72. # linker flags: for debugging use /NOE/NOI/F/B/PAC/CO/STACK:0x2000
  73. #
  74.  
  75. LDFLAGS = $(SYSLDFLAGS) $(DEBLDFLAGS)
  76. #
  77. # set VPATH as below if you have sources in SRC
  78. #
  79. SRC = .
  80. # VPATH = .;..    # should read .;$(SRC) - but doesn't work
  81.  
  82. # Other utilities used in build - defined here so they can be overridden
  83. # Used to unpack binary sources. May not be needed if unpacked
  84. # aready on a Unix archive.
  85. UUDECODE    =    uudecode
  86. # Used to generate archives for redistributing JOVE executables and docs.
  87. ZOO            =    zoo
  88. ZIP            =    pkzip
  89.  
  90. TMPDIR = c:/tmp
  91. RECDIR = c:/tmp
  92. LIBDIR = c:/jove
  93. SHAREDIR = $(LIBDIR)
  94. # BINDIR = c:/jove
  95. DFLTSHELL = command
  96.  
  97. OBJECTS = keys.obj commands.obj abbrev.obj ask.obj buf.obj c.obj \
  98.     case.obj jctype.obj delete.obj extend.obj argcount.obj \
  99.     insert.obj io.obj jove.obj macros.obj marks.obj misc.obj mouse.obj move.obj \
  100.     paragraph.obj proc.obj re.obj reapp.obj scandir.obj \
  101.     list.obj keymaps.obj util.obj vars.obj wind.obj \
  102.     fmt.obj disp.obj term.obj fp.obj screen.obj \
  103.     $(SYSOBJS)
  104.  
  105. HEADERS = abbrev.h argcount.h ask.h buf.h c.h case.h chars.h commands.h \
  106.     jctype.h dataobj.h delete.h disp.h extend.h externs.h \
  107.     fmt.h fp.h insert.h io.h iproc.h jove.h \
  108.     keymaps.h list.h mac.h macros.h marks.h \
  109.     misc.h mouse.h move.h paragraph.h proc.h \
  110.     re.h reapp.h rec.h scandir.h screen.h \
  111.     sysdep.h sysprocs.h temp.h term.h ttystate.h \
  112.     tune.h util.h vars.h version.h wind.h
  113.  
  114. !IF "$(WIN32)" != ""
  115. RESOURCE    =    jjove.res
  116. !ENDIF
  117.  
  118. all: jjove.exe $(BROWSE_TGT)
  119.  
  120. jjove.exe:    $(OBJECTS) $(HEADERS) $(RESOURCE)
  121. !IF "$(WIN32)" != ""
  122.     link  /OUT:jjove.exe /MAP $(LIBS) @<<jove.lnk $(LDFLAGS)
  123. $(OBJECTS: = ^
  124. )
  125. setargv.obj
  126. $(RESOURCE)
  127. <<KEEP
  128. !ELSE
  129.     link  @<<jove.lnk $(LDFLAGS)
  130. $(OBJECTS: = +^
  131. ) +
  132. setargv.obj
  133. jjove.exe
  134.  
  135. <<KEEP
  136. !ENDIF
  137.  
  138. # Jove users note: don't confuse jjove.rc with jove.rc, which
  139. # is the Jove setup script.
  140. jjove.res:    jjove.rc jjove.ico resource.h
  141.     $(RC) $(RCDEFINES) -r jjove.rc
  142.  
  143. jjove.bsc: $(OBJECTS:.obj=.sbr)
  144.     bscmake @<<
  145. /o $@ $(OBJECTS:.obj=.sbr)
  146. <<
  147.  
  148. jove.obj:    paths.h
  149. vars.obj:    vars.tab
  150. commands.obj:    commands.tab
  151. setmaps.obj:    vars.tab commands.tab
  152.  
  153. # Compensate for 8.3 naming (or lack thereof)
  154. !IF "$(WIN32)" == ""
  155. paragraph.h:
  156.     if exist paragr~1.h rename paragr~1.h paragraph.h
  157. paragraph.c:
  158.     if exist paragr~1.c rename paragr~1.c paragraph.c
  159. !ELSE
  160. paragraph.h:
  161.     if exist paragrap.h rename paragrap.h paragraph.h
  162. paragraph.c:
  163.     if exist paragrap.c rename paragrap.c paragraph.c
  164. !ENDIF
  165.  
  166. jove$(OS)x.zoo:    paths.h jjove.exe
  167.     -del jove$(OS)x.zoo
  168.     -del jove.exe
  169.     rename jjove.exe jove.exe
  170.     $(ZOO) -add jove$(OS)x.zoo jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.$(OS)
  171.  
  172. jove$(OS)x.zip:    paths.h jjove.exe
  173.     -del jove$(OS)x.zip
  174.     -del jove.exe
  175.     rename jjove.exe jove.exe
  176.     $(ZIP) -aP jove$(OS)x.zip jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.$(OS)
  177.  
  178. paths.h: makefile.msc
  179.     @echo Making <<paths.h
  180. /* Changes should be made in Makefile, not to this file! */
  181.  
  182. #define TMPDIR "$(TMPDIR)"
  183. #define RECDIR "$(RECDIR)"
  184. #define LIBDIR "$(LIBDIR)"
  185. #define SHAREDIR "$(SHAREDIR)"
  186. #define DFLTSHELL "$(DFLTSHELL)"
  187. <<KEEP
  188.  
  189. # The Jove icon target should be part of the distributed ZOO file, but
  190. # if not this rule will build it.
  191. jjove.ico:    jjoveico.uue
  192.     $(UUDECODE) $**
  193.  
  194. !IFNDEF WIN32
  195. ibmpcdos.obj:    ibmpcdos.c jove.h
  196.     $(CC) $(CFLAGS) -I$(SRC) -NTscreen_text -c ibmpcdos.c
  197. !ENDIF
  198.  
  199. $(OBJECTS): $(HEADERS)
  200.  
  201. setmaps.exe:    setmaps.obj
  202.     cl /F 6000 setmaps.obj
  203.  
  204. setmaps.obj:    commands.tab vars.tab keys.txt setmaps.c
  205.  
  206. keys.c:    setmaps.exe keys.txt
  207.     setmaps < keys.txt > keys.c
  208.  
  209. keys.obj:    keys.c jove.h
  210.     $(CC) $(CFLAGS) -I$(SRC) -c keys.c
  211.  
  212. clean:
  213.     -rm *.obj setmaps.exe keys.c *.bak *.map *.pdb *.vcp jove.lnk
  214.