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