blob: 1a36545799c62ef4b4c8541adead6a37087e1a66 [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
Bram Moolenaara226a6d2006-02-26 23:59:20 +000076# Unfortunately "-M" doesn't work when building for two architectures. Switch
77# back to PPC only.
78@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
79 CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
80
Bram Moolenaar071d4272004-06-13 20:20:40 +000081# A "PREFIX=dir" argument overrules the value of $prefix
82@if _no.get("PREFIX"):
83 prefix = $PREFIX
84
85# Don't want "~/" in prefix.
86prefix = `os.path.expanduser(prefix)`
87
88#
89# G U I variant
90#
91# The GUI is selected by configure, a lot of other things depend on it.
92#
93:variant GUI
94 GTK
Bram Moolenaar1e015462005-09-25 22:16:38 +000095 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
96 gui_gtk_f.c
97 GUI_OBJ =
98 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
99 GUI_IPATH = $GUI_INC_LOC
100 GUI_LIBS_DIR = $GUI_LIB_LOC
101 GUI_LIBS1 =
102 GUI_LIBS2 = $GTK_LIBNAME
103 GUI_TARGETS = installglinks
104 GUI_MAN_TARGETS = installghelplinks
105 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106 MOTIF
Bram Moolenaar1e015462005-09-25 22:16:38 +0000107 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
108 gui_xmdlg.c gui_xmebw.c
109 GUI_OBJ =
110 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
111 GUI_IPATH = $GUI_INC_LOC
112 GUI_LIBS_DIR = $GUI_LIB_LOC
113 GUI_LIBS1 =
114 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
115 GUI_TARGETS = installglinks
116 GUI_MAN_TARGETS = installghelplinks
117 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118 ATHENA
Bram Moolenaar1e015462005-09-25 22:16:38 +0000119 # XAW_LIB et al. can be overruled to use Xaw3d widgets
120 XAW_LIB ?= -lXaw
121 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
122 gui_at_sb.c gui_at_fs.c
123 GUI_OBJ =
124 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
125 GUI_IPATH = $GUI_INC_LOC
126 GUI_LIBS_DIR = $GUI_LIB_LOC
127 GUI_LIBS1 = $XAW_LIB
128 GUI_LIBS2 = -lXt
129 GUI_TARGETS = installglinks
130 GUI_MAN_TARGETS = installghelplinks
131 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132 NEXTAW
Bram Moolenaar1e015462005-09-25 22:16:38 +0000133 # XAW_LIB et al. can be overruled to use Xaw3d widgets
134 XAW_LIB ?= -lXaw
135 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
136 gui_at_fs.c
137 GUI_OBJ =
138 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
139 GUI_IPATH = $GUI_INC_LOC
140 GUI_LIBS_DIR = $GUI_LIB_LOC
141 GUI_LIBS1 = $NEXTAW_LIB
142 GUI_LIBS2 = -lXt
143 GUI_TARGETS = installglinks
144 GUI_MAN_TARGETS = installghelplinks
145 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146 PHOTONGUI
Bram Moolenaar1e015462005-09-25 22:16:38 +0000147 GUI_SRC = gui.c gui_photon.c pty.c
148 GUI_OBJ =
149 GUI_DEFS = -DFEAT_GUI_PHOTON
150 GUI_IPATH =
151 GUI_LIBS_DIR =
152 GUI_LIBS1 = -lph -lphexlib
153 GUI_LIBS2 =
154 GUI_TARGETS = installglinks
155 GUI_MAN_TARGETS = installghelplinks
156 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000157 *
Bram Moolenaar1e015462005-09-25 22:16:38 +0000158 GUI_SRC =
159 GUI_OBJ =
160 GUI_DEFS =
161 GUI_IPATH =
162 GUI_LIBS_DIR =
163 GUI_LIBS1 =
164 GUI_LIBS2 =
165 GUI_TARGETS =
166 GUI_MAN_TARGETS =
167 GUI_TESTTARGET =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000168
169
170PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000171POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
173CPPFLAGS =
174
175ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
176LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000177LIBS = $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 +0000178
179Target = $VIMNAME
180
181# reconfig target also builds Vim (reconfiguration is handled above).
182reconfig {virtual}: $Target
183
184
185# Execute the test scripts. Run these after compiling Vim, before installing.
186#
187# This will produce a lot of garbage on your screen, including a few error
188# messages. Don't worry about that.
189# If there is a real error, there will be a difference between "test.out" and
190# a "test99.ok" file.
191# If everything is allright, the final message will be "ALL DONE".
192#
193test check:
194 VimProg = ../$Target
195 :execute testdir/main.aap $GUI_TESTTARGET
196
197testclean {virtual}:
198 :del {force} testdir/*.out testdir/test.log
199
Bram Moolenaar071d4272004-06-13 20:20:40 +0000200# When no fetch target exists we are not a child of the ../main.aap recipe,
201# Use ../main.aap to do the fetching.
202# --- If you get an error here for wrong number of arguments, you need to
203# update to a newer version of A-A-P.
204@if not has_target("fetch"):
205 fetch:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000206 :execute ../main.aap fetch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207
208
209# All the source files that need to be compiled.
210# Some are optional and depend on configure.
211# "version.c" is missing, it's always compiled (see below).
212Source =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000213 buffer.c
214 charset.c
215 diff.c
216 digraph.c
217 edit.c
218 eval.c
219 ex_cmds.c
220 ex_cmds2.c
221 ex_docmd.c
222 ex_eval.c
223 ex_getln.c
224 fileio.c
225 fold.c
226 getchar.c
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000227 hardcopy.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000228 hashtable.c
229 if_cscope.c
230 if_xcmdsrv.c
231 main.c
232 mark.c
233 memfile.c
234 memline.c
235 menu.c
236 message.c
237 misc1.c
238 misc2.c
239 move.c
240 mbyte.c
241 normal.c
242 ops.c
243 option.c
244 os_unix.c
245 auto/pathdef.c
Bram Moolenaarbb15b652005-10-03 21:52:09 +0000246 popupmenu.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000247 quickfix.c
248 regexp.c
249 screen.c
250 search.c
251 spell.c
252 syntax.c
253 tag.c
254 term.c
255 ui.c
256 undo.c
257 window.c
258 $OS_EXTRA_SRC
259 $GUI_SRC
260 $HANGULIN_SRC
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000261 $MZSCHEME_SRC
Bram Moolenaar1e015462005-09-25 22:16:38 +0000262 $PERL_SRC
263 $NETBEANS_SRC
264 $PYTHON_SRC
265 $TCL_SRC
266 $RUBY_SRC
267 $SNIFF_SRC
268 $WORKSHOP_SRC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000269
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000270Objects =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000271 $GUI_OBJ
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000272
Bram Moolenaar071d4272004-06-13 20:20:40 +0000273# TODO: make is still used for subdirectories, need to write a recipe.
274MAKE ?= make
275
276all: $Target
277
278# This dependency is required to build auto/osdef.h before automatic
279# dependencies are generated.
280$Source version.c : auto/osdef.h
281
282# Need to mention that the target also depends on version.c, since it's not
283# inluded in $Source
284$Target : version.c
285
286# Some sources are to be found in the "auto" directory.
287SRCPATH += auto
288
289# When building Vim always compile version.c to get the timestamp.
290:filetype
291 declare my_prog
292:attr {filetype = my_prog} $Target
293
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000294:program $Target : $Source $Objects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295
296:action build my_prog object
Bram Moolenaar1e015462005-09-25 22:16:38 +0000297 version_obj = `src2obj("version.c")`
298 :do compile {target = $version_obj} version.c
299 #:do build {target = $target {filetype = program}} $source $version_obj
300 link_sed = $BDIR/link.sed
301 @if os.path.exists(link_sed):
302 :move {force} $link_sed auto/link.sed
303 @else:
304 :del {force} auto/link.sed
305 :update link2.sh
306 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
307 -o $target $source $version_obj $LIBS" \
308 MAKE="aap" sh ./link2.sh
309 :copy {force} auto/link.sed $BDIR/link.sed
Bram Moolenaar071d4272004-06-13 20:20:40 +0000310
311# "link.sh" must be modified for A-A-P
312link2.sh : link.sh
313 :print Adjusting $-source for A-A-P.
314 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000315 >! $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000316
317xxd/xxd$EXESUF: xxd/xxd.c
318 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000319 $MAKE -f Makefile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320
321# Build the language specific files if they were unpacked.
322# Generate the converted .mo files separately, it's no problem if this fails.
323languages {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000324 @if _no.MAKEMO:
325 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
326 @try:
327 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
328 @except:
329 :print Generated converted language files failed, continuing
Bram Moolenaar071d4272004-06-13 20:20:40 +0000330
331# Update the *.po files for changes in the sources. Only run manually.
332update-po {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000333 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334
335auto/if_perl.c: if_perl.xs
Bram Moolenaar1e015462005-09-25 22:16:38 +0000336 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
337 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
338 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000339
340auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
Bram Moolenaar1e015462005-09-25 22:16:38 +0000341 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000342
343pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
344
345auto/pathdef.c: auto/config.aap
Bram Moolenaar1e015462005-09-25 22:16:38 +0000346 :print Creating $target
347 :print >! $target /* pathdef.c */
348 :print >> $target /* This file is automatically created by main.aap */
349 :print >> $target /* DO NOT EDIT! Change main.aap only. */
350 :print >> $target $#include "vim.h"
351 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
352 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
353 v = $CC -c -I$srcdir $CFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000354 @v = string.replace(v, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000355 :print >> $target char_u *all_cflags = (char_u *)"$v";
356 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
357 link_sed = $BDIR/link.sed
358 @if os.path.exists(link_sed):
359 # filter $linkcmd through $BDIR/link.sed
360 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000361 @linkcmd = string.replace(linkcmd, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000362 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
363 @if _no.get("COMPILEDBY"):
364 who = $COMPILEDBY
365 where = ''
366 @else:
367 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
Bram Moolenaar071d4272004-06-13 20:20:40 +0000368
Bram Moolenaar1e015462005-09-25 22:16:38 +0000369 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
370 :print >> $target char_u *compiled_user = (char_u *)"$who";
371 :print >> $target char_u *compiled_sys = (char_u *)"$where";
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372
373
374### Names of the programs and targets
Bram Moolenaar1e015462005-09-25 22:16:38 +0000375VIMTARGET = $VIMNAME$EXESUF
376EXTARGET = $EXNAME$LNKSUF
377VIEWTARGET = $VIEWNAME$LNKSUF
378GVIMNAME = g$VIMNAME
379GVIMTARGET = $GVIMNAME$LNKSUF
380GVIEWNAME = g$VIEWNAME
381GVIEWTARGET = $GVIEWNAME$LNKSUF
382RVIMNAME = r$VIMNAME
383RVIMTARGET = $RVIMNAME$LNKSUF
384RVIEWNAME = r$VIEWNAME
385RVIEWTARGET = $RVIEWNAME$LNKSUF
386RGVIMNAME = r$GVIMNAME
387RGVIMTARGET = $RGVIMNAME$LNKSUF
388RGVIEWNAME = r$GVIEWNAME
389RGVIEWTARGET = $RGVIEWNAME$LNKSUF
390VIMDIFFNAME = $(VIMNAME)diff
391GVIMDIFFNAME = g$VIMDIFFNAME
392VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
393GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
394EVIMNAME = e$VIMNAME
395EVIMTARGET = $EVIMNAME$LNKSUF
396EVIEWNAME = e$VIEWNAME
397EVIEWTARGET = $EVIEWNAME$LNKSUF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000398
399### Names of the tools that are also made
400TOOLS = xxd/xxd$EXESUF
401
402# Root of the installation tree. Empty for a normal install, set to an
403# existing path to install into a special place (for generating a package).
404DESTDIR ?=
405
406### Location of man pages
407MANSUBDIR = $MANDIR/man1
408
409### Location of Vim files (should not need to be changed, and
410### some things might not work when they are changed!)
411VIMDIR = /vim
412@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
413VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
414HELPSUBDIR = /doc
415COLSUBDIR = /colors
416SYNSUBDIR = /syntax
417INDSUBDIR = /indent
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000418AUTOSUBDIR = /autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +0000419PLUGSUBDIR = /plugin
420FTPLUGSUBDIR = /ftplugin
421LANGSUBDIR = /lang
422COMPSUBDIR = /compiler
423KMAPSUBDIR = /keymap
424MACROSUBDIR = /macros
425TOOLSSUBDIR = /tools
426TUTORSUBDIR = /tutor
427PRINTSUBDIR = /print
428PODIR = po
429
Bram Moolenaar1e015462005-09-25 22:16:38 +0000430### VIMLOC common root of the Vim files (all versions)
431### VIMRTLOC common root of the runtime Vim files (this version)
432### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000433### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000434### HELPSUBLOC location for help files
435### COLSUBLOC location for colorscheme files
436### SYNSUBLOC location for syntax files
437### INDSUBLOC location for indent files
438### AUTOSUBLOC location for standard autoload files
439### PLUGSUBLOC location for standard plugin files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000440### FTPLUGSUBLOC location for ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000441### LANGSUBLOC location for language files
442### COMPSUBLOC location for compiler files
443### KMAPSUBLOC location for keymap files
444### MACROSUBLOC location for macro files
445### TOOLSSUBLOC location for tools files
446### TUTORSUBLOC location for tutor files
447### PRINTSUBLOC location for print files
448### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000449### You can override these if you want to install them somewhere else.
450### Edit feature.h for compile-time settings.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000451VIMLOC = $DATADIR$VIMDIR
452VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
453VIMRCLOC = $VIMLOC
454HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
455COLSUBLOC = $VIMRTLOC$COLSUBDIR
456SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
457INDSUBLOC = $VIMRTLOC$INDSUBDIR
458AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
459PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
460FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
461LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
462COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
463KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
464MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
465TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
466TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
467PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
468SCRIPTLOC = $VIMRTLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000469
470### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
471### the runtime directory is not below it.
472#VIMRUNTIMEDIR = $VIMRTLOC
473
474### Name of the evim file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000475EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
476MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000477
478### Name of the menu file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000479SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
481SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
482
483### Name of the bugreport file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000484SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485
486### Name of the file type detection file target.
487SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
488
489### Name of the file type detection file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000490SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000491
492### Name of the file type detection script file target.
493SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
494
495### Name of the ftplugin-on file target.
496SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
497
498### Name of the ftplugin-off file target.
499SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
500
501### Name of the indent-on file target.
502SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
503
504### Name of the indent-off file target.
505SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
506
507### Name of the option window script file target.
508SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
509
510### Permissions for binaries
511BINMOD = 755
512
513### Permissions for man page
514MANMOD = 644
515
516### Permissions for help files
517HELPMOD = 644
518
519### Permissions for Perl and shell scripts
520SCRIPTMOD = 755
521
522### Permission for Vim script files (menu.vim, bugreport.vim, ..)
523VIMSCRIPTMOD = 644
524
525### Permissions for all directories that are created
526DIRMOD = 755
527
528### Permissions for all other files that are created
529FILEMOD = 644
530
531# Where to copy the man and help files from
532HELPSOURCE = ../runtime/doc
533
534# Where to copy the script files from (menu, bugreport)
535SCRIPTSOURCE = ../runtime
536
537# Where to copy the colorscheme files from
538COLSOURCE = ../runtime/colors
539
540# Where to copy the syntax files from
541SYNSOURCE = ../runtime/syntax
542
543# Where to copy the indent files from
544INDSOURCE = ../runtime/indent
545
546# Where to copy the standard plugin files from
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000547AUTOSOURCE = ../runtime/autoload
548
549# Where to copy the standard plugin files from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000550PLUGSOURCE = ../runtime/plugin
551
552# Where to copy the ftplugin files from
553FTPLUGSOURCE = ../runtime/ftplugin
554
555# Where to copy the macro files from
556MACROSOURCE = ../runtime/macros
557
558# Where to copy the tools files from
559TOOLSSOURCE = ../runtime/tools
560
561# Where to copy the tutor files from
562TUTORSOURCE = ../runtime/tutor
563
564# Where to look for language specific files
565LANGSOURCE = ../runtime/lang
566
567# Where to look for compiler files
568COMPSOURCE = ../runtime/compiler
569
570# Where to look for keymap files
571KMAPSOURCE = ../runtime/keymap
572
573# Where to look for print resource files
574PRINTSOURCE = ../runtime/print
575
576# abbreviations
577DEST_BIN = $DESTDIR$BINDIR
578DEST_VIM = $DESTDIR$VIMLOC
579DEST_RT = $DESTDIR$VIMRTLOC
580DEST_HELP = $DESTDIR$HELPSUBLOC
581DEST_COL = $DESTDIR$COLSUBLOC
582DEST_SYN = $DESTDIR$SYNSUBLOC
583DEST_IND = $DESTDIR$INDSUBLOC
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000584DEST_AUTO = $DESTDIR$AUTOSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000585DEST_PLUG = $DESTDIR$PLUGSUBLOC
586DEST_FTP = $DESTDIR$FTPLUGSUBLOC
587DEST_LANG = $DESTDIR$LANGSUBLOC
588DEST_COMP = $DESTDIR$COMPSUBLOC
589DEST_KMAP = $DESTDIR$KMAPSUBLOC
590DEST_MACRO = $DESTDIR$MACROSUBLOC
591DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
592DEST_TUTOR = $DESTDIR$TUTORSUBLOC
593DEST_SCRIPT = $DESTDIR$SCRIPTLOC
594DEST_PRINT = $DESTDIR$PRINTSUBLOC
595DEST_MAN = $DESTDIR$MANSUBDIR
596
597# These are directories, create them when needed.
598:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
Bram Moolenaar1e015462005-09-25 22:16:38 +0000599 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG
600 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
601 $DEST_SCRIPT $DEST_PRINT $DEST_MAN
Bram Moolenaar071d4272004-06-13 20:20:40 +0000602
603#
604# I N S T A L L
605#
606install:
607 @if not os.path.isdir(_no.DEST_BIN):
608 @try:
609 :mkdir $DEST_BIN
610 @except:
611 @ pass
612 @if os.access(_no.DEST_BIN, os.W_OK):
613 # Bin directory is writable, install directly.
614 :update installvim installtools install-languages install-icons
615 @else:
616 # Bin directory is not writable, need to become root.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000617 :print The destination directory "$DEST_BIN" is not writable.
618 :print If this is the wrong directory, use PREFIX to specify another one.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619 :print Otherwise, type the root password to continue installing.
620 :asroot $AAP install
621
622installvim {virtual}: installvimbin installruntime installlinks \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000623 installhelplinks installmacros installtutor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624
625installvimbin {virtual}{force}: $Target $DEST_BIN
Bram Moolenaar1e015462005-09-25 22:16:38 +0000626 exe = $DEST_BIN/$VIMTARGET
627 @if os.path.exists(exe):
628 # Move the old executable aside and delete it. Any other method
629 # may cause a crash if the executable is currently being used.
630 :move {force} $exe $(exe).rm
631 :del {force} $(exe).rm
632 :copy $VIMTARGET $DEST_BIN
633 :do strip $exe
634 :chmod $BINMOD $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +0000635# may create a link to the new executable from /usr/bin/vi
Bram Moolenaar1e015462005-09-25 22:16:38 +0000636 @if _no.get("LINKIT"):
637 :sys $LINKIT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000638
639# install the help files; first adjust the contents for the location
640installruntime {virtual}{force}: $HELPSOURCE/vim.1 $DEST_MAN $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000641 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
642 $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000643 $DEST_PRINT
Bram Moolenaar1e015462005-09-25 22:16:38 +0000644 :print generating $DEST_MAN/$(VIMNAME).1
645 :cat $HELPSOURCE/vim.1 |
646 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
647 :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) |
648 :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) |
649 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) |
650 :eval re.sub(_no.VIMLOC + "/vimrc",
651 _no.VIMRCLOC + "/vimrc", stdin) |
652 :eval re.sub(_no.VIMLOC + "/gvimrc",
653 _no.VIMRCLOC + "/gvimrc", stdin) |
654 :eval re.sub(_no.VIMLOC + "/menu.vim",
655 _no.SCRIPTLOC + "/menu.vim", stdin) |
656 :eval re.sub(_no.VIMLOC + "/bugreport.vim",
657 _no.SCRIPTLOC + "/bugreport.vim", stdin) |
658 :eval re.sub(_no.VIMLOC + "/filetype.vim",
659 _no.SCRIPTLOC + "/filetype.vim", stdin) |
660 :eval re.sub(_no.VIMLOC + "/ftoff.vim",
661 _no.SCRIPTLOC + "/ftoff.vim", stdin) |
662 :eval re.sub(_no.VIMLOC + "/scripts.vim",
663 _no.SCRIPTLOC + "/scripts.vim", stdin) |
664 :eval re.sub(_no.VIMLOC + "/optwin.vim",
665 _no.SCRIPTLOC + "/optwin.vim", stdin) |
666 :eval re.sub(_no.VIMLOC + "/\\*.ps",
667 _no.SCRIPTLOC + "/*.ps", stdin)
668 >! $DEST_MAN/$(VIMNAME).1
669 :chmod $MANMOD $DEST_MAN/$(VIMNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670
Bram Moolenaar1e015462005-09-25 22:16:38 +0000671 :print generating $DEST_MAN/$(VIMNAME)tutor.1
672 :cat $HELPSOURCE/vimtutor.1 |
673 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
674 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin)
675 >! $DEST_MAN/$(VIMNAME)tutor.1
676 :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677
Bram Moolenaar1e015462005-09-25 22:16:38 +0000678 :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1
679 :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000680
Bram Moolenaar1e015462005-09-25 22:16:38 +0000681 :print generating $DEST_MAN/$(EVIMNAME).1
682 :cat $HELPSOURCE/evim.1 |
683 :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin)
684 >! $DEST_MAN/$(EVIMNAME).1
685 :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686
687 :cd $HELPSOURCE
688 @try:
689 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
690 @except:
691 XTRA = # It's OK if there are no matches.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000692 :copy *.txt tags $XTRA $DEST_HELP
Bram Moolenaar071d4272004-06-13 20:20:40 +0000693 :cd -
694 :cd $DEST_HELP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000695 :chmod $HELPMOD *.txt tags $XTRA
Bram Moolenaar071d4272004-06-13 20:20:40 +0000696 :cd -
Bram Moolenaar1e015462005-09-25 22:16:38 +0000697 :copy $HELPSOURCE/*.pl $DEST_HELP
698 :chmod $SCRIPTMOD $DEST_HELP/*.pl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000699# install the menu files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000700 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
701 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
702 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
703 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
704 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
705 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000706# install the evim file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000707 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
708 :chmod $VIMSCRIPTMOD $MSWIN_FILE
709 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
710 :chmod $VIMSCRIPTMOD $EVIM_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000711# install the bugreport file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000712 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
713 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714# install the example vimrc files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000715 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
716 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
717 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
718 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000719# install the file type detection files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000720 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
721 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
722 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
723 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
724 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
725 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
726 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
727 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
728 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
729 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
730 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
731 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
732 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
733 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
734 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
735 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000736# install the print resource files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000737 :copy $PRINTSOURCE/*.ps $DEST_PRINT
738 :chmod $FILEMOD $DEST_PRINT/*.ps
Bram Moolenaar071d4272004-06-13 20:20:40 +0000739# install the colorscheme files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000740 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
741 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000742# install the syntax files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000743 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
744 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000745# install the indent files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000746 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
747 :chmod $HELPMOD $DEST_IND/*.vim
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000748# install the standard autoload files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000749 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
750 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000751# install the standard plugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000752 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
753 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000754# install the ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000755 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
756 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000757# install the compiler files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000758 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
759 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760
761installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
Bram Moolenaar1e015462005-09-25 22:16:38 +0000762 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
763 # Delete any CVS and AAPDIR directories.
764 # Use the ":tree" command if possible. It was added later, fall back
765 # to using "find" when it doesn't work.
766 @try:
767 :tree $DEST_MACRO {dirname = CVS}
768 :del {recursive} $name
769 :tree $DEST_MACRO {dirname = AAPDIR}
770 :del {recursive} $name
771 :tree $DEST_MACRO {dirname = .*}
772 :chmod $DIRMOD $name
773 :tree $DEST_MACRO {filename = .*}
774 :chmod $FILEMOD $name
775 @except:
776 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
777 @ if ok and cvsdirs:
778 :del {recursive} $cvsdirs
779 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
780 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
781 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000782
783# install the tutor files
784installtutor {virtual}{force}: $TUTORSOURCE $DEST_VIM $DEST_RT $DEST_TUTOR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000785 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
786 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
787 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
788 :chmod $HELPMOD $DEST_TUTOR/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000789
790# install helper program xxd
791installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000792 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS
793 xxd = $DEST_BIN/xxd$EXESUF
794 @if os.path.exists(xxd):
795 :move {force} $xxd $(xxd).rm
796 :del $(xxd).rm
797 :copy xxd/xxd$EXESUF $DEST_BIN
798 :do strip $DEST_BIN/xxd$EXESUF
799 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
800 :copy $HELPSOURCE/xxd.1 $DEST_MAN
801 :chmod $MANMOD $DEST_MAN/xxd.1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000802# install the runtime tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000803 @try:
804 @ if aap_has(":tree"):
805 # New method: copy everything and delete CVS and AAPDIR dirs
806 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
807 :tree $DEST_TOOLS {dirname = CVS}
808 :delete {recursive} $name
809 :tree $DEST_TOOLS {dirname = AAPDIR}
810 :delete {recursive} $name
811 @except:
812 # Old method: copy only specific files and directories.
813 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
814 :chmod $FILEMOD $DEST_TOOLS/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000815# replace the path in some tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000816 :progsearch perlpath perl
817 @if perlpath:
818 :cat $TOOLSSOURCE/efm_perl.pl |
819 :eval re.sub("/usr/bin/perl", perlpath, stdin)
820 >! $DEST_TOOLS/efm_perl.pl
821 @else:
822 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000823
Bram Moolenaar1e015462005-09-25 22:16:38 +0000824 :progsearch awkpath nawk gawk awk
825 @if awkpath:
826 :cat $TOOLSSOURCE/mve.awk |
827 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
828 >! $DEST_TOOLS/mve.awk
829 @else:
830 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000831
Bram Moolenaar1e015462005-09-25 22:16:38 +0000832 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
Bram Moolenaar071d4272004-06-13 20:20:40 +0000833
834# install the language specific files, if they were unpacked
835install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000836 @if _no.MAKEMO:
837 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
838 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
839 @if os.path.exists(_no.LANGSOURCE):
840 :print installing language files
841 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
842 :chmod $FILEMOD $DEST_LANG/*.vim
843 @if os.path.exists(_no.KMAPSOURCE):
844 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
845 :chmod $FILEMOD $DEST_KMAP/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000846
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847# install the icons for KDE, if the directory exists and the icon doesn't.
848ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
849ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
850ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
851KDEPATH = $HOME/.kde/share/icons
852install-icons {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000853 gp = $ICON48PATH/gvim.png
854 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
855 :copy $SCRIPTSOURCE/vim48x48.png $gp
856 gp = $ICON32PATH/gvim.png
857 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
858 :copy $SCRIPTSOURCE/vim32x32.png $gp
859 gp = $ICON16PATH/gvim.png
860 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
861 :copy $SCRIPTSOURCE/vim16x16.png $gp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862
863
864$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000865 @if not os.path.exists(_no.TOOLSSOURCE):
866 :print Runtime files not found.
867 :error You need to unpack the runtime archive before running "make install".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000868
869# create links from various names to vim. This is only done when the links
870# (or executables with the same name) don't exist yet.
871installlinks {virtual}: $GUI_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000872 $DEST_BIN/$EXTARGET \
873 $DEST_BIN/$VIEWTARGET \
874 $DEST_BIN/$RVIMTARGET \
875 $DEST_BIN/$RVIEWTARGET \
876 $INSTALLVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000877
878installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000879 $DEST_BIN/$GVIEWTARGET \
880 $DEST_BIN/$RGVIMTARGET \
881 $DEST_BIN/$RGVIEWTARGET \
882 $DEST_BIN/$EVIMTARGET \
883 $DEST_BIN/$EVIEWTARGET \
884 $INSTALLGVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000885
886installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
887installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
888
889# These dependencies use an empty buildcheck so that they are only done when
890# the target doesn't exist.
891$DEST_BIN/$EXTARGET: {buildcheck = }
892 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
893
894$DEST_BIN/$VIEWTARGET: {buildcheck = }
895 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
896
897$DEST_BIN/$GVIMTARGET: {buildcheck = }
898 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
899
900$DEST_BIN/$GVIEWTARGET: {buildcheck = }
901 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
902
903$DEST_BIN/$RVIMTARGET: {buildcheck = }
904 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
905
906$DEST_BIN/$RVIEWTARGET: {buildcheck = }
907 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
908
909$DEST_BIN/$RGVIMTARGET: {buildcheck = }
910 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
911
912$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
913 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
914
915$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
916 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
917
918$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
919 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
920
921$DEST_BIN/$EVIMTARGET: {buildcheck = }
922 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
923
924$DEST_BIN/$EVIEWTARGET: {buildcheck = }
925 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
926
Bram Moolenaar1e015462005-09-25 22:16:38 +0000927# create links for the manual pages with various names to vim. This is only
Bram Moolenaar071d4272004-06-13 20:20:40 +0000928# done when the links (or manpages with the same name) don't exist yet.
929installhelplinks {virtual}: $GUI_MAN_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000930 $DEST_MAN/$(EXNAME).1 \
931 $DEST_MAN/$(VIEWNAME).1 \
932 $DEST_MAN/$(RVIMNAME).1 \
933 $DEST_MAN/$(RVIEWNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934
935installghelplinks {virtual}: $DEST_MAN/$(GVIMNAME).1 \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000936 $DEST_MAN/$(GVIEWNAME).1 \
937 $DEST_MAN/$(RGVIMNAME).1 \
938 $DEST_MAN/$(RGVIEWNAME).1 \
939 $DEST_MAN/$(GVIMDIFFNAME).1 \
940 $DEST_MAN/$(EVIEWNAME).1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000941
942$DEST_MAN/$(EXNAME).1: {buildcheck = }
943 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(EXNAME).1
944
945$DEST_MAN/$(VIEWNAME).1: {buildcheck = }
946 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(VIEWNAME).1
947
948$DEST_MAN/$(GVIMNAME).1: {buildcheck = }
949 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIMNAME).1
950
951$DEST_MAN/$(GVIEWNAME).1: {buildcheck = }
952 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIEWNAME).1
953
954$DEST_MAN/$(RVIMNAME).1: {buildcheck = }
955 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIMNAME).1
956
957$DEST_MAN/$(RVIEWNAME).1: {buildcheck = }
958 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIEWNAME).1
959
960$DEST_MAN/$(RGVIMNAME).1: {buildcheck = }
961 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIMNAME).1
962
963$DEST_MAN/$(RGVIEWNAME).1: {buildcheck = }
964 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIEWNAME).1
965
966$DEST_MAN/$(GVIMDIFFNAME).1: {buildcheck = }
967 :sys cd $DEST_MAN; ln -s $(VIMDIFFNAME).1 $(GVIMDIFFNAME).1
968
969$DEST_MAN/$(EVIEWNAME).1: {buildcheck = }
970 :sys cd $DEST_MAN; ln -s $(EVIMNAME).1 $(EVIEWNAME).1
971
972#
973# U N I N S T A L L
974#
975uninstall {virtual}{force}: uninstall_runtime
976 :del {force} $DEST_BIN/$VIMTARGET
977 :del {force} $DEST_MAN/$(VIMNAME).1 $DEST_MAN/$(VIMNAME)tutor.1
978 :del {force} $DEST_BIN/vimtutor
979 :del {force} $DEST_BIN/xxd$EXESUF $DEST_MAN/xxd.1
980 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
981 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
982 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
983 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
984 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
985 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
986 :del {force} $DEST_MAN/$(EXNAME).1 $DEST_MAN/$(VIEWNAME).1
987 :del {force} $DEST_MAN/$(GVIMNAME).1 $DEST_MAN/$(GVIEWNAME).1
988 :del {force} $DEST_MAN/$(RVIMNAME).1 $DEST_MAN/$(RVIEWNAME).1
989 :del {force} $DEST_MAN/$(RGVIMNAME).1 $DEST_MAN/$(RGVIEWNAME).1
990 :del {force} $DEST_MAN/$(VIMDIFFNAME).1 $DEST_MAN/$(GVIMDIFFNAME).1
991 :del {force} $DEST_MAN/$(EVIMNAME).1 $DEST_MAN/$(EVIEWNAME).1
992
993# Note: "deldir" will fail if any files were added after "make install", that
994# is intentionally: Keep files the user added.
995uninstall_runtime {virtual}{force}:
996 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
997 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
998 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
999 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1000 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1001 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1002 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1003 :del {force} $SYS_OPTWIN_FILE
1004 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1005 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1006 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1007 :del {force} $DEST_PRINT/*.ps
1008 :del {force}{recursive} $DEST_MACRO
1009 :del {force}{recursive} $DEST_TUTOR
1010 :del {force}{recursive} $DEST_TOOLS
1011 :del {force}{recursive} $DEST_LANG
1012 :del {force}{recursive} $DEST_KMAP
1013 :del {force}{recursive} $DEST_COMP
1014 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1015 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001016 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +00001017 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001018 :deldir {force} $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
Bram Moolenaar1e015462005-09-25 22:16:38 +00001019# This will fail when other Vim versions are installed, no worries.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001020 @try:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001021 :deldir $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001022 @except:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001023 :print Cannot delete $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001024
1025
1026# vim: sts=4 sw=4 :