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