blob: d2c7d37f33b7b293628f1954bd38ebb4bc051e24 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# A-A-P recipe for building Vim
2#
3# There are no user choices in here!
4# Put configure arguments in the file config.arg.
5# Later there will be a config.txt file that contains examples and
6# explanations.
7#
8# Optional arguments:
Bram Moolenaar1e015462005-09-25 22:16:38 +00009# PREFIX=dir Overrules the install directory.
10# Can be specified when installing only.
11# Example: aap install PREFIX=$HOME
Bram Moolenaar071d4272004-06-13 20:20:40 +000012#
13
14# Skip the configure stuff when "link.sh" is executing this recipe recursively
15# to build pathdef.c or not building something and auto/config.aap does exist.
16@if ((_no.TARGETARG != "pathdef" and has_build_target())
Bram Moolenaar1e015462005-09-25 22:16:38 +000017@ or not os.path.exists("auto/config.aap")):
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
19 #
20 # A U T O C O N F
21 #
22
23 # Run autoconf when configure.in has been changed since it was last run.
24 # This is skipped when the signatures in "mysign" are up-to-date. When
25 # there is no autoconf program skip this (the signature is often the only
26 # thing that's outdated)
27 auto/configure {signfile = mysign} : configure.in
Bram Moolenaar1e015462005-09-25 22:16:38 +000028 @if not program_path("autoconf"):
29 :print Can't find autoconf, using existing configure script.
30 @else:
Bram Moolenaar071d4272004-06-13 20:20:40 +000031 # Move configure aside, autoconf would overwrite it
32 :move {exist} configure configure.save
33 :sys autoconf
Bram Moolenaar06b5db92006-02-10 23:11:56 +000034 :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure
Bram Moolenaar071d4272004-06-13 20:20:40 +000035 :chmod 755 auto/configure
36 :move configure.save configure
37 :del {force} auto/config.cache auto/config.status
38
39 # Change the configure script to produce config.aap instead of config.mk.
40 auto/configure.aap : auto/configure
Bram Moolenaar1e015462005-09-25 22:16:38 +000041 :print Adjusting auto/configure for A-A-P.
42 :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin)
43 >! auto/configure.aap
44 :chmod 755 auto/configure.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000045
46 # The configure script uses the directory where it's located, use a link.
47 configure.aap: {buildcheck=}
Bram Moolenaar1e015462005-09-25 22:16:38 +000048 :symlink {f} auto/configure.aap configure.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50 # Dependency: run configure.aap to update config.h and config.aap in the
51 # "auto" directory.
52 config {virtual} auto/config.h auto/config.aap :
Bram Moolenaar1e015462005-09-25 22:16:38 +000053 auto/configure.aap configure.aap
54 config.arg config.h.in config.aap.in
55 :sys CONFIG_STATUS=auto/config.status
Bram Moolenaar071d4272004-06-13 20:20:40 +000056 ./configure.aap `file2string("config.arg")`
57 --cache-file=auto/config.cache
58
59 # Configure arguments: create an empty "config.arg" file when its missing
60 config.arg:
Bram Moolenaar1e015462005-09-25 22:16:38 +000061 :touch {exist} config.arg
Bram Moolenaar071d4272004-06-13 20:20:40 +000062
63 # "auto/config.aap" contains a lot of settings, such as the name of the
64 # executable "Target".
65 # First update it, forcefully if the "reconfig" target was used.
66 @if _no.TARGETARG != "comment" and _no.TARGETARG != "make":
Bram Moolenaar1e015462005-09-25 22:16:38 +000067 @if "reconfig" in var2list(_no.TARGETARG):
68 :del {force} auto/config.cache auto/config.status
69 :update {force} auto/config.aap
70 @else:
71 :update auto/config.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000072
73# Include the recipe that autoconf generated.
74:include auto/config.aap
75
76# A "PREFIX=dir" argument overrules the value of $prefix
77@if _no.get("PREFIX"):
78 prefix = $PREFIX
79
80# Don't want "~/" in prefix.
81prefix = `os.path.expanduser(prefix)`
82
83#
84# G U I variant
85#
86# The GUI is selected by configure, a lot of other things depend on it.
87#
88:variant GUI
89 GTK
Bram Moolenaar1e015462005-09-25 22:16:38 +000090 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
91 gui_gtk_f.c
92 GUI_OBJ =
93 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
94 GUI_IPATH = $GUI_INC_LOC
95 GUI_LIBS_DIR = $GUI_LIB_LOC
96 GUI_LIBS1 =
97 GUI_LIBS2 = $GTK_LIBNAME
98 GUI_TARGETS = installglinks
99 GUI_MAN_TARGETS = installghelplinks
100 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101 MOTIF
Bram Moolenaar1e015462005-09-25 22:16:38 +0000102 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
103 gui_xmdlg.c gui_xmebw.c
104 GUI_OBJ =
105 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
106 GUI_IPATH = $GUI_INC_LOC
107 GUI_LIBS_DIR = $GUI_LIB_LOC
108 GUI_LIBS1 =
109 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
110 GUI_TARGETS = installglinks
111 GUI_MAN_TARGETS = installghelplinks
112 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113 ATHENA
Bram Moolenaar1e015462005-09-25 22:16:38 +0000114 # XAW_LIB et al. can be overruled to use Xaw3d widgets
115 XAW_LIB ?= -lXaw
116 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
117 gui_at_sb.c gui_at_fs.c
118 GUI_OBJ =
119 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
120 GUI_IPATH = $GUI_INC_LOC
121 GUI_LIBS_DIR = $GUI_LIB_LOC
122 GUI_LIBS1 = $XAW_LIB
123 GUI_LIBS2 = -lXt
124 GUI_TARGETS = installglinks
125 GUI_MAN_TARGETS = installghelplinks
126 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127 NEXTAW
Bram Moolenaar1e015462005-09-25 22:16:38 +0000128 # XAW_LIB et al. can be overruled to use Xaw3d widgets
129 XAW_LIB ?= -lXaw
130 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
131 gui_at_fs.c
132 GUI_OBJ =
133 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
134 GUI_IPATH = $GUI_INC_LOC
135 GUI_LIBS_DIR = $GUI_LIB_LOC
136 GUI_LIBS1 = $NEXTAW_LIB
137 GUI_LIBS2 = -lXt
138 GUI_TARGETS = installglinks
139 GUI_MAN_TARGETS = installghelplinks
140 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141 PHOTONGUI
Bram Moolenaar1e015462005-09-25 22:16:38 +0000142 GUI_SRC = gui.c gui_photon.c pty.c
143 GUI_OBJ =
144 GUI_DEFS = -DFEAT_GUI_PHOTON
145 GUI_IPATH =
146 GUI_LIBS_DIR =
147 GUI_LIBS1 = -lph -lphexlib
148 GUI_LIBS2 =
149 GUI_TARGETS = installglinks
150 GUI_MAN_TARGETS = installghelplinks
151 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000152 *
Bram Moolenaar1e015462005-09-25 22:16:38 +0000153 GUI_SRC =
154 GUI_OBJ =
155 GUI_DEFS =
156 GUI_IPATH =
157 GUI_LIBS_DIR =
158 GUI_LIBS1 =
159 GUI_LIBS2 =
160 GUI_TARGETS =
161 GUI_MAN_TARGETS =
162 GUI_TESTTARGET =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163
164
165PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000166POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000167CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
168CPPFLAGS =
169
170ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
171LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000172LIBS = $GUI_LIBS1 $GUI_X_LIBS $GUI_LIBS2 $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $CONF_LIBS $?(EXTRA_LIBS) $MZSCHEME_LIBS $PERL_LIBS $PYTHON_LIBS $TCL_LIBS $RUBY_LIBS $?(PROFILE_LIBS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173
174Target = $VIMNAME
175
176# reconfig target also builds Vim (reconfiguration is handled above).
177reconfig {virtual}: $Target
178
179
180# Execute the test scripts. Run these after compiling Vim, before installing.
181#
182# This will produce a lot of garbage on your screen, including a few error
183# messages. Don't worry about that.
184# If there is a real error, there will be a difference between "test.out" and
185# a "test99.ok" file.
186# If everything is allright, the final message will be "ALL DONE".
187#
188test check:
189 VimProg = ../$Target
190 :execute testdir/main.aap $GUI_TESTTARGET
191
192testclean {virtual}:
193 :del {force} testdir/*.out testdir/test.log
194
Bram Moolenaar071d4272004-06-13 20:20:40 +0000195# When no fetch target exists we are not a child of the ../main.aap recipe,
196# Use ../main.aap to do the fetching.
197# --- If you get an error here for wrong number of arguments, you need to
198# update to a newer version of A-A-P.
199@if not has_target("fetch"):
200 fetch:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000201 :execute ../main.aap fetch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202
203
204# All the source files that need to be compiled.
205# Some are optional and depend on configure.
206# "version.c" is missing, it's always compiled (see below).
207Source =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000208 buffer.c
209 charset.c
210 diff.c
211 digraph.c
212 edit.c
213 eval.c
214 ex_cmds.c
215 ex_cmds2.c
216 ex_docmd.c
217 ex_eval.c
218 ex_getln.c
219 fileio.c
220 fold.c
221 getchar.c
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000222 hardcopy.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000223 hashtable.c
224 if_cscope.c
225 if_xcmdsrv.c
226 main.c
227 mark.c
228 memfile.c
229 memline.c
230 menu.c
231 message.c
232 misc1.c
233 misc2.c
234 move.c
235 mbyte.c
236 normal.c
237 ops.c
238 option.c
239 os_unix.c
240 auto/pathdef.c
Bram Moolenaarbb15b652005-10-03 21:52:09 +0000241 popupmenu.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000242 quickfix.c
243 regexp.c
244 screen.c
245 search.c
246 spell.c
247 syntax.c
248 tag.c
249 term.c
250 ui.c
251 undo.c
252 window.c
253 $OS_EXTRA_SRC
254 $GUI_SRC
255 $HANGULIN_SRC
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000256 $MZSCHEME_SRC
Bram Moolenaar1e015462005-09-25 22:16:38 +0000257 $PERL_SRC
258 $NETBEANS_SRC
259 $PYTHON_SRC
260 $TCL_SRC
261 $RUBY_SRC
262 $SNIFF_SRC
263 $WORKSHOP_SRC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000265Objects =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000266 $GUI_OBJ
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000267
Bram Moolenaar071d4272004-06-13 20:20:40 +0000268# TODO: make is still used for subdirectories, need to write a recipe.
269MAKE ?= make
270
271all: $Target
272
273# This dependency is required to build auto/osdef.h before automatic
274# dependencies are generated.
275$Source version.c : auto/osdef.h
276
277# Need to mention that the target also depends on version.c, since it's not
278# inluded in $Source
279$Target : version.c
280
281# Some sources are to be found in the "auto" directory.
282SRCPATH += auto
283
284# When building Vim always compile version.c to get the timestamp.
285:filetype
286 declare my_prog
287:attr {filetype = my_prog} $Target
288
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000289:program $Target : $Source $Objects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000290
291:action build my_prog object
Bram Moolenaar1e015462005-09-25 22:16:38 +0000292 version_obj = `src2obj("version.c")`
293 :do compile {target = $version_obj} version.c
294 #:do build {target = $target {filetype = program}} $source $version_obj
295 link_sed = $BDIR/link.sed
296 @if os.path.exists(link_sed):
297 :move {force} $link_sed auto/link.sed
298 @else:
299 :del {force} auto/link.sed
300 :update link2.sh
301 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
302 -o $target $source $version_obj $LIBS" \
303 MAKE="aap" sh ./link2.sh
304 :copy {force} auto/link.sed $BDIR/link.sed
Bram Moolenaar071d4272004-06-13 20:20:40 +0000305
306# "link.sh" must be modified for A-A-P
307link2.sh : link.sh
308 :print Adjusting $-source for A-A-P.
309 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000310 >! $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000311
312xxd/xxd$EXESUF: xxd/xxd.c
313 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000314 $MAKE -f Makefile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000315
316# Build the language specific files if they were unpacked.
317# Generate the converted .mo files separately, it's no problem if this fails.
318languages {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000319 @if _no.MAKEMO:
320 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
321 @try:
322 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
323 @except:
324 :print Generated converted language files failed, continuing
Bram Moolenaar071d4272004-06-13 20:20:40 +0000325
326# Update the *.po files for changes in the sources. Only run manually.
327update-po {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000328 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329
330auto/if_perl.c: if_perl.xs
Bram Moolenaar1e015462005-09-25 22:16:38 +0000331 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
332 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
333 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334
335auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
Bram Moolenaar1e015462005-09-25 22:16:38 +0000336 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337
338pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
339
340auto/pathdef.c: auto/config.aap
Bram Moolenaar1e015462005-09-25 22:16:38 +0000341 :print Creating $target
342 :print >! $target /* pathdef.c */
343 :print >> $target /* This file is automatically created by main.aap */
344 :print >> $target /* DO NOT EDIT! Change main.aap only. */
345 :print >> $target $#include "vim.h"
346 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
347 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
348 v = $CC -c -I$srcdir $CFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000349 @v = string.replace(v, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000350 :print >> $target char_u *all_cflags = (char_u *)"$v";
351 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
352 link_sed = $BDIR/link.sed
353 @if os.path.exists(link_sed):
354 # filter $linkcmd through $BDIR/link.sed
355 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000356 @linkcmd = string.replace(linkcmd, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000357 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
358 @if _no.get("COMPILEDBY"):
359 who = $COMPILEDBY
360 where = ''
361 @else:
362 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
Bram Moolenaar071d4272004-06-13 20:20:40 +0000363
Bram Moolenaar1e015462005-09-25 22:16:38 +0000364 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
365 :print >> $target char_u *compiled_user = (char_u *)"$who";
366 :print >> $target char_u *compiled_sys = (char_u *)"$where";
Bram Moolenaar071d4272004-06-13 20:20:40 +0000367
368
369### Names of the programs and targets
Bram Moolenaar1e015462005-09-25 22:16:38 +0000370VIMTARGET = $VIMNAME$EXESUF
371EXTARGET = $EXNAME$LNKSUF
372VIEWTARGET = $VIEWNAME$LNKSUF
373GVIMNAME = g$VIMNAME
374GVIMTARGET = $GVIMNAME$LNKSUF
375GVIEWNAME = g$VIEWNAME
376GVIEWTARGET = $GVIEWNAME$LNKSUF
377RVIMNAME = r$VIMNAME
378RVIMTARGET = $RVIMNAME$LNKSUF
379RVIEWNAME = r$VIEWNAME
380RVIEWTARGET = $RVIEWNAME$LNKSUF
381RGVIMNAME = r$GVIMNAME
382RGVIMTARGET = $RGVIMNAME$LNKSUF
383RGVIEWNAME = r$GVIEWNAME
384RGVIEWTARGET = $RGVIEWNAME$LNKSUF
385VIMDIFFNAME = $(VIMNAME)diff
386GVIMDIFFNAME = g$VIMDIFFNAME
387VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
388GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
389EVIMNAME = e$VIMNAME
390EVIMTARGET = $EVIMNAME$LNKSUF
391EVIEWNAME = e$VIEWNAME
392EVIEWTARGET = $EVIEWNAME$LNKSUF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000393
394### Names of the tools that are also made
395TOOLS = xxd/xxd$EXESUF
396
397# Root of the installation tree. Empty for a normal install, set to an
398# existing path to install into a special place (for generating a package).
399DESTDIR ?=
400
401### Location of man pages
402MANSUBDIR = $MANDIR/man1
403
404### Location of Vim files (should not need to be changed, and
405### some things might not work when they are changed!)
406VIMDIR = /vim
407@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
408VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
409HELPSUBDIR = /doc
410COLSUBDIR = /colors
411SYNSUBDIR = /syntax
412INDSUBDIR = /indent
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000413AUTOSUBDIR = /autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414PLUGSUBDIR = /plugin
415FTPLUGSUBDIR = /ftplugin
416LANGSUBDIR = /lang
417COMPSUBDIR = /compiler
418KMAPSUBDIR = /keymap
419MACROSUBDIR = /macros
420TOOLSSUBDIR = /tools
421TUTORSUBDIR = /tutor
422PRINTSUBDIR = /print
423PODIR = po
424
Bram Moolenaar1e015462005-09-25 22:16:38 +0000425### VIMLOC common root of the Vim files (all versions)
426### VIMRTLOC common root of the runtime Vim files (this version)
427### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000429### HELPSUBLOC location for help files
430### COLSUBLOC location for colorscheme files
431### SYNSUBLOC location for syntax files
432### INDSUBLOC location for indent files
433### AUTOSUBLOC location for standard autoload files
434### PLUGSUBLOC location for standard plugin files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435### FTPLUGSUBLOC location for ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000436### LANGSUBLOC location for language files
437### COMPSUBLOC location for compiler files
438### KMAPSUBLOC location for keymap files
439### MACROSUBLOC location for macro files
440### TOOLSSUBLOC location for tools files
441### TUTORSUBLOC location for tutor files
442### PRINTSUBLOC location for print files
443### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444### You can override these if you want to install them somewhere else.
445### Edit feature.h for compile-time settings.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000446VIMLOC = $DATADIR$VIMDIR
447VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
448VIMRCLOC = $VIMLOC
449HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
450COLSUBLOC = $VIMRTLOC$COLSUBDIR
451SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
452INDSUBLOC = $VIMRTLOC$INDSUBDIR
453AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
454PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
455FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
456LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
457COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
458KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
459MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
460TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
461TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
462PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
463SCRIPTLOC = $VIMRTLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464
465### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
466### the runtime directory is not below it.
467#VIMRUNTIMEDIR = $VIMRTLOC
468
469### Name of the evim file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000470EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
471MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000472
473### Name of the menu file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000474SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
476SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
477
478### Name of the bugreport file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000479SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480
481### Name of the file type detection file target.
482SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
483
484### Name of the file type detection file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000485SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486
487### Name of the file type detection script file target.
488SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
489
490### Name of the ftplugin-on file target.
491SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
492
493### Name of the ftplugin-off file target.
494SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
495
496### Name of the indent-on file target.
497SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
498
499### Name of the indent-off file target.
500SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
501
502### Name of the option window script file target.
503SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
504
505### Permissions for binaries
506BINMOD = 755
507
508### Permissions for man page
509MANMOD = 644
510
511### Permissions for help files
512HELPMOD = 644
513
514### Permissions for Perl and shell scripts
515SCRIPTMOD = 755
516
517### Permission for Vim script files (menu.vim, bugreport.vim, ..)
518VIMSCRIPTMOD = 644
519
520### Permissions for all directories that are created
521DIRMOD = 755
522
523### Permissions for all other files that are created
524FILEMOD = 644
525
526# Where to copy the man and help files from
527HELPSOURCE = ../runtime/doc
528
529# Where to copy the script files from (menu, bugreport)
530SCRIPTSOURCE = ../runtime
531
532# Where to copy the colorscheme files from
533COLSOURCE = ../runtime/colors
534
535# Where to copy the syntax files from
536SYNSOURCE = ../runtime/syntax
537
538# Where to copy the indent files from
539INDSOURCE = ../runtime/indent
540
541# Where to copy the standard plugin files from
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000542AUTOSOURCE = ../runtime/autoload
543
544# Where to copy the standard plugin files from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000545PLUGSOURCE = ../runtime/plugin
546
547# Where to copy the ftplugin files from
548FTPLUGSOURCE = ../runtime/ftplugin
549
550# Where to copy the macro files from
551MACROSOURCE = ../runtime/macros
552
553# Where to copy the tools files from
554TOOLSSOURCE = ../runtime/tools
555
556# Where to copy the tutor files from
557TUTORSOURCE = ../runtime/tutor
558
559# Where to look for language specific files
560LANGSOURCE = ../runtime/lang
561
562# Where to look for compiler files
563COMPSOURCE = ../runtime/compiler
564
565# Where to look for keymap files
566KMAPSOURCE = ../runtime/keymap
567
568# Where to look for print resource files
569PRINTSOURCE = ../runtime/print
570
571# abbreviations
572DEST_BIN = $DESTDIR$BINDIR
573DEST_VIM = $DESTDIR$VIMLOC
574DEST_RT = $DESTDIR$VIMRTLOC
575DEST_HELP = $DESTDIR$HELPSUBLOC
576DEST_COL = $DESTDIR$COLSUBLOC
577DEST_SYN = $DESTDIR$SYNSUBLOC
578DEST_IND = $DESTDIR$INDSUBLOC
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000579DEST_AUTO = $DESTDIR$AUTOSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000580DEST_PLUG = $DESTDIR$PLUGSUBLOC
581DEST_FTP = $DESTDIR$FTPLUGSUBLOC
582DEST_LANG = $DESTDIR$LANGSUBLOC
583DEST_COMP = $DESTDIR$COMPSUBLOC
584DEST_KMAP = $DESTDIR$KMAPSUBLOC
585DEST_MACRO = $DESTDIR$MACROSUBLOC
586DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
587DEST_TUTOR = $DESTDIR$TUTORSUBLOC
588DEST_SCRIPT = $DESTDIR$SCRIPTLOC
589DEST_PRINT = $DESTDIR$PRINTSUBLOC
590DEST_MAN = $DESTDIR$MANSUBDIR
591
592# These are directories, create them when needed.
593:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
Bram Moolenaar1e015462005-09-25 22:16:38 +0000594 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG
595 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
596 $DEST_SCRIPT $DEST_PRINT $DEST_MAN
Bram Moolenaar071d4272004-06-13 20:20:40 +0000597
598#
599# I N S T A L L
600#
601install:
602 @if not os.path.isdir(_no.DEST_BIN):
603 @try:
604 :mkdir $DEST_BIN
605 @except:
606 @ pass
607 @if os.access(_no.DEST_BIN, os.W_OK):
608 # Bin directory is writable, install directly.
609 :update installvim installtools install-languages install-icons
610 @else:
611 # Bin directory is not writable, need to become root.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000612 :print The destination directory "$DEST_BIN" is not writable.
613 :print If this is the wrong directory, use PREFIX to specify another one.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000614 :print Otherwise, type the root password to continue installing.
615 :asroot $AAP install
616
617installvim {virtual}: installvimbin installruntime installlinks \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000618 installhelplinks installmacros installtutor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619
620installvimbin {virtual}{force}: $Target $DEST_BIN
Bram Moolenaar1e015462005-09-25 22:16:38 +0000621 exe = $DEST_BIN/$VIMTARGET
622 @if os.path.exists(exe):
623 # Move the old executable aside and delete it. Any other method
624 # may cause a crash if the executable is currently being used.
625 :move {force} $exe $(exe).rm
626 :del {force} $(exe).rm
627 :copy $VIMTARGET $DEST_BIN
628 :do strip $exe
629 :chmod $BINMOD $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +0000630# may create a link to the new executable from /usr/bin/vi
Bram Moolenaar1e015462005-09-25 22:16:38 +0000631 @if _no.get("LINKIT"):
632 :sys $LINKIT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633
634# install the help files; first adjust the contents for the location
635installruntime {virtual}{force}: $HELPSOURCE/vim.1 $DEST_MAN $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000636 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
637 $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000638 $DEST_PRINT
Bram Moolenaar1e015462005-09-25 22:16:38 +0000639 :print generating $DEST_MAN/$(VIMNAME).1
640 :cat $HELPSOURCE/vim.1 |
641 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
642 :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) |
643 :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) |
644 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) |
645 :eval re.sub(_no.VIMLOC + "/vimrc",
646 _no.VIMRCLOC + "/vimrc", stdin) |
647 :eval re.sub(_no.VIMLOC + "/gvimrc",
648 _no.VIMRCLOC + "/gvimrc", stdin) |
649 :eval re.sub(_no.VIMLOC + "/menu.vim",
650 _no.SCRIPTLOC + "/menu.vim", stdin) |
651 :eval re.sub(_no.VIMLOC + "/bugreport.vim",
652 _no.SCRIPTLOC + "/bugreport.vim", stdin) |
653 :eval re.sub(_no.VIMLOC + "/filetype.vim",
654 _no.SCRIPTLOC + "/filetype.vim", stdin) |
655 :eval re.sub(_no.VIMLOC + "/ftoff.vim",
656 _no.SCRIPTLOC + "/ftoff.vim", stdin) |
657 :eval re.sub(_no.VIMLOC + "/scripts.vim",
658 _no.SCRIPTLOC + "/scripts.vim", stdin) |
659 :eval re.sub(_no.VIMLOC + "/optwin.vim",
660 _no.SCRIPTLOC + "/optwin.vim", stdin) |
661 :eval re.sub(_no.VIMLOC + "/\\*.ps",
662 _no.SCRIPTLOC + "/*.ps", stdin)
663 >! $DEST_MAN/$(VIMNAME).1
664 :chmod $MANMOD $DEST_MAN/$(VIMNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000665
Bram Moolenaar1e015462005-09-25 22:16:38 +0000666 :print generating $DEST_MAN/$(VIMNAME)tutor.1
667 :cat $HELPSOURCE/vimtutor.1 |
668 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
669 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin)
670 >! $DEST_MAN/$(VIMNAME)tutor.1
671 :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000672
Bram Moolenaar1e015462005-09-25 22:16:38 +0000673 :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1
674 :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000675
Bram Moolenaar1e015462005-09-25 22:16:38 +0000676 :print generating $DEST_MAN/$(EVIMNAME).1
677 :cat $HELPSOURCE/evim.1 |
678 :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin)
679 >! $DEST_MAN/$(EVIMNAME).1
680 :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000681
682 :cd $HELPSOURCE
683 @try:
684 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
685 @except:
686 XTRA = # It's OK if there are no matches.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000687 :copy *.txt tags $XTRA $DEST_HELP
Bram Moolenaar071d4272004-06-13 20:20:40 +0000688 :cd -
689 :cd $DEST_HELP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000690 :chmod $HELPMOD *.txt tags $XTRA
Bram Moolenaar071d4272004-06-13 20:20:40 +0000691 :cd -
Bram Moolenaar1e015462005-09-25 22:16:38 +0000692 :copy $HELPSOURCE/*.pl $DEST_HELP
693 :chmod $SCRIPTMOD $DEST_HELP/*.pl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000694# install the menu files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000695 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
696 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
697 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
698 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
699 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
700 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000701# install the evim file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000702 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
703 :chmod $VIMSCRIPTMOD $MSWIN_FILE
704 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
705 :chmod $VIMSCRIPTMOD $EVIM_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000706# install the bugreport file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000707 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
708 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000709# install the example vimrc files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000710 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
711 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
712 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
713 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714# install the file type detection files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000715 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
716 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
717 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
718 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
719 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
720 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
721 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
722 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
723 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
724 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
725 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
726 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
727 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
728 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
729 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
730 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000731# install the print resource files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000732 :copy $PRINTSOURCE/*.ps $DEST_PRINT
733 :chmod $FILEMOD $DEST_PRINT/*.ps
Bram Moolenaar071d4272004-06-13 20:20:40 +0000734# install the colorscheme files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000735 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
736 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000737# install the syntax files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000738 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
739 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000740# install the indent files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000741 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
742 :chmod $HELPMOD $DEST_IND/*.vim
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000743# install the standard autoload files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000744 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
745 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000746# install the standard plugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000747 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
748 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000749# install the ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000750 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
751 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000752# install the compiler files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000753 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
754 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000755
756installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
Bram Moolenaar1e015462005-09-25 22:16:38 +0000757 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
758 # Delete any CVS and AAPDIR directories.
759 # Use the ":tree" command if possible. It was added later, fall back
760 # to using "find" when it doesn't work.
761 @try:
762 :tree $DEST_MACRO {dirname = CVS}
763 :del {recursive} $name
764 :tree $DEST_MACRO {dirname = AAPDIR}
765 :del {recursive} $name
766 :tree $DEST_MACRO {dirname = .*}
767 :chmod $DIRMOD $name
768 :tree $DEST_MACRO {filename = .*}
769 :chmod $FILEMOD $name
770 @except:
771 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
772 @ if ok and cvsdirs:
773 :del {recursive} $cvsdirs
774 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
775 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
776 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000777
778# install the tutor files
779installtutor {virtual}{force}: $TUTORSOURCE $DEST_VIM $DEST_RT $DEST_TUTOR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000780 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
781 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
782 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
783 :chmod $HELPMOD $DEST_TUTOR/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000784
785# install helper program xxd
786installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000787 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS
788 xxd = $DEST_BIN/xxd$EXESUF
789 @if os.path.exists(xxd):
790 :move {force} $xxd $(xxd).rm
791 :del $(xxd).rm
792 :copy xxd/xxd$EXESUF $DEST_BIN
793 :do strip $DEST_BIN/xxd$EXESUF
794 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
795 :copy $HELPSOURCE/xxd.1 $DEST_MAN
796 :chmod $MANMOD $DEST_MAN/xxd.1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000797# install the runtime tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000798 @try:
799 @ if aap_has(":tree"):
800 # New method: copy everything and delete CVS and AAPDIR dirs
801 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
802 :tree $DEST_TOOLS {dirname = CVS}
803 :delete {recursive} $name
804 :tree $DEST_TOOLS {dirname = AAPDIR}
805 :delete {recursive} $name
806 @except:
807 # Old method: copy only specific files and directories.
808 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
809 :chmod $FILEMOD $DEST_TOOLS/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000810# replace the path in some tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000811 :progsearch perlpath perl
812 @if perlpath:
813 :cat $TOOLSSOURCE/efm_perl.pl |
814 :eval re.sub("/usr/bin/perl", perlpath, stdin)
815 >! $DEST_TOOLS/efm_perl.pl
816 @else:
817 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000818
Bram Moolenaar1e015462005-09-25 22:16:38 +0000819 :progsearch awkpath nawk gawk awk
820 @if awkpath:
821 :cat $TOOLSSOURCE/mve.awk |
822 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
823 >! $DEST_TOOLS/mve.awk
824 @else:
825 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000826
Bram Moolenaar1e015462005-09-25 22:16:38 +0000827 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
Bram Moolenaar071d4272004-06-13 20:20:40 +0000828
829# install the language specific files, if they were unpacked
830install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000831 @if _no.MAKEMO:
832 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
833 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
834 @if os.path.exists(_no.LANGSOURCE):
835 :print installing language files
836 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
837 :chmod $FILEMOD $DEST_LANG/*.vim
838 @if os.path.exists(_no.KMAPSOURCE):
839 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
840 :chmod $FILEMOD $DEST_KMAP/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000841
Bram Moolenaar071d4272004-06-13 20:20:40 +0000842# install the icons for KDE, if the directory exists and the icon doesn't.
843ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
844ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
845ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
846KDEPATH = $HOME/.kde/share/icons
847install-icons {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000848 gp = $ICON48PATH/gvim.png
849 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
850 :copy $SCRIPTSOURCE/vim48x48.png $gp
851 gp = $ICON32PATH/gvim.png
852 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
853 :copy $SCRIPTSOURCE/vim32x32.png $gp
854 gp = $ICON16PATH/gvim.png
855 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
856 :copy $SCRIPTSOURCE/vim16x16.png $gp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000857
858
859$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000860 @if not os.path.exists(_no.TOOLSSOURCE):
861 :print Runtime files not found.
862 :error You need to unpack the runtime archive before running "make install".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000863
864# create links from various names to vim. This is only done when the links
865# (or executables with the same name) don't exist yet.
866installlinks {virtual}: $GUI_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000867 $DEST_BIN/$EXTARGET \
868 $DEST_BIN/$VIEWTARGET \
869 $DEST_BIN/$RVIMTARGET \
870 $DEST_BIN/$RVIEWTARGET \
871 $INSTALLVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000872
873installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000874 $DEST_BIN/$GVIEWTARGET \
875 $DEST_BIN/$RGVIMTARGET \
876 $DEST_BIN/$RGVIEWTARGET \
877 $DEST_BIN/$EVIMTARGET \
878 $DEST_BIN/$EVIEWTARGET \
879 $INSTALLGVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000880
881installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
882installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
883
884# These dependencies use an empty buildcheck so that they are only done when
885# the target doesn't exist.
886$DEST_BIN/$EXTARGET: {buildcheck = }
887 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
888
889$DEST_BIN/$VIEWTARGET: {buildcheck = }
890 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
891
892$DEST_BIN/$GVIMTARGET: {buildcheck = }
893 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
894
895$DEST_BIN/$GVIEWTARGET: {buildcheck = }
896 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
897
898$DEST_BIN/$RVIMTARGET: {buildcheck = }
899 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
900
901$DEST_BIN/$RVIEWTARGET: {buildcheck = }
902 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
903
904$DEST_BIN/$RGVIMTARGET: {buildcheck = }
905 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
906
907$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
908 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
909
910$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
911 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
912
913$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
914 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
915
916$DEST_BIN/$EVIMTARGET: {buildcheck = }
917 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
918
919$DEST_BIN/$EVIEWTARGET: {buildcheck = }
920 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
921
Bram Moolenaar1e015462005-09-25 22:16:38 +0000922# create links for the manual pages with various names to vim. This is only
Bram Moolenaar071d4272004-06-13 20:20:40 +0000923# done when the links (or manpages with the same name) don't exist yet.
924installhelplinks {virtual}: $GUI_MAN_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000925 $DEST_MAN/$(EXNAME).1 \
926 $DEST_MAN/$(VIEWNAME).1 \
927 $DEST_MAN/$(RVIMNAME).1 \
928 $DEST_MAN/$(RVIEWNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000929
930installghelplinks {virtual}: $DEST_MAN/$(GVIMNAME).1 \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000931 $DEST_MAN/$(GVIEWNAME).1 \
932 $DEST_MAN/$(RGVIMNAME).1 \
933 $DEST_MAN/$(RGVIEWNAME).1 \
934 $DEST_MAN/$(GVIMDIFFNAME).1 \
935 $DEST_MAN/$(EVIEWNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000936
937$DEST_MAN/$(EXNAME).1: {buildcheck = }
938 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(EXNAME).1
939
940$DEST_MAN/$(VIEWNAME).1: {buildcheck = }
941 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(VIEWNAME).1
942
943$DEST_MAN/$(GVIMNAME).1: {buildcheck = }
944 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIMNAME).1
945
946$DEST_MAN/$(GVIEWNAME).1: {buildcheck = }
947 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIEWNAME).1
948
949$DEST_MAN/$(RVIMNAME).1: {buildcheck = }
950 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIMNAME).1
951
952$DEST_MAN/$(RVIEWNAME).1: {buildcheck = }
953 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIEWNAME).1
954
955$DEST_MAN/$(RGVIMNAME).1: {buildcheck = }
956 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIMNAME).1
957
958$DEST_MAN/$(RGVIEWNAME).1: {buildcheck = }
959 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIEWNAME).1
960
961$DEST_MAN/$(GVIMDIFFNAME).1: {buildcheck = }
962 :sys cd $DEST_MAN; ln -s $(VIMDIFFNAME).1 $(GVIMDIFFNAME).1
963
964$DEST_MAN/$(EVIEWNAME).1: {buildcheck = }
965 :sys cd $DEST_MAN; ln -s $(EVIMNAME).1 $(EVIEWNAME).1
966
967#
968# U N I N S T A L L
969#
970uninstall {virtual}{force}: uninstall_runtime
971 :del {force} $DEST_BIN/$VIMTARGET
972 :del {force} $DEST_MAN/$(VIMNAME).1 $DEST_MAN/$(VIMNAME)tutor.1
973 :del {force} $DEST_BIN/vimtutor
974 :del {force} $DEST_BIN/xxd$EXESUF $DEST_MAN/xxd.1
975 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
976 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
977 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
978 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
979 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
980 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
981 :del {force} $DEST_MAN/$(EXNAME).1 $DEST_MAN/$(VIEWNAME).1
982 :del {force} $DEST_MAN/$(GVIMNAME).1 $DEST_MAN/$(GVIEWNAME).1
983 :del {force} $DEST_MAN/$(RVIMNAME).1 $DEST_MAN/$(RVIEWNAME).1
984 :del {force} $DEST_MAN/$(RGVIMNAME).1 $DEST_MAN/$(RGVIEWNAME).1
985 :del {force} $DEST_MAN/$(VIMDIFFNAME).1 $DEST_MAN/$(GVIMDIFFNAME).1
986 :del {force} $DEST_MAN/$(EVIMNAME).1 $DEST_MAN/$(EVIEWNAME).1
987
988# Note: "deldir" will fail if any files were added after "make install", that
989# is intentionally: Keep files the user added.
990uninstall_runtime {virtual}{force}:
991 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
992 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
993 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
994 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
995 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
996 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
997 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
998 :del {force} $SYS_OPTWIN_FILE
999 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1000 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1001 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1002 :del {force} $DEST_PRINT/*.ps
1003 :del {force}{recursive} $DEST_MACRO
1004 :del {force}{recursive} $DEST_TUTOR
1005 :del {force}{recursive} $DEST_TOOLS
1006 :del {force}{recursive} $DEST_LANG
1007 :del {force}{recursive} $DEST_KMAP
1008 :del {force}{recursive} $DEST_COMP
1009 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1010 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001011 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +00001012 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001013 :deldir {force} $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
Bram Moolenaar1e015462005-09-25 22:16:38 +00001014# This will fail when other Vim versions are installed, no worries.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001015 @try:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001016 :deldir $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001017 @except:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001018 :print Cannot delete $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001019
1020
1021# vim: sts=4 sw=4 :