blob: f1ce93a2979d700a8f6b47b299927a264ed12ccc [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001#
2# Makefile for Vim on OpenVMS
3#
4# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
5# Last change: 2004 May 04
6#
7# This has script been tested on VMS 6.2 to 7.3 on DEC Alpha and VAX
8# with MMS and MMK
9#
10# The following could be built:
11# vim.exe: standard (terminal, GUI/Motif, GUI/GTK)
12# dvim.exe: debug
13#
14# Edit the lines in the Configuration section below for fine tuning.
15#
16# To build: mms/descrip=Make_vms.mms
17# To clean up: mms/descrip=Make_vms.mms clean
18#
19# Hints and detailed description could be found in INSTALLVMS.TXT file.
20#
21######################################################################
22# Configuration section.
23######################################################################
24# Platform selection
25# Define this if you will use the VAX platform to build.
26# VAX = YES
27
28# VMS version
29# Uncomment if you use VMS version 6.2 or older
30# OLD_VMS = YES
31
32# Compiler selection.
33# Comment out if you use the VAXC compiler
34DECC = YES
35
36# Build model selection
37# TINY - Almost no features enabled, not even multiple windows
38# SMALL - Few features enabled, as basic as possible
39# NORMAL - A default selection of features enabled
40# BIG - Many features enabled, as rich as possible. (default)
41# HUGE - All possible featues enabled.
42# Please select one of these alternatives above.
43MODEL = BIG
44
45# GUI or terminal mode executable.
46# Comment out if you want just the character terminal mode only.
47GUI = YES
48
49# GUI with GTK
50# If you have GTK installed you might want to enable this option.
51# GTK = YES
52
53# Comment out if you want the compiler version with :ver command.
54# NOTE: This part can make some complications if you're using some
55# predefined symbols/flags for your compiler. If does, just leave behind
56# the comment varialbe CCVER.
57CCVER = YES
58
59# Uncomment if want a debug version. Resulting executable is DVIM.EXE
60# Development purpose only! Normally, it should not be defined. !!!
61# DEBUG = YES
62
63# Languages support for Perl, Python, TCL etc.
64# If you don't need it really, leave them behind the comment.
65# You will need related libraries, include files etc.
66# VIM_TCL = YES
67# VIM_PERL = YES
68# VIM_PYTHON = YES
69# VIM_RUBY = YES
70# VIM_SNIFF = YES
71
72# X Input Method. For entering special languages like chinese and
73# Japanese. Please define just one: VIM_XIM or VIM_HANGULIN
74# If you don't need it really, leave it behind the comment.
75# VIM_XIM = YES
76
77# Internal Hangul input method. GUI only.
78# If you don't need it really, leave it behind the comment.
79# VIM_HANGULIN = YES
80
81# Allow any white space to separate the fields in a tags file
82# When not defined, only a TAB is allowed.
83# VIM_TAG_ANYWHITE = YES
84
85######################################################################
86# Directory, library and include files configuration section.
87# Normally you need not to change anything below. !
88# These may need to be defined if things are not in standard locations
89#
90# You can find some explanation in INSTALLVMS.TXT
91######################################################################
92
93# Compiler setup
94
95.IFDEF VAX
96.IFDEF DECC # VAX with DECC
97CC_DEF = cc/decc
98PREFIX = /prefix=all
99.ELSE # VAX with VAXC
100CC_DEF = cc
101PREFIX =
102CCVER =
103.ENDIF
104.ELSE # AXP wixh DECC
105CC_DEF = cc
106PREFIX = /prefix=all
107.ENDIF
108
109LD_DEF = link
110C_INC = [.proto]
111
112.IFDEF OLD_VMS
113VMS_DEF = ,"OLD_VMS"
114.ENDIF
115
116.IFDEF DEBUG
117DEBUG_DEF = ,"DEBUG"
118TARGET = dvim.exe
119CFLAGS = /debug/noopt$(PREFIX)
120LDFLAGS = /debug
121.ELSE
122TARGET = vim.exe
123CFLAGS = /opt$(PREFIX)
124LDFLAGS =
125.ENDIF
126
127# Predefined VIM directories
128# Please, use $VIM and $VIMRUNTIME logicals instead
129VIMLOC = ""
130VIMRUN = ""
131
132CONFIG_H = os_vms_conf.h
133
134.IFDEF GTK
135.IFDEF GUI
136.ELSE
137GUI = YES
138.ENDIF
139.ENDIF
140
141.IFDEF GUI
142# X/Motif/GTK executable (also works in terminal mode )
143
144.IFDEF GTK
145GTK_DIR = ALPHA$DKA0:[GTK128.]
146DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK"
147LIBS = ,OS_VMS_GTK.OPT/OPT
148GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
149GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_gtk_x11.c pty.c
150GUI_OBJ = gui.obj gui_gtk.obj gui_gtk_f.obj gui_gtk_x11.obj pty.obj
151GUI_INC = ,"/gtk_root/gtk","/gtk_root/glib"
152# GUI_INC_VER is used just for :ver information
153# this string should escape from C and DCL in the same time
154GUI_INC_VER= ,\""/gtk_root/gtk\"",\""/gtk_root/glib\""
155.else
156MOTIF = YES
157DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF"
158LIBS = ,OS_VMS_MOTIF.OPT/OPT
159GUI_FLAG =
160GUI_SRC = gui.c gui_motif.c gui_x11.c
161GUI_OBJ = gui.obj gui_motif.obj gui_x11.obj
162GUI_INC =
163.ENDIF
164
165# You need to define these variables if you do not have DECW files
166# at standard location
167GUI_INC_DIR = ,decw$include:
168# GUI_LIB_DIR = ,sys$library:
169
170.ELSE
171# Character terminal only executable
172DEFS = "HAVE_CONFIG_H"
173LIBS =
174.ENDIF
175
176.IFDEF VIM_PERL
177# Perl related setup.
178PERL = perl
179PERL_DEF = ,"FEAT_PERL"
180PERL_SRC = if_perlsfio.c if_perl.xs
181PERL_OBJ = if_perlsfio.obj if_perl.obj
182PERL_LIB = ,OS_VMS_PERL.OPT/OPT
183PERL_INC = ,dka0:[perlbuild.perl.lib.vms_axp.5_6_1.core]
184.ENDIF
185
186.IFDEF VIM_PYTHON
187# Python related setup.
188PYTHON_DEF = ,"FEAT_PYTHON"
189PYTHON_SRC = if_python.c
190PYTHON_OBJ = if_python.obj
191PYTHON_LIB = ,OS_VMS_PYTHON.OPT/OPT
192PYTHON_INC = ,PYTHON_INCLUDE
193.ENDIF
194
195.IFDEF VIM_TCL
196# TCL related setup.
197TCL_DEF = ,"FEAT_TCL"
198TCL_SRC = if_tcl.c
199TCL_OBJ = if_tcl.obj
200TCL_LIB = ,OS_VMS_TCL.OPT/OPT
201TCL_INC = ,dka0:[tcl80.generic]
202.ENDIF
203
204.IFDEF VIM_SNIFF
205# SNIFF related setup.
206SNIFF_DEF = ,"FEAT_SNIFF"
207SNIFF_SRC = if_sniff.c
208SNIFF_OBJ = if_sniff.obj
209SNIFF_LIB =
210SNIFF_INC =
211.ENDIF
212
213.IFDEF VIM_RUBY
214# RUBY related setup.
215RUBY_DEF = ,"FEAT_RUBY"
216RUBY_SRC = if_ruby.c
217RUBY_OBJ = if_ruby.obj
218RUBY_LIB = ,OS_VMS_RUBY.OPT/OPT
219RUBY_INC =
220.ENDIF
221
222.IFDEF VIM_XIM
223# XIM related setup.
224.IFDEF GUI
225XIM_DEF = ,"FEAT_XIM"
226.ENDIF
227.ENDIF
228
229.IFDEF VIM_HANGULIN
230# HANGULIN related setup.
231.IFDEF GUI
232HANGULIN_DEF = ,"FEAT_HANGULIN"
233HANGULIN_SRC = hangulin.c
234HANGULIN_OBJ = hangulin.obj
235.ENDIF
236.ENDIF
237
238.IFDEF VIM_TAG_ANYWHITE
239# TAG_ANYWHITE related setup.
240TAG_DEF = ,"FEAT_TAG_ANYWHITE"
241.ENDIF
242
243
244######################################################################
245# End of configuration section.
246# Please, do not change anything below without programming experience.
247######################################################################
248
249
250MODEL_DEF = "FEAT_$(MODEL)",
251
252# These go into pathdef.c
253VIMUSER = "''F$EDIT(F$GETJPI(" ","USERNAME"),"TRIM")'"
254VIMHOST = "''F$TRNLNM("SYS$NODE")'''F$TRNLNM("UCX$INET_HOST")'.''F$TRNLNM("UCX$INET_DOMAIN")'"
255
256.SUFFIXES : .obj .c
257
258ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
259 $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)) -
260 $(CFLAGS)$(GUI_FLAG) -
261 /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
262
263# CFLAGS displayed in :ver information
264# It is specially formated for correct display of unix like includes
265# as $(GUI_INC) - replaced with $(GUI_INC_VER)
266# Otherwise should not be any other difference.
267ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
268 $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)) -
269 $(CFLAGS)$(GUI_FLAG) -
270 /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
271
272ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
273 $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB)
274
275SRC = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
276 ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
277 main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
278 misc2.c move.c normal.c ops.c option.c quickfix.c regexp.c search.c \
279 syntax.c tag.c term.c termlib.c ui.c undo.c version.c screen.c \
280 window.c os_unix.c os_vms.c pathdef.c \
281 $(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
282 $(RUBY_SRC) $(HANGULIN_SRC)
283
284OBJ = buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \
285 ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \
286 if_xcmdsrv.obj fileio.obj fold.obj getchar.obj main.obj mark.obj \
287 menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
288 move.obj mbyte.obj normal.obj ops.obj option.obj quickfix.obj \
289 regexp.obj search.obj syntax.obj tag.obj term.obj termlib.obj \
290 ui.obj undo.obj screen.obj version.obj window.obj os_unix.obj \
291 os_vms.obj pathdef.obj \
292 $(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
293 $(RUBY_OBJ) $(HANGULIN_OBJ)
294
295# Default target is making the executable
296all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env $(TARGET)
297 ! $@
298
299[.auto]config.h : $(CONFIG_H)
300 copy/nolog $(CONFIG_H) [.auto]config.h
301
302mmk_compat :
303 -@ open/write pd pathdef.c
304 -@ write pd "/* Empty file to satisfy MMK depend. */"
305 -@ write pd "/* It will be owerwritten later on... */"
306 -@ close pd
307clean :
308 -@ if "''F$SEARCH("*.exe")'" .NES. "" then delete/noconfirm/nolog *.exe;*
309 -@ if "''F$SEARCH("*.obj")'" .NES. "" then delete/noconfirm/nolog *.obj;*
310 -@ if "''F$SEARCH("[.auto]config.h")'" .NES. "" then delete/noconfirm/nolog [.auto]config.h;*
311 -@ if "''F$SEARCH("pathdef.c")'" .NES. "" then delete/noconfirm/nolog pathdef.c;*
312 -@ if "''F$SEARCH("if_perl.c")'" .NES. "" then delete/noconfirm/nolog if_perl.c;*
313 -@ if "''F$SEARCH("*.opt")'" .NES. "" then delete/noconfirm/nolog *.opt;*
314
315# Link the target
316$(TARGET) : $(OBJ)
317 $(LD_DEF) $(LDFLAGS) /exe=$(TARGET) $+ $(ALL_LIBS)
318
319.c.obj :
320 $(CC_DEF) $(ALL_CFLAGS) $<
321
322pathdef.c : check_ccver $(CONFIG_H)
323 -@ write sys$output "creating PATHDEF.C file."
324 -@ open/write pd pathdef.c
325 -@ write pd "/* pathdef.c -- DO NOT EDIT! */"
326 -@ write pd "/* This file is automatically created by MAKE_VMS.MMS"
327 -@ write pd " * Change the file MAKE_VMS.MMS Only. */"
328 -@ write pd "typedef unsigned char char_u;"
329 -@ write pd "char_u *default_vim_dir = (char_u *)"$(VIMLOC)";"
330 -@ write pd "char_u *default_vimruntime_dir = (char_u *)"$(VIMRUN)";"
331 -@ write pd "char_u *all_cflags = (char_u *)""$(CC_DEF)$(ALL_CFLAGS_VER)"";"
332 -@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";"
333 -@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
334 -@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
335 -@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
336 -@ close pd
337
338if_perl.c : if_perl.xs
339 -@ $(PERL) PERL_ROOT:[LIB.ExtUtils]xsubpp -prototypes -typemap -
340 PERL_ROOT:[LIB.ExtUtils]typemap if_perl.xs >> $@
341
342make_vms.mms :
343 -@ write sys$output "The name of the makefile MUST be <MAKE_VMS.MMS> !!!"
344
345.IFDEF CCVER
346# This part can make some complications if you're using some predefined
347# symbols/flags for your compiler. If does, just comment out CCVER variable
348check_ccver :
349 -@ define sys$output cc_ver.tmp
350 -@ $(CC_DEF)/version
351 -@ deassign sys$output
352 -@ open/read file cc_ver.tmp
353 -@ read file CC_VER
354 -@ close file
355 -@ delete/noconfirm/nolog cc_ver.tmp.*
356.ELSE
357check_ccver :
358 -@ !
359.ENDIF
360
361.IFDEF MOTIF
362motif_env :
363 -@ write sys$output "using DECW/Motif environment."
364 -@ write sys$output "creating OS_VMS_MOTIF.OPT file."
365 -@ open/write opt_file OS_VMS_MOTIF.OPT
366 -@ write opt_file "sys$share:decw$xmlibshr12.exe/share,-"
367 -@ write opt_file "sys$share:decw$xtlibshrr5.exe/share,-"
368 -@ write opt_file "sys$share:decw$xlibshr.exe/share"
369 -@ close opt_file
370.ELSE
371motif_env :
372 -@ !
373.ENDIF
374
375
376.IFDEF GTK
377gtk_env :
378 -@ write sys$output "using GTK environment:"
379 -@ define/nolog gtk_root /trans=conc $(GTK_DIR)
380 -@ show logical gtk_root
381 -@ write sys$output " include path: "$(GUI_INC)""
382 -@ write sys$output "creating OS_VMS_GTK.OPT file."
383 -@ open/write opt_file OS_VMS_GTK.OPT
384 -@ write opt_file "gtk_root:[glib]libglib.exe /share,-"
385 -@ write opt_file "gtk_root:[glib.gmodule]libgmodule.exe /share,-"
386 -@ write opt_file "gtk_root:[gtk.gdk]libgdk.exe /share,-"
387 -@ write opt_file "gtk_root:[gtk.gtk]libgtk.exe /share,-"
388 -@ write opt_file "sys$share:decw$xmlibshr12.exe/share,-"
389 -@ write opt_file "sys$share:decw$xtlibshrr5.exe/share,-"
390 -@ write opt_file "sys$share:decw$xlibshr.exe/share"
391 -@ close opt_file
392.ELSE
393gtk_env :
394 -@ !
395.ENDIF
396
397.IFDEF VIM_PERL
398perl_env :
399 -@ write sys$output "using PERL environment:"
400 -@ show logical PERLSHR
401 -@ write sys$output " include path: ""$(PERL_INC)"""
402 -@ show symbol perl
403 -@ open/write pd if_perl.c
404 -@ write pd "/* Empty file to satisfy MMK depend. */"
405 -@ write pd "/* It will be owerwritten later on... */"
406 -@ close pd
407 -@ write sys$output "creating OS_VMS_PERL.OPT file."
408 -@ open/write opt_file OS_VMS_PERL.OPT
409 -@ write opt_file "PERLSHR /share"
410 -@ close opt_file
411.ELSE
412perl_env :
413 -@ !
414.ENDIF
415
416.IFDEF VIM_PYTHON
417python_env :
418 -@ write sys$output "using PYTHON environment:"
419 -@ show logical PYTHON_INCLUDE
420 -@ show logical PYTHON_OLB
421 -@ write sys$output "creating OS_VMS_PYTHON.OPT file."
422 -@ open/write opt_file OS_VMS_PYTHON.OPT
423 -@ write opt_file "PYTHON_OLB:PYTHON.OLB /share"
424 -@ close opt_file
425.ELSE
426python_env :
427 -@ !
428.ENDIF
429
430.IFDEF VIM_TCL
431tcl_env :
432 -@ write sys$output "using TCL environment:"
433 -@ show logical TCLSHR
434 -@ write sys$output " include path: ""$(TCL_INC)"""
435 -@ write sys$output "creating OS_VMS_TCL.OPT file."
436 -@ open/write opt_file OS_VMS_TCL.OPT
437 -@ write opt_file "TCLSHR /share"
438 -@ close opt_file
439.ELSE
440tcl_env :
441 -@ !
442.ENDIF
443
444.IFDEF VIM_RUBY
445ruby_env :
446 -@ write sys$output "using RUBY environment:"
447 -@ write sys$output " include path: ""$(RUBY_INC)"""
448 -@ write sys$output "creating OS_VMS_RUBY.OPT file."
449 -@ open/write opt_file OS_VMS_RUBY.OPT
450 -@ write opt_file "RUBYSHR /share"
451 -@ close opt_file
452.ELSE
453ruby_env :
454 -@ !
455.ENDIF
456
457