1#
2# VMS makefile for vile.  Requires "MMS"
3#
4# To change screen driver modules, change SCREEN and SCRDEF below, OR edit
5# estruct.h to make sure the correct one is #defined as "1", and the others
6# all as "0".
7#
8# $Id: descrip.mms,v 1.51 2009/02/06 00:50:28 tom Exp $
9
10# Editor Configuration Note
11# -------------------------
12# If you elect to build both vile and xvile from the same source
13# directory, be sure to execute this command prior to each build:
14#
15#   $ mms clean
16#
17
18.IFDEF __XMVILE__
19
20# for building the Motif version (untested):
21SCREEN = x11
22TARGET = xvile.exe
23SCRDEF = "MOTIF_WIDGETS","XTOOLKIT","DISP_X11","scrn_chosen"
24MENUS  = menu.obj,x11menu.obj,
25
26.ELSE
27.IFDEF __XVILE__
28
29# for building the X-toolkit version:
30SCREEN = x11
31TARGET = xvile.exe
32SCRDEF = "NO_WIDGETS","XTOOLKIT","DISP_X11","scrn_chosen"
33MENUS  =
34
35.ELSE
36
37# for regular vile, use these:
38SCREEN = vmsvt
39TARGET = vile.exe
40SCRDEF = "DISP_VMSVT","scrn_chosen"
41MENUS  =
42
43.ENDIF # __XVILE__
44.ENDIF # __XMVILE__
45
46# can also use /Debug
47LINKFLAGS = /MAP=$(MMS$TARGET_NAME)/CROSS_REFERENCE/EXEC=$(MMS$TARGET_NAME).EXE
48
49INCS = []
50
51MKTBLS = mktbls.EXE
52
53
54SRC =	main.c \
55	$(SCREEN).c \
56	basic.c \
57	bind.c \
58	blist.c \
59	btree.c \
60	buffer.c \
61	csrch.c \
62	display.c \
63	dumbterm.c \
64	eval.c \
65	exec.c \
66	externs.c \
67	fences.c \
68	file.c \
69	filec.c \
70	fileio.c \
71	finderr.c \
72	glob.c \
73	globals.c \
74	history.c \
75	input.c \
76	insert.c \
77	isearch.c \
78	itbuff.c \
79	line.c \
80	map.c \
81	menu.c \
82	modes.c \
83	msgs.c \
84	npopen.c \
85	nullterm.c \
86	oneliner.c \
87	opers.c \
88	path.c \
89	random.c \
90	regexp.c \
91	region.c \
92	search.c \
93	select.c \
94	spawn.c \
95	statevar.c \
96	tags.c \
97	tbuff.c \
98	termio.c \
99	ucrypt.c \
100	undo.c \
101	version.c \
102	vl_ctype.c \
103	vms2unix.c \
104	vmspipe.c \
105	watch.c \
106	window.c \
107	word.c \
108	wordmov.c
109
110OBJ =	$(MENUS)main.obj,\
111	$(SCREEN).obj,\
112	basic.obj,\
113	bind.obj,\
114	blist.obj,\
115	btree.obj,\
116	buffer.obj,\
117	csrch.obj,\
118	display.obj,\
119	dumbterm.obj,\
120	eval.obj,\
121	exec.obj,\
122	externs.obj,\
123	fences.obj,\
124	file.obj,\
125	filec.obj,\
126	fileio.obj,\
127	finderr.obj,\
128	glob.obj, \
129	globals.obj,\
130	history.obj,\
131	input.obj,\
132	insert.obj,\
133	isearch.obj,\
134	itbuff.obj,\
135	line.obj,\
136	map.obj, \
137	modes.obj,\
138	msgs.obj,\
139	npopen.obj,\
140	nullterm.obj,\
141	oneliner.obj,\
142	opers.obj,\
143	path.obj,\
144	random.obj,\
145	regexp.obj,\
146	region.obj,\
147	search.obj,\
148	select.obj,\
149	spawn.obj,\
150	statevar.obj,\
151	tags.obj,\
152	tbuff.obj,\
153	termio.obj,\
154	ucrypt.obj,\
155	undo.obj,\
156	version.obj, \
157	vl_ctype.obj, \
158	vms2unix.obj,\
159	vmspipe.obj,\
160	watch.obj,\
161	window.obj,\
162	word.obj,\
163	wordmov.obj
164
165all :
166
167	$(MMS)$(MMSQUALIFIERS) $(TARGET)
168
169#
170# I've built on an Alpha with CC_OPTIONS set to
171#	CC_OPTIONS = /STANDARD=VAXC		(for VAX-C compatibility)
172#	CC_OPTIONS = /PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES	(DEC-C)
173# The latter (DEC-C) gives better type-checking -- T.Dickey
174#
175# But on a VAX, the DEC-C compiler and/or its run-time library cause
176# vile to change the "Revised time" of every file the editor _reads_.
177# You won't like this when using mms or a make clone.  The VAXC
178# compiler does not suffer from this problem.
179#
180# Configuration where problem was observed:
181#	DEC C V5.6-003 on OpenVMS VAX V7.1
182#                                                    --C. Morgan
183#
184.IFDEF __IA64__
185CC_OPTIONS = /PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
186CC_DEFS = ,HAVE_ALARM,HAVE_STRERROR,USE_IEEE_FLOAT
187.ELSE
188.IFDEF __ALPHA__
189CC_OPTIONS = /PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
190CC_DEFS = ,HAVE_ALARM,HAVE_STRERROR
191.ELSE
192.IFDEF __DECC__
193CC_OPTIONS = /DECC /PREFIX_LIBRARY_ENTRIES=ALL_ENTRIES
194CC_DEFS = ,HAVE_ALARM,HAVE_STRERROR
195.ELSE
196CC_OPTIONS = /VAXC
197CC_DEFS = ,HAVE_STRERROR
198.ENDIF
199.ENDIF
200.ENDIF
201
202nebind.h \
203nefkeys.h \
204nefunc.h \
205neproto.h \
206nename.h :	cmdtbl $(MKTBLS)
207	MKTBLS cmdtbl
208
209nevars.h \
210nemode.h :	modetbl $(MKTBLS)
211	MKTBLS modetbl
212
213# install to DESTDIR1 if it's writable, else DESTDIR2
214install :
215	@ WRITE SYS$ERROR "** no rule for $@"
216
217clean :
218	@- if f$search("*.obj") .nes. "" then delete *.obj;*
219	@- if f$search("*.bak") .nes. "" then delete *.bak;*
220	@- if f$search("*.lis") .nes. "" then delete *.lis;*
221	@- if f$search("*.log") .nes. "" then delete *.log;*
222	@- if f$search("*.map") .nes. "" then delete *.map;*
223	@- if f$search("*.opt") .nes. "" then delete *.opt;*
224	@- if f$search("ne*.h") .nes. "" then delete ne*.h;*
225	@- if f$search("$(MKTBLS)") .nes. "" then delete $(MKTBLS);
226
227clobber : clean
228	@- if f$search("vile.com") .nes. "" then delete vile.com;*
229	@- if f$search("xvile.com") .nes. "" then delete xvile.com;*
230	@- if f$search("*.exe") .nes. "" then delete *.exe;*
231
232$(OBJ) : estruct.h nemode.h nefkeys.h edef.h proto.h
233
234bind.obj :	nefunc.h
235eval.obj :	nevars.h
236exec.obj :	nefunc.h
237externs.obj :	nebind.h nename.h neproto.h nefunc.h
238filec.obj :	dirstuff.h
239glob.obj :	dirstuff.h
240globals.obj :	nefunc.h
241main.obj :	chgdfunc.h nevars.h
242modes.obj :	chgdfunc.h
243opers.obj :	nefunc.h
244path.obj :	dirstuff.h
245random.obj :	nefunc.h
246select.obj :	nefunc.h
247spawn.obj :	nefunc.h
248termio.obj :	nefunc.h
249version.obj :	patchlev.h
250vl_ctype.obj :	vl_ctype.h
251vms2unix.obj :	dirstuff.h
252word.obj :	nefunc.h
253
254.first :
255	@ MKTBLS :== $SYS$DISK:'F$DIRECTORY()$(MKTBLS)	! make a foreign command
256
257.last :
258	@- if f$search("*.dia") .nes. "" then delete *.dia;*
259	@- if f$search("*.lis") .nes. "" then purge *.lis
260	@- if f$search("*.obj") .nes. "" then purge *.obj
261	@- if f$search("*.map") .nes. "" then purge *.map
262	@- if f$search("*.exe") .nes. "" then purge *.exe
263	@- if f$search("*.log") .nes. "" then purge *.log
264	@- if f$search("*.opt") .nes. "" then purge *.opt
265
266# used /G_FLOAT with vaxcrtlg/share in vms_link.opt
267# can also use /Debug /Listing /Show=All
268CFLAGS =-
269	$(CC_OPTIONS)/Diagnostics /Define=("os_chosen",$(SCRDEF)$(CC_DEFS)) -
270	/Object=$@ /Include=($(INCS))
271
272.C.OBJ :
273	$(CC) $(CFLAGS) $(MMS$SOURCE)
274	@- delete $(MMS$TARGET_NAME).dia;*
275
276$(MKTBLS) : mktbls.obj $(OPTFILE)
277	$(LINK) $(LINKFLAGS) mktbls.obj $(OPTIONS)
278
279$(TARGET) : $(OBJ), vms_link.opt, descrip.mms $(OPTFILE)
280	$(LINK) $(LINKFLAGS) main.obj, $(SCREEN).obj, vms_link/opt
281
282vms_link.opt :
283	@vmsbuild vms_link_opt
284
285# test-drivers
286
287test_btree.obj :	btree.c
288	$(CC) $(CFLAGS) /Define=("DEBUG_BTREE") btree.c
289test_btree.exe :	test_btree.obj
290	$(LINK) $(LINKFLAGS) test_btree.obj $(OPTIONS)
291
292test_regexp.obj :	regexp.c
293	$(CC) $(CFLAGS) /Define=("DEBUG_REGEXP") regexp.c
294test_regexp.exe :	test_regexp.obj
295	$(LINK) $(LINKFLAGS) test_regexp.obj $(OPTIONS)
296
297TEST_IO_OBJS	= \
298	$(SCREEN).obj, \
299	nullterm.obj, \
300	test_io.obj
301
302test_io.exe :	$(TEST_IO_OBJS)
303	$(LINK) $(LINKFLAGS) $(TEST_IO_OBJS) $(OPTIONS)
304
305# Runs VILE from the current directory (used for testing)
306vile.com :
307	@- if "''f$search("$@")'" .nes. "" then delete $@;*
308	@- copy nl: $@
309	@ open/append  test_script $@
310	@ write test_script "$ temp = f$environment(""procedure"")"
311	@ write test_script "$ temp = temp -"
312	@ write test_script "		- f$parse(temp,,,""version"",""syntax_only"") -"
313	@ write test_script "		- f$parse(temp,,,""type"",""syntax_only"")"
314	@ write test_script "$ vile :== $ 'temp'.exe"
315	@ write test_script "$ define/user_mode sys$input  sys$command"
316	@ write test_script "$ define/user_mode sys$output sys$command"
317	@ write test_script "$ vile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
318	@ close test_script
319	@ write sys$output "** made $@"
320
321# Runs XVILE from the current directory (used for testing)
322xvile.com :
323	@- if "''f$search("$@")'" .nes. "" then delete $@;*
324	@- copy nl: $@
325	@ open/append  test_script $@
326	@ write test_script "$ temp = f$environment(""procedure"")"
327	@ write test_script "$ temp = temp -"
328	@ write test_script "		- f$parse(temp,,,""name"",""syntax_only"") -"
329	@ write test_script "		- f$parse(temp,,,""version"",""syntax_only"") -"
330	@ write test_script "		- f$parse(temp,,,""type"",""syntax_only"")"
331	@ write test_script "$ xvile :== $ 'temp'xvile.exe"
332	@ write test_script "$ define/user_mode sys$input  sys$command"
333	@ write test_script "$ define/user_mode sys$output sys$command"
334	@ write test_script "$ xvile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
335	@ close test_script
336	@ write sys$output "** made $@"
337
338