File: Makefile.bcc

package info (click to toggle)
jove 4.16.0.73-5
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,024 kB
  • sloc: ansic: 27,589; makefile: 454; sh: 49
file content (178 lines) | stat: -rw-r--r-- 5,622 bytes parent folder | download | duplicates (9)
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
##########################################################################
# 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 Borland C/C++ 3.1
#
# - supported targets:
#   + jjove.exe (build JOVE, but don't install it)
#   + jovedosx.zoo (build executable JOVE kit)
#   + jovedosx.zip (build executable JOVE kit)
#   + clean
#
# - to install, do the following:
#   + copy jjove.exe where you wish
#   + copy doc/cmds.doc to <SHAREDIR>/cmds.doc
#   + optional: copy some jove rc (none supplied) file to <SHAREDIR>/jove.rc

# ===================================================================
# Jove configuration: default JOVE paths.
# Note that all these can be set from environment variables as well;
# see README.DOS for details.
#
# TMPDIR is where the tmp files get stored, usually /tmp or /usr/tmp.
# RECDIR is the directory in which RECOVER looks for JOVE's tempfiles.
# LIBDIR is for the PORTSRV and RECOVER programs.
# SHAREDIR is for online documentation, and the system-wide jove.rc file.
## BINDIR is where to put the executables JOVE and TEACHJOVE.
# DFLTSHELL is the default shell invoked by JOVE and TEACHJOVE.

TMPDIR = c:/tmp
RECDIR = c:/tmp
LIBDIR = c:/jove
SHAREDIR = $(LIBDIR)
# BINDIR = c:/jove
DFLTSHELL = command

# Compiler:

CC = bcc

# Compiler options
#
# Memory model: 'm' for medium or 'l' for large
# MEM = -ml

# Medium-model:
#   Uses a smaller buffer cache (3K vs 64K in large model), but can
#   still use (up to) all available memory for editing.  If you have
#   a disk cache (e.g. smartdrv) running, you probably won't notice.
#   The medium model saves about 30K in size of jove.exe
MEM = -mm

# No floating point
FP = -f-

# Use 386 instructions
# CPU = -3

# Optimizations: -Ox is untested
# -Ox : fastest
# -O1 : smallest
# -Od : none at all
OPT = -O1

# Suppress warnings about functions defined first but
# not prototyped (pro) & structures declared but undefined (stu).
# There are still a few unused variable warnings.
WARN = -w-pro -w-stu

# Debugging options:
# -v : source level debugging
# -N : compile in stack checking
DEB =

CFLAGS = $(MEM) $(FP) $(CPU) $(OPT) $(WARN) $(DEB) $(SYSDEFS)

# Linker:

LD = $(CC)

# Flags peculiar to link step.  Use '-l' to $(CC) to specify
# a flag that is passed to the linker
# m : create map file
# LINKFLAGS = -lm
LINKFLAGS =

LDFLAGS = $(CFLAGS) $(LINKFLAGS)

# ===================================================================
# Don't rely on Borland make's builtin rules

.SUFFIXES .exe .obj .c

.c.obj:
	$(CC) $(CFLAGS) -c $<

.obj.exe:
	$(LD) $(LDFLAGS) $<

# Location of BCC libraries (needed to find wildargs.obj)
# for BC/C++ v3.1:
BCCLIB = c:/borlandc/lib
# for BC/C++ v4.0:
#BCCLIB = c:/borlandc/lib/16bit

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 \
	paragrap.obj proc.obj re.obj reapp.obj scandir.obj list.obj \
	keymaps.obj util.obj vars.obj wind.obj fmt.obj disp.obj term.obj \
	fp.obj screen.obj msgetch.obj ibmpcdos.obj

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 loadavg.h mac.h macros.h marks.h \
	misc.h mouse.h move.h paragraph.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

# This is what we really want to use, but Borland's make complains
# when a target appears in more than one rule.  So, as it stands,
# changing a header will *not* force recompilation :-(
#
# $(OBJECTS):	$(HEADERS)
#
# For this reason, we can only force the building of paths.h
# by adding it to the dependencies for explicit targets.
# In the hope that it is built soon enough, we put it at the front.

jjove.exe:	paths.h $(OBJECTS)
	$(LD) $(LDFLAGS) -e$* @&&!
$(BCCLIB)/wildargs.obj $(OBJECTS)
!

jovedosx.zoo:	paths.h jjove.exe
	-del jovedosx.zoo
	-del jove.exe
	rename jjove.exe jove.exe
	zoo -add jovedosx.zoo jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.dos

jovedosx.zip:	paths.h jjove.exe
	-del jovedosx.zip
	-del jove.exe
	rename jjove.exe jove.exe
	pkzip -aP jovedosx.zip jove.exe doc\cmds.doc doc\jove.man doc\jove.doc paths.h README.dos

# Note that quotes are not stripped by the shell that will
# execute the recipe for paths.h
# The truly bizarre quoting is necessary to quote the pound
# character and the double quotes for Borland make (v3.6).
# This 'feature' is undocumented and fragile.  Use at your own risk!

paths.h:	makefile.bcc
	echo "/* Changes should be made in Makefile, not to this file! */" > paths.h
	echo "#"define TMPDIR    '"$(TMPDIR)"'    >> paths.h
	echo "#"define RECDIR    '"$(RECDIR)"'    >> paths.h
	echo "#"define LIBDIR    '"$(LIBDIR)"'    >> paths.h
	echo "#"define SHAREDIR  '"$(SHAREDIR)"'  >> paths.h
	echo "#"define DFLTSHELL '"$(DFLTSHELL)"' >> paths.h

setmaps.exe:	commands.tab keys.txt setmaps.c
	$(CC) $(CFLAGS) setmaps.c

keys.c:	setmaps.exe keys.txt
	setmaps < keys.txt > keys.c

clean:
	-del *.obj
	-del *.exe
	-del *.bak
	-del *.map
	-del keys.c
	-rename paths.h paths.old	# don't delete (a possibly hand-built) paths.h