1# vim: set ft=make :
2# Makefile for VIM on the Amiga, using SAS/Lattice C 6.0 to 6.58
3#
4# Do NOT use the peephole optimizer with a version before 6.56!
5# It messes up all kinds of things:
6# For 6.0 and 6.1, expand_env() will not work correctly.
7# For 6.2 and 6.3 the call to free_line in u_freeentry is wrong.
8# The "read.me" file for version 6.56 includes a remark about a fix for the
9# peephole optimizer.  Everything before 6.56 will probably fail.
10#
11# You should use Manx Aztec C whenever possible, because it has been tested.
12#
13# The prototypes from Manx and SAS are incompatible. If the prototypes
14# were generated by Manx, first do "touch *.c; make proto" before "make".
15# The prototypes generated on Unix work for both.
16#
17# Note: Not all dependencies are included. This was done to avoid having
18#       to compile everything when a global variable or function is added.
19
20#>>>>> choose options:
21
22### See feature.h for a list of optionals.
23### Any other defines can be included here.
24
25# NO_ARP	Don't include ARP functions
26# SASC=658	Sas/C version number
27# NEWSASC	fixes a bug in the syntax highlighting?
28DEFINES = DEF=NO_ARP DEF=NEWSASC DEF="SASC=658"
29
30#>>>>> if HAVE_TGETENT is defined termlib.o has to be used
31#TERMLIB = termlib.o
32TERMLIB =
33
34#>>>>> choose NODEBUG for normal compiling, the other for debugging and
35# profiling
36# don't switch on debugging when generating proto files, it crashes the
37# compiler.
38DBG = NODEBUG
39#DBG = DBG=SF
40
41#>>>>> choose NOOPTPEEP for 6.0 to 6.3, NOOPT for debugging
42# with version 6.56 and later you can probably use OPT
43OPTIMIZE  = OPT
44#OPTIMIZE = NOOPTPEEP
45#OPTIMIZE = NOOPT
46
47# for 6.58 you can use the line below, but be warned it takes a loooonnnggg time
48#OPTIMIZE=OPT  OPTIMIZERSCHEDULER OPTIMIZERTIME NoOPTIMIZERALIAS \
49	OptimizerComplexity=10 OptimizerDepth=10 OptimizerRecurDepth=10 \
50	OptimizerInLocal OPTPEEP
51
52#generate code for your processor - 68060 will work for 040's as well.
53CPU=68000
54#CPU=68020
55#CPU=68030
56#CPU=68040
57#CPU=68060
58
59#Error reporting - rexx or console
60ERROR = ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
61#ERROR = ERRORREXX ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
62
63#memory types, if you have fast use it :->,
64#	ANY = will work on all machines
65#	FAST = this is the best option, for speed
66#MEMORYTYPE=FAST
67MEMORYTYPE=ANY
68
69#MEMSIZE - this is for compile time only for speed of compilation
70#MEMSIZE=HUGE
71MEMSIZE=LARGE
72#MEMSIZE=SMALL
73
74#>>>>> end of choices
75###########################################################################
76
77CC	= sc
78GST	= vim.gst
79COPTS	= SINT SCODE SDATA
80SHELL	= csh
81DEL	= $(SHELL) -c rm -f
82
83# ignore error messages for uninitialized variables, they are mostly not correct
84CFLAGS  = NOLINK $(DBG) CPU=$(CPU) NOSTACKCHECK DEF=AMIGA CODE=FAR idir=proto ignore=317
85CFLAGS2 = $(OPTIMIZE) $(ERROR) GSTIMMEDIATE GST=$(GST)
86CFLAGS3 = $(COPTS) STRINGMERGE MEMSIZE=$(MEMSIZE)
87CFLAGS4 = $(DEFINES) DATAMEMORY=$(MEMORYTYPE)
88
89PROPT = DEF=PROTO GPROTO GPPARM MAXIMUMERRORS=999 GENPROTOSTATICS GENPROTOPARAMETERS
90
91SRC = \
92	blowfish.c \
93	buffer.c \
94	charset.c \
95	diff.c \
96	digraph.c \
97	edit.c \
98	eval.c \
99	ex_cmds.c \
100	ex_cmds2.c \
101	ex_docmd.c \
102	ex_eval.c \
103	ex_getln.c \
104	fileio.c \
105	fold.c \
106	getchar.c \
107	hardcopy.c \
108	hashtab.c \
109	main.c \
110	mark.c \
111	memfile.c \
112	memline.c \
113	menu.c \
114	message.c \
115	misc1.c \
116	misc2.c \
117	move.c \
118	mbyte.c \
119	normal.c \
120	ops.c \
121	option.c \
122	os_amiga.c \
123	popupmnu.c \
124	quickfix.c \
125	regexp.c \
126	screen.c \
127	search.c \
128	sha256.c \
129	spell.c \
130	syntax.c \
131	tag.c \
132	term.c \
133	ui.c \
134	undo.c \
135	window.c \
136	version.c
137
138OBJ = \
139	blowfish.o \
140	buffer.o \
141	charset.o \
142	diff.o \
143	digraph.o \
144	edit.o \
145	eval.o \
146	ex_cmds.o \
147	ex_cmds2.o \
148	ex_docmd.o \
149	ex_eval.o \
150	ex_getln.o \
151	fileio.o \
152	fold.o \
153	getchar.o \
154	hardcopy.o \
155	hashtab.o \
156	main.o \
157	mark.o \
158	memfile.o \
159	memline.o \
160	menu.o \
161	message.o \
162	misc1.o \
163	misc2.o \
164	move.o \
165	mbyte.o \
166	normal.o \
167	ops.o \
168	option.o \
169	os_amiga.o \
170	popupmnu.o \
171	quickfix.o \
172	regexp.o \
173	screen.o \
174	search.o \
175	sha256.o \
176	spell.o \
177	syntax.o \
178	tag.o \
179	term.o \
180	ui.o \
181	undo.o \
182	window.o \
183	$(TERMLIB)
184
185PRO = \
186	proto/blowfish.pro \
187	proto/buffer.pro \
188	proto/charset.pro \
189	proto/diff.pro \
190	proto/digraph.pro \
191	proto/edit.pro \
192	proto/eval.pro \
193	proto/ex_cmds.pro \
194	proto/ex_cmds2.pro \
195	proto/ex_docmd.pro \
196	proto/ex_eval.pro \
197	proto/ex_getln.pro \
198	proto/fileio.pro \
199	proto/fold.pro \
200	proto/getchar.pro \
201	proto/hardcopy.pro \
202	proto/hashtab.pro \
203	proto/main.pro \
204	proto/mark.pro \
205	proto/memfile.pro \
206	proto/memline.pro \
207	proto/menu.pro \
208	proto/message.pro \
209	proto/misc1.pro \
210	proto/misc2.pro \
211	proto/move.pro \
212	proto/mbyte.pro \
213	proto/normal.pro \
214	proto/ops.pro \
215	proto/option.pro \
216	proto/os_amiga.pro \
217	proto/popupmnu.pro \
218	proto/quickfix.pro \
219	proto/regexp.pro \
220	proto/screen.pro \
221	proto/search.pro \
222	proto/sha256.pro \
223	proto/spell.pro \
224	proto/syntax.pro \
225	proto/tag.pro \
226	proto/term.pro \
227	proto/termlib.pro \
228	proto/ui.pro \
229	proto/undo.pro \
230	proto/window.pro
231
232all: proto Vim
233
234Vim: scoptions $(OBJ) version.c version.h
235	$(CC) $(CFLAGS) version.c
236	$(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
237
238debug: scoptions $(OBJ) version.c version.h
239	$(CC) $(CFLAGS) version.c
240	$(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
241
242proto: $(GST) $(PRO)
243
244tags:
245	spat ctags $(SRC) *.h
246#	csh -c ctags $(SRC) *.h
247
248# can't use delete here, too many file names
249clean:
250	$(DEL) *.o Vim $(GST)
251
252# generate GlobalSymbolTable, which speeds up the compile time.
253#
254# A preprocessing stage is used to work arounda bug in the GST generator, in
255# that it does not handle nested makefiles properly in this stage.
256# Ignore error message for not producing any code (105).
257$(GST): scoptions vim.h keymap.h macros.h ascii.h term.h structs.h
258	$(CC) $(CFLAGS) PREPROCESSORONLY vim.h objectname pre.h
259	$(CC) MGST=$(GST) pre.h ignore=105
260	$(DEL) pre.h
261
262# generate an options file, because SAS/C smake can't handle the amiga command
263# line can handle the lengths that this makefile will impose on the shell.
264# (Manx's make can do this).
265scoptions: Make_sas.mak
266	@echo "Generating - $@ ..."
267	@echo $(CFLAGS) > scoptions
268	@echo $(CFLAGS1) >> scoptions
269	@echo $(CFLAGS2) >> scoptions
270	@echo $(CFLAGS3) >> scoptions
271	@echo $(CFLAGS4) >> scoptions
272	@echo $(COPTS) >>scoptions
273	@echo done
274
275###########################################################################
276
277$(OBJ): $(GST) vim.h
278$(PRO): $(GST) vim.h
279
280.c.o:
281	$(CC) $(CFLAGS) $*.c
282
283.c.pro:
284	$(CC) $(CFLAGS) GPFILE=proto/$*.pro $(PROPT) $*.c
285
286# dependancies
287blowfish.o:		blowfish.c
288proto/blowfish.pro:	blowfish.c
289buffer.o:		buffer.c
290proto/buffer.pro:	buffer.c
291charset.o:		charset.c
292proto/charset.pro:	charset.c
293diff.o:			diff.c
294proto/diff.pro:		diff.c
295digraph.o:		digraph.c
296proto/digraph.pro:	digraph.c
297edit.o:			edit.c
298proto/edit.pro:		edit.c
299eval.o:			eval.c
300proto/eval.pro:		eval.c
301ex_cmds.o:		ex_cmds.c
302proto/ex_cmds.pro:	ex_cmds.c
303ex_cmds2.o:		ex_cmds2.c
304proto/ex_cmds2.pro:	ex_cmds2.c
305ex_docmd.o:		ex_docmd.c ex_cmds.h
306proto/ex_docmd.pro:	ex_docmd.c ex_cmds.h
307ex_eval.o:		ex_eval.c ex_cmds.h
308proto/ex_eval.pro:	ex_eval.c ex_cmds.h
309ex_getln.o:		ex_getln.c
310proto/ex_getln.pro:	ex_getln.c
311fileio.o:		fileio.c
312proto/fileio.pro:	fileio.c
313fold.o:			fold.c
314proto/fold.pro:		fold.c
315getchar.o:		getchar.c
316proto/getchar.pro:	getchar.c
317hardcopy.o:		hardcopy.c
318proto/hardcopy.pro:	hardcopy.c
319hashtab.o:		hashtab.c
320proto/hashtab.pro:	hashtab.c
321main.o:			main.c
322proto/main.pro:		main.c
323mark.o:			mark.c
324proto/mark.pro:		mark.c
325memfile.o:		memfile.c
326proto/memfile.pro:	memfile.c
327memline.o:		memline.c
328proto/memline.pro:	memline.c
329menu.o:			menu.c
330proto/menu.pro:		menu.c
331message.o:		message.c
332proto/message.pro:	message.c
333misc1.o:		misc1.c
334proto/misc1.pro:	misc1.c
335misc2.o:		misc2.c
336proto/misc2.pro:	misc2.c
337move.o:			move.c
338proto/move.pro:		move.c
339mbyte.o:		mbyte.c
340proto/mbyte.pro:	mbyte.c
341normal.o:		normal.c
342proto/normal.pro:	normal.c
343ops.o:			ops.c
344proto/ops.pro:		ops.c
345option.o:		option.c
346proto/option.pro:	option.c
347os_amiga.o:		os_amiga.c
348proto/os_amiga.pro:	os_amiga.c
349popupmnu.o:		popupmnu.c
350proto/popupmnu.pro:	popupmnu.c
351quickfix.o:		quickfix.c
352proto/quickfix.pro:	quickfix.c
353regexp.o:		regexp.c
354proto/regexp.pro:	regexp.c
355screen.o:		screen.c
356proto/screen.pro:	screen.c
357search.o:		search.c
358proto/search.pro:	search.c
359sha256.o:		sha256.c
360proto/sha256.pro:	sha256.c
361spell.o:		spell.c
362proto/spell.pro:	spell.c
363syntax.o:		syntax.c
364proto/syntax.pro:	syntax.c
365tag.o:			tag.c
366proto/tag.pro:		tag.c
367term.o:			term.c
368proto/term.pro:		term.c
369termlib.o:		termlib.c
370proto/termlib.pro:	termlib.c
371ui.o:			ui.c
372proto/ui.pro:		ui.c
373undo.o:			undo.c
374proto/undo.pro:		undo.c
375window.o:		window.c
376