blob: 83a9cd8ed24557e3369bcb073beeb526da6d01be [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:
9# PREFIX=dir Overrules the install directory.
10# Can be specified when installing only.
11# Example: aap install PREFIX=$HOME
12#
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())
17@ or not os.path.exists("auto/config.aap")):
18
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
28 @if not program_path("autoconf"):
29 :print Can't find autoconf, using existing configure script.
30 @else:
31 # Move configure aside, autoconf would overwrite it
32 :move {exist} configure configure.save
33 :sys autoconf
34 :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) >! auto/configure
35 :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
41 :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
45
46 # The configure script uses the directory where it's located, use a link.
47 configure.aap: {buildcheck=}
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +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 :
53 auto/configure.aap configure.aap
54 config.arg config.h.in config.aap.in
55 :sys CONFIG_STATUS=auto/config.status
56 ./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:
61 :touch {exist} config.arg
62
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":
67 @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
72
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
90 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
91 gui_gtk_f.c
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +000092 GUI_OBJ =
Bram Moolenaar071d4272004-06-13 20:20:40 +000093 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 Moolenaar2df6dcc2004-07-12 15:53:54 +0000101 KDE
102 GUI_SRC = gui.c pty.c gui_kde.cc gui_kde_x11.cc
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000103 gui_kde_wid_moc.cc
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000104 kvim_iface_skel.cc
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000105 GUI_OBJ = $BDIR/gui_kde_wid.o
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000106 GUI_DEFS = -DFEAT_GUI_KDE $NARROW_PROTO
107 GUI_IPATH = $GUI_INC_LOC
108 GUI_LIBS_DIR = $GUI_LIB_LOC
109 GUI_LIBS1 =
110 GUI_LIBS2 =
111 GUI_TARGETS = installglinks installkdeicons
112 GUI_MAN_TARGETS = installghelplinks
113 GUI_TESTTARGET = gui
114
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115 MOTIF
116 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
Bram Moolenaar4399ef42005-02-12 14:29:27 +0000117 gui_xmdlg.c gui_xmebw.c
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000118 GUI_OBJ =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
120 GUI_IPATH = $GUI_INC_LOC
121 GUI_LIBS_DIR = $GUI_LIB_LOC
122 GUI_LIBS1 =
123 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
124 GUI_TARGETS = installglinks
125 GUI_MAN_TARGETS = installghelplinks
126 GUI_TESTTARGET = gui
127 ATHENA
128 # 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_sb.c gui_at_fs.c
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000132 GUI_OBJ =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
134 GUI_IPATH = $GUI_INC_LOC
135 GUI_LIBS_DIR = $GUI_LIB_LOC
136 GUI_LIBS1 = $XAW_LIB
137 GUI_LIBS2 = -lXt
138 GUI_TARGETS = installglinks
139 GUI_MAN_TARGETS = installghelplinks
140 GUI_TESTTARGET = gui
141 NEXTAW
142 # XAW_LIB et al. can be overruled to use Xaw3d widgets
143 XAW_LIB ?= -lXaw
144 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
145 gui_at_fs.c
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000146 GUI_OBJ =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000147 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
148 GUI_IPATH = $GUI_INC_LOC
149 GUI_LIBS_DIR = $GUI_LIB_LOC
150 GUI_LIBS1 = $NEXTAW_LIB
151 GUI_LIBS2 = -lXt
152 GUI_TARGETS = installglinks
153 GUI_MAN_TARGETS = installghelplinks
154 GUI_TESTTARGET = gui
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155 PHOTONGUI
156 GUI_SRC = gui.c gui_photon.c pty.c
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000157 GUI_OBJ =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000158 GUI_DEFS = -DFEAT_GUI_PHOTON
159 GUI_IPATH =
160 GUI_LIBS_DIR =
161 GUI_LIBS1 = -lph -lphexlib
162 GUI_LIBS2 =
163 GUI_TARGETS = installglinks
164 GUI_MAN_TARGETS = installghelplinks
165 GUI_TESTTARGET = gui
166 *
167 GUI_SRC =
168 GUI_OBJ =
169 GUI_DEFS =
170 GUI_IPATH =
171 GUI_LIBS_DIR =
172 GUI_LIBS1 =
173 GUI_LIBS2 =
174 GUI_TARGETS =
175 GUI_MAN_TARGETS =
176 GUI_TESTTARGET =
177
178
179PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000180POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000181CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
182CPPFLAGS =
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000183# Need C++ flags for KDE
184CXXFLAGS = $CFLAGS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000185
186ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
187LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000188LIBS = $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 +0000189
190Target = $VIMNAME
191
192# reconfig target also builds Vim (reconfiguration is handled above).
193reconfig {virtual}: $Target
194
195
196# Execute the test scripts. Run these after compiling Vim, before installing.
197#
198# This will produce a lot of garbage on your screen, including a few error
199# messages. Don't worry about that.
200# If there is a real error, there will be a difference between "test.out" and
201# a "test99.ok" file.
202# If everything is allright, the final message will be "ALL DONE".
203#
204test check:
205 VimProg = ../$Target
206 :execute testdir/main.aap $GUI_TESTTARGET
207
208testclean {virtual}:
209 :del {force} testdir/*.out testdir/test.log
210
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000211CLEANFILES += gui_kde_wid_moc.cc kvim_iface_skel.cc *.kidl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000212
213# When no fetch target exists we are not a child of the ../main.aap recipe,
214# Use ../main.aap to do the fetching.
215# --- If you get an error here for wrong number of arguments, you need to
216# update to a newer version of A-A-P.
217@if not has_target("fetch"):
218 fetch:
219 :execute ../main.aap fetch
220
221
222# All the source files that need to be compiled.
223# Some are optional and depend on configure.
224# "version.c" is missing, it's always compiled (see below).
225Source =
226 buffer.c
227 charset.c
228 diff.c
229 digraph.c
230 edit.c
231 eval.c
232 ex_cmds.c
233 ex_cmds2.c
234 ex_docmd.c
235 ex_eval.c
236 ex_getln.c
237 fileio.c
238 fold.c
239 getchar.c
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000240 hardcopy.c
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000241 hashtable.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242 if_cscope.c
243 if_xcmdsrv.c
244 main.c
245 mark.c
246 memfile.c
247 memline.c
248 menu.c
249 message.c
250 misc1.c
251 misc2.c
252 move.c
253 mbyte.c
254 normal.c
255 ops.c
256 option.c
257 os_unix.c
258 auto/pathdef.c
259 quickfix.c
260 regexp.c
261 screen.c
262 search.c
Bram Moolenaara88d9682005-03-25 21:45:43 +0000263 spell.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264 syntax.c
265 tag.c
266 term.c
267 ui.c
268 undo.c
269 window.c
270 $OS_EXTRA_SRC
271 $GUI_SRC
272 $HANGULIN_SRC
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000273 $MZSCHEME_SRC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274 $PERL_SRC
275 $NETBEANS_SRC
276 $PYTHON_SRC
277 $TCL_SRC
278 $RUBY_SRC
279 $SNIFF_SRC
280 $WORKSHOP_SRC
281
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000282Objects =
283 $GUI_OBJ
284
Bram Moolenaar071d4272004-06-13 20:20:40 +0000285# TODO: make is still used for subdirectories, need to write a recipe.
286MAKE ?= make
287
288all: $Target
289
290# This dependency is required to build auto/osdef.h before automatic
291# dependencies are generated.
292$Source version.c : auto/osdef.h
293
294# Need to mention that the target also depends on version.c, since it's not
295# inluded in $Source
296$Target : version.c
297
298# Some sources are to be found in the "auto" directory.
299SRCPATH += auto
300
301# When building Vim always compile version.c to get the timestamp.
302:filetype
303 declare my_prog
304:attr {filetype = my_prog} $Target
305
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000306:program $Target : $Source $Objects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000307
308:action build my_prog object
309 version_obj = `src2obj("version.c")`
310 :do compile {target = $version_obj} version.c
311 #:do build {target = $target {filetype = program}} $source $version_obj
312 link_sed = $BDIR/link.sed
313 @if os.path.exists(link_sed):
314 :move {force} $link_sed auto/link.sed
315 @else:
316 :del {force} auto/link.sed
317 :update link2.sh
318 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
319 -o $target $source $version_obj $LIBS" \
320 MAKE="aap" sh ./link2.sh
321 :copy {force} auto/link.sed $BDIR/link.sed
322
323# "link.sh" must be modified for A-A-P
324link2.sh : link.sh
325 :print Adjusting $-source for A-A-P.
326 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
327 >! $target
328
329xxd/xxd$EXESUF: xxd/xxd.c
330 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
331 $MAKE -f Makefile
332
333# Build the language specific files if they were unpacked.
334# Generate the converted .mo files separately, it's no problem if this fails.
335languages {virtual}:
336 @if _no.MAKEMO:
337 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
338 @try:
339 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
340 @except:
341 :print Generated converted language files failed, continuing
342
343# Update the *.po files for changes in the sources. Only run manually.
344update-po {virtual}:
345 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
346
347auto/if_perl.c: if_perl.xs
348 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
349 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
350 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
351
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000352$BDIR/gui_kde_wid.o: gui_kde_wid.cc
353 :sys $MOC -o gui_kde_wid_moc.cc gui_kde_wid.h
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000354 @try:
355 :sys $KDE_PREFIX/bin/dcopidl kvim_iface.h > kvim_iface.kidl
356 @except:
357 :del {f} kvim_iface.kidl
358 :sys $KDE_PREFIX/bin/dcopidl2cpp --c++-suffix cc --no-stub kvim_iface.kidl
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000359 :do compile gui_kde_wid.cc
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000360
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000361gui_kde_wid_moc.cc: $BDIR/gui_kde_wid.o
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000362
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000363kvim_iface_skel.cc: $BDIR/gui_kde_wid.o
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000364
365
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
367 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
368
369pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
370
371auto/pathdef.c: auto/config.aap
372 :print Creating $target
373 :print >! $target /* pathdef.c */
374 :print >> $target /* This file is automatically created by main.aap */
375 :print >> $target /* DO NOT EDIT! Change main.aap only. */
376 :print >> $target $#include "vim.h"
377 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
378 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000379 v = $CC -c -I$srcdir $CFLAGS
380 @v = string.replace(v, '"', '\\"')
381 :print >> $target char_u *all_cflags = (char_u *)"$v";
Bram Moolenaar071d4272004-06-13 20:20:40 +0000382 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
383 link_sed = $BDIR/link.sed
384 @if os.path.exists(link_sed):
385 # filter $linkcmd through $BDIR/link.sed
386 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000387 @linkcmd = string.replace(linkcmd, '"', '\\"')
Bram Moolenaar071d4272004-06-13 20:20:40 +0000388 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
389 @if _no.get("COMPILEDBY"):
390 who = $COMPILEDBY
391 where = ''
392 @else:
393 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
394
395 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
396 :print >> $target char_u *compiled_user = (char_u *)"$who";
397 :print >> $target char_u *compiled_sys = (char_u *)"$where";
398
399
400### Names of the programs and targets
401VIMTARGET = $VIMNAME$EXESUF
402EXTARGET = $EXNAME$LNKSUF
403VIEWTARGET = $VIEWNAME$LNKSUF
404GVIMNAME = g$VIMNAME
405GVIMTARGET = $GVIMNAME$LNKSUF
406GVIEWNAME = g$VIEWNAME
407GVIEWTARGET = $GVIEWNAME$LNKSUF
408RVIMNAME = r$VIMNAME
409RVIMTARGET = $RVIMNAME$LNKSUF
410RVIEWNAME = r$VIEWNAME
411RVIEWTARGET = $RVIEWNAME$LNKSUF
412RGVIMNAME = r$GVIMNAME
413RGVIMTARGET = $RGVIMNAME$LNKSUF
414RGVIEWNAME = r$GVIEWNAME
415RGVIEWTARGET = $RGVIEWNAME$LNKSUF
416VIMDIFFNAME = $(VIMNAME)diff
417GVIMDIFFNAME = g$VIMDIFFNAME
418VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
419GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
420EVIMNAME = e$VIMNAME
421EVIMTARGET = $EVIMNAME$LNKSUF
422EVIEWNAME = e$VIEWNAME
423EVIEWTARGET = $EVIEWNAME$LNKSUF
424
425### Names of the tools that are also made
426TOOLS = xxd/xxd$EXESUF
427
428# Root of the installation tree. Empty for a normal install, set to an
429# existing path to install into a special place (for generating a package).
430DESTDIR ?=
431
432### Location of man pages
433MANSUBDIR = $MANDIR/man1
434
435### Location of Vim files (should not need to be changed, and
436### some things might not work when they are changed!)
437VIMDIR = /vim
438@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
439VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
440HELPSUBDIR = /doc
441COLSUBDIR = /colors
442SYNSUBDIR = /syntax
443INDSUBDIR = /indent
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000444AUTOSUBDIR = /autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +0000445PLUGSUBDIR = /plugin
446FTPLUGSUBDIR = /ftplugin
447LANGSUBDIR = /lang
448COMPSUBDIR = /compiler
449KMAPSUBDIR = /keymap
450MACROSUBDIR = /macros
451TOOLSSUBDIR = /tools
452TUTORSUBDIR = /tutor
453PRINTSUBDIR = /print
454PODIR = po
455
456### VIMLOC common root of the Vim files (all versions)
457### VIMRTLOC common root of the runtime Vim files (this version)
458### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
459### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
460### HELPSUBLOC location for help files
461### COLSUBLOC location for colorscheme files
462### SYNSUBLOC location for syntax files
463### INDSUBLOC location for indent files
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000464### AUTOSUBLOC location for standard autoload files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000465### PLUGSUBLOC location for standard plugin files
466### FTPLUGSUBLOC location for ftplugin files
467### LANGSUBLOC location for language files
468### COMPSUBLOC location for compiler files
469### KMAPSUBLOC location for keymap files
470### MACROSUBLOC location for macro files
471### TOOLSSUBLOC location for tools files
472### TUTORSUBLOC location for tutor files
473### PRINTSUBLOC location for print files
474### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
475### You can override these if you want to install them somewhere else.
476### Edit feature.h for compile-time settings.
477VIMLOC = $DATADIR$VIMDIR
478VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
479VIMRCLOC = $VIMLOC
480HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
481COLSUBLOC = $VIMRTLOC$COLSUBDIR
482SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
483INDSUBLOC = $VIMRTLOC$INDSUBDIR
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000484AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
486FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
487LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
488COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
489KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
490MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
491TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
492TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
493PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
494SCRIPTLOC = $VIMRTLOC
495
496### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
497### the runtime directory is not below it.
498#VIMRUNTIMEDIR = $VIMRTLOC
499
500### Name of the evim file target.
501EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
502MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
503
504### Name of the menu file target.
505SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
506SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
507SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
508
509### Name of the bugreport file target.
510SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
511
512### Name of the file type detection file target.
513SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
514
515### Name of the file type detection file target.
516SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
517
518### Name of the file type detection script file target.
519SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
520
521### Name of the ftplugin-on file target.
522SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
523
524### Name of the ftplugin-off file target.
525SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
526
527### Name of the indent-on file target.
528SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
529
530### Name of the indent-off file target.
531SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
532
533### Name of the option window script file target.
534SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
535
536### Permissions for binaries
537BINMOD = 755
538
539### Permissions for man page
540MANMOD = 644
541
542### Permissions for help files
543HELPMOD = 644
544
545### Permissions for Perl and shell scripts
546SCRIPTMOD = 755
547
548### Permission for Vim script files (menu.vim, bugreport.vim, ..)
549VIMSCRIPTMOD = 644
550
551### Permissions for all directories that are created
552DIRMOD = 755
553
554### Permissions for all other files that are created
555FILEMOD = 644
556
557# Where to copy the man and help files from
558HELPSOURCE = ../runtime/doc
559
560# Where to copy the script files from (menu, bugreport)
561SCRIPTSOURCE = ../runtime
562
563# Where to copy the colorscheme files from
564COLSOURCE = ../runtime/colors
565
566# Where to copy the syntax files from
567SYNSOURCE = ../runtime/syntax
568
569# Where to copy the indent files from
570INDSOURCE = ../runtime/indent
571
572# Where to copy the standard plugin files from
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000573AUTOSOURCE = ../runtime/autoload
574
575# Where to copy the standard plugin files from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000576PLUGSOURCE = ../runtime/plugin
577
578# Where to copy the ftplugin files from
579FTPLUGSOURCE = ../runtime/ftplugin
580
581# Where to copy the macro files from
582MACROSOURCE = ../runtime/macros
583
584# Where to copy the tools files from
585TOOLSSOURCE = ../runtime/tools
586
587# Where to copy the tutor files from
588TUTORSOURCE = ../runtime/tutor
589
590# Where to look for language specific files
591LANGSOURCE = ../runtime/lang
592
593# Where to look for compiler files
594COMPSOURCE = ../runtime/compiler
595
596# Where to look for keymap files
597KMAPSOURCE = ../runtime/keymap
598
599# Where to look for print resource files
600PRINTSOURCE = ../runtime/print
601
602# abbreviations
603DEST_BIN = $DESTDIR$BINDIR
604DEST_VIM = $DESTDIR$VIMLOC
605DEST_RT = $DESTDIR$VIMRTLOC
606DEST_HELP = $DESTDIR$HELPSUBLOC
607DEST_COL = $DESTDIR$COLSUBLOC
608DEST_SYN = $DESTDIR$SYNSUBLOC
609DEST_IND = $DESTDIR$INDSUBLOC
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000610DEST_AUTO = $DESTDIR$AUTOSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000611DEST_PLUG = $DESTDIR$PLUGSUBLOC
612DEST_FTP = $DESTDIR$FTPLUGSUBLOC
613DEST_LANG = $DESTDIR$LANGSUBLOC
614DEST_COMP = $DESTDIR$COMPSUBLOC
615DEST_KMAP = $DESTDIR$KMAPSUBLOC
616DEST_MACRO = $DESTDIR$MACROSUBLOC
617DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
618DEST_TUTOR = $DESTDIR$TUTORSUBLOC
619DEST_SCRIPT = $DESTDIR$SCRIPTLOC
620DEST_PRINT = $DESTDIR$PRINTSUBLOC
621DEST_MAN = $DESTDIR$MANSUBDIR
622
623# These are directories, create them when needed.
624:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000625 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000626 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
627 $DEST_SCRIPT $DEST_PRINT $DEST_MAN
628
629#
630# I N S T A L L
631#
632install:
633 @if not os.path.isdir(_no.DEST_BIN):
634 @try:
635 :mkdir $DEST_BIN
636 @except:
637 @ pass
638 @if os.access(_no.DEST_BIN, os.W_OK):
639 # Bin directory is writable, install directly.
640 :update installvim installtools install-languages install-icons
641 @else:
642 # Bin directory is not writable, need to become root.
643 :print The destination directory "$DEST_BIN" is not writable.
644 :print If this is the wrong directory, use PREFIX to specify another one.
645 :print Otherwise, type the root password to continue installing.
646 :asroot $AAP install
647
648installvim {virtual}: installvimbin installruntime installlinks \
649 installhelplinks installmacros installtutor
650
651installvimbin {virtual}{force}: $Target $DEST_BIN
652 exe = $DEST_BIN/$VIMTARGET
653 @if os.path.exists(exe):
654 # Move the old executable aside and delete it. Any other method
655 # may cause a crash if the executable is currently being used.
656 :move {force} $exe $(exe).rm
657 :del {force} $(exe).rm
658 :copy $VIMTARGET $DEST_BIN
659 :do strip $exe
660 :chmod $BINMOD $DEST_BIN/$VIMTARGET
661# may create a link to the new executable from /usr/bin/vi
662 @if _no.get("LINKIT"):
663 :sys $LINKIT
664
665# install the help files; first adjust the contents for the location
666installruntime {virtual}{force}: $HELPSOURCE/vim.1 $DEST_MAN $DEST_VIM
667 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000668 $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP
669 $DEST_PRINT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670 :print generating $DEST_MAN/$(VIMNAME).1
671 :cat $HELPSOURCE/vim.1 |
672 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
673 :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) |
674 :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) |
675 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) |
676 :eval re.sub(_no.VIMLOC + "/vimrc",
677 _no.VIMRCLOC + "/vimrc", stdin) |
678 :eval re.sub(_no.VIMLOC + "/gvimrc",
679 _no.VIMRCLOC + "/gvimrc", stdin) |
680 :eval re.sub(_no.VIMLOC + "/menu.vim",
681 _no.SCRIPTLOC + "/menu.vim", stdin) |
682 :eval re.sub(_no.VIMLOC + "/bugreport.vim",
683 _no.SCRIPTLOC + "/bugreport.vim", stdin) |
684 :eval re.sub(_no.VIMLOC + "/filetype.vim",
685 _no.SCRIPTLOC + "/filetype.vim", stdin) |
686 :eval re.sub(_no.VIMLOC + "/ftoff.vim",
687 _no.SCRIPTLOC + "/ftoff.vim", stdin) |
688 :eval re.sub(_no.VIMLOC + "/scripts.vim",
689 _no.SCRIPTLOC + "/scripts.vim", stdin) |
690 :eval re.sub(_no.VIMLOC + "/optwin.vim",
691 _no.SCRIPTLOC + "/optwin.vim", stdin) |
692 :eval re.sub(_no.VIMLOC + "/\\*.ps",
693 _no.SCRIPTLOC + "/*.ps", stdin)
694 >! $DEST_MAN/$(VIMNAME).1
695 :chmod $MANMOD $DEST_MAN/$(VIMNAME).1
696
697 :print generating $DEST_MAN/$(VIMNAME)tutor.1
698 :cat $HELPSOURCE/vimtutor.1 |
699 :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
700 :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin)
701 >! $DEST_MAN/$(VIMNAME)tutor.1
702 :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1
703
704 :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1
705 :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1
706
707 :print generating $DEST_MAN/$(EVIMNAME).1
708 :cat $HELPSOURCE/evim.1 |
709 :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin)
710 >! $DEST_MAN/$(EVIMNAME).1
711 :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1
712
713 :cd $HELPSOURCE
714 @try:
715 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
716 @except:
717 XTRA = # It's OK if there are no matches.
718 :copy *.txt tags $XTRA $DEST_HELP
719 :cd -
720 :cd $DEST_HELP
721 :chmod $HELPMOD *.txt tags $XTRA
722 :cd -
723 :copy $HELPSOURCE/*.pl $DEST_HELP
724 :chmod $SCRIPTMOD $DEST_HELP/*.pl
725# install the menu files
726 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
727 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
728 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
729 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
730 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
731 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
732# install the evim file
733 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
734 :chmod $VIMSCRIPTMOD $MSWIN_FILE
735 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
736 :chmod $VIMSCRIPTMOD $EVIM_FILE
737# install the bugreport file
738 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
739 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
740# install the example vimrc files
741 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
742 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
743 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
744 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
745# install the file type detection files
746 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
747 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
748 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
749 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
750 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
751 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
752 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
753 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
754 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
755 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
756 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
757 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
758 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
759 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
760 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
761 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
762# install the print resource files
763 :copy $PRINTSOURCE/*.ps $DEST_PRINT
764 :chmod $FILEMOD $DEST_PRINT/*.ps
765# install the colorscheme files
766 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
767 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
768# install the syntax files
769 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
770 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
771# install the indent files
772 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
773 :chmod $HELPMOD $DEST_IND/*.vim
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000774# install the standard autoload files
775 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
776 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000777# install the standard plugin files
778 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
779 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
780# install the ftplugin files
781 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
782 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
783# install the compiler files
784 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
785 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
786
787installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
788 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
789 # Delete any CVS and AAPDIR directories.
790 # Use the ":tree" command if possible. It was added later, fall back
791 # to using "find" when it doesn't work.
792 @try:
793 :tree $DEST_MACRO {dirname = CVS}
794 :del {recursive} $name
795 :tree $DEST_MACRO {dirname = AAPDIR}
796 :del {recursive} $name
797 :tree $DEST_MACRO {dirname = .*}
798 :chmod $DIRMOD $name
799 :tree $DEST_MACRO {filename = .*}
800 :chmod $FILEMOD $name
801 @except:
802 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
803 @ if ok and cvsdirs:
804 :del {recursive} $cvsdirs
805 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
806 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
807 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
808
809# install the tutor files
810installtutor {virtual}{force}: $TUTORSOURCE $DEST_VIM $DEST_RT $DEST_TUTOR
811 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
812 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
813 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
814 :chmod $HELPMOD $DEST_TUTOR/*
815
816# install helper program xxd
817installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
818 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS
819 xxd = $DEST_BIN/xxd$EXESUF
820 @if os.path.exists(xxd):
821 :move {force} $xxd $(xxd).rm
822 :del $(xxd).rm
823 :copy xxd/xxd$EXESUF $DEST_BIN
824 :do strip $DEST_BIN/xxd$EXESUF
825 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
826 :copy $HELPSOURCE/xxd.1 $DEST_MAN
827 :chmod $MANMOD $DEST_MAN/xxd.1
828# install the runtime tools
829 @try:
830 @ if aap_has(":tree"):
831 # New method: copy everything and delete CVS and AAPDIR dirs
832 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
833 :tree $DEST_TOOLS {dirname = CVS}
834 :delete {recursive} $name
835 :tree $DEST_TOOLS {dirname = AAPDIR}
836 :delete {recursive} $name
837 @except:
838 # Old method: copy only specific files and directories.
839 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
840 :chmod $FILEMOD $DEST_TOOLS/*
841# replace the path in some tools
842 :progsearch perlpath perl
843 @if perlpath:
844 :cat $TOOLSSOURCE/efm_perl.pl |
845 :eval re.sub("/usr/bin/perl", perlpath, stdin)
846 >! $DEST_TOOLS/efm_perl.pl
847 @else:
848 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
849
850 :progsearch awkpath nawk gawk awk
851 @if awkpath:
852 :cat $TOOLSSOURCE/mve.awk |
853 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
854 >! $DEST_TOOLS/mve.awk
855 @else:
856 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
857
858 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
859
860# install the language specific files, if they were unpacked
861install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
862 @if _no.MAKEMO:
863 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
864 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
865 @if os.path.exists(_no.LANGSOURCE):
866 :print installing language files
867 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
868 :chmod $FILEMOD $DEST_LANG/*.vim
869 @if os.path.exists(_no.KMAPSOURCE):
870 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
871 :chmod $FILEMOD $DEST_KMAP/*.vim
872
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000873# Install the icons for the KDE GUI. This differs from the KDE icons for
874# other GUIs.
875installkdeicons:
876 :copy {mkdir} ../runtime/KVim.desktop $DESTDIR$KDE_PREFIX/share/applnk/Editors/
877 :chmod 644 $DESTDIR$KDE_PREFIX/share/applnk/Editors/KVim.desktop
878 :copy {mkdir} ../runtime/kvim32x32.png $DESTDIR$KDE_PREFIX/share/icons/hicolor/32x32/apps/gvim.png
879 :chmod 644 $DESTDIR$KDE_PREFIX/share/icons/hicolor/32x32/apps/gvim.png
880 :copy {mkdir} ../runtime/kvim48x48.png $DESTDIR$KDE_PREFIX/share/icons/hicolor/48x48/apps/gvim.png
881 :chmod 644 $DESTDIR$KDE_PREFIX/share/icons/hicolor/48x48/apps/gvim.png
882 :copy {mkdir} ../runtime/hi16-action-make.png $DESTDIR$KDE_PREFIX/share/icons/hicolor/16x16/actions/hi16-action-make.png
883 :copy {mkdir} ../runtime/hi22-action-make.png $DESTDIR$KDE_PREFIX/share/icons/hicolor/22x22/actions/hi22-action-make.png
884 :copy {mkdir} ../runtime/kde-tips $DESTDIR$KDE_PREFIX/share/apps/gvim/tips
885 :chmod 644 $DESTDIR$KDE_PREFIX/share/apps/kvim/tips
886
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887# install the icons for KDE, if the directory exists and the icon doesn't.
888ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
889ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
890ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
891KDEPATH = $HOME/.kde/share/icons
892install-icons {virtual}:
893 gp = $ICON48PATH/gvim.png
894 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
895 :copy $SCRIPTSOURCE/vim48x48.png $gp
896 gp = $ICON32PATH/gvim.png
897 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
898 :copy $SCRIPTSOURCE/vim32x32.png $gp
899 gp = $ICON16PATH/gvim.png
900 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
901 :copy $SCRIPTSOURCE/vim16x16.png $gp
902
903
904$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
905 @if not os.path.exists(_no.TOOLSSOURCE):
906 :print Runtime files not found.
907 :error You need to unpack the runtime archive before running "make install".
908
909# create links from various names to vim. This is only done when the links
910# (or executables with the same name) don't exist yet.
911installlinks {virtual}: $GUI_TARGETS \
912 $DEST_BIN/$EXTARGET \
913 $DEST_BIN/$VIEWTARGET \
914 $DEST_BIN/$RVIMTARGET \
915 $DEST_BIN/$RVIEWTARGET \
916 $INSTALLVIMDIFF
917
918installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
919 $DEST_BIN/$GVIEWTARGET \
920 $DEST_BIN/$RGVIMTARGET \
921 $DEST_BIN/$RGVIEWTARGET \
922 $DEST_BIN/$EVIMTARGET \
923 $DEST_BIN/$EVIEWTARGET \
924 $INSTALLGVIMDIFF
925
926installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
927installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
928
929# These dependencies use an empty buildcheck so that they are only done when
930# the target doesn't exist.
931$DEST_BIN/$EXTARGET: {buildcheck = }
932 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
933
934$DEST_BIN/$VIEWTARGET: {buildcheck = }
935 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
936
937$DEST_BIN/$GVIMTARGET: {buildcheck = }
938 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
939
940$DEST_BIN/$GVIEWTARGET: {buildcheck = }
941 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
942
943$DEST_BIN/$RVIMTARGET: {buildcheck = }
944 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
945
946$DEST_BIN/$RVIEWTARGET: {buildcheck = }
947 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
948
949$DEST_BIN/$RGVIMTARGET: {buildcheck = }
950 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
951
952$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
953 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
954
955$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
956 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
957
958$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
959 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
960
961$DEST_BIN/$EVIMTARGET: {buildcheck = }
962 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
963
964$DEST_BIN/$EVIEWTARGET: {buildcheck = }
965 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
966
967# create links for the manual pages with various names to vim. This is only
968# done when the links (or manpages with the same name) don't exist yet.
969installhelplinks {virtual}: $GUI_MAN_TARGETS \
970 $DEST_MAN/$(EXNAME).1 \
971 $DEST_MAN/$(VIEWNAME).1 \
972 $DEST_MAN/$(RVIMNAME).1 \
973 $DEST_MAN/$(RVIEWNAME).1
974
975installghelplinks {virtual}: $DEST_MAN/$(GVIMNAME).1 \
976 $DEST_MAN/$(GVIEWNAME).1 \
977 $DEST_MAN/$(RGVIMNAME).1 \
978 $DEST_MAN/$(RGVIEWNAME).1 \
979 $DEST_MAN/$(GVIMDIFFNAME).1 \
980 $DEST_MAN/$(EVIEWNAME).1
981
982$DEST_MAN/$(EXNAME).1: {buildcheck = }
983 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(EXNAME).1
984
985$DEST_MAN/$(VIEWNAME).1: {buildcheck = }
986 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(VIEWNAME).1
987
988$DEST_MAN/$(GVIMNAME).1: {buildcheck = }
989 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIMNAME).1
990
991$DEST_MAN/$(GVIEWNAME).1: {buildcheck = }
992 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIEWNAME).1
993
994$DEST_MAN/$(RVIMNAME).1: {buildcheck = }
995 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIMNAME).1
996
997$DEST_MAN/$(RVIEWNAME).1: {buildcheck = }
998 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIEWNAME).1
999
1000$DEST_MAN/$(RGVIMNAME).1: {buildcheck = }
1001 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIMNAME).1
1002
1003$DEST_MAN/$(RGVIEWNAME).1: {buildcheck = }
1004 :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIEWNAME).1
1005
1006$DEST_MAN/$(GVIMDIFFNAME).1: {buildcheck = }
1007 :sys cd $DEST_MAN; ln -s $(VIMDIFFNAME).1 $(GVIMDIFFNAME).1
1008
1009$DEST_MAN/$(EVIEWNAME).1: {buildcheck = }
1010 :sys cd $DEST_MAN; ln -s $(EVIMNAME).1 $(EVIEWNAME).1
1011
1012#
1013# U N I N S T A L L
1014#
1015uninstall {virtual}{force}: uninstall_runtime
1016 :del {force} $DEST_BIN/$VIMTARGET
1017 :del {force} $DEST_MAN/$(VIMNAME).1 $DEST_MAN/$(VIMNAME)tutor.1
1018 :del {force} $DEST_BIN/vimtutor
1019 :del {force} $DEST_BIN/xxd$EXESUF $DEST_MAN/xxd.1
1020 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
1021 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
1022 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
1023 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
1024 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
1025 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
1026 :del {force} $DEST_MAN/$(EXNAME).1 $DEST_MAN/$(VIEWNAME).1
1027 :del {force} $DEST_MAN/$(GVIMNAME).1 $DEST_MAN/$(GVIEWNAME).1
1028 :del {force} $DEST_MAN/$(RVIMNAME).1 $DEST_MAN/$(RVIEWNAME).1
1029 :del {force} $DEST_MAN/$(RGVIMNAME).1 $DEST_MAN/$(RGVIEWNAME).1
1030 :del {force} $DEST_MAN/$(VIMDIFFNAME).1 $DEST_MAN/$(GVIMDIFFNAME).1
1031 :del {force} $DEST_MAN/$(EVIMNAME).1 $DEST_MAN/$(EVIEWNAME).1
1032
1033# Note: "deldir" will fail if any files were added after "make install", that
1034# is intentionally: Keep files the user added.
1035uninstall_runtime {virtual}{force}:
1036 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
1037 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
1038 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
1039 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1040 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1041 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1042 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1043 :del {force} $SYS_OPTWIN_FILE
1044 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1045 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1046 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1047 :del {force} $DEST_PRINT/*.ps
1048 :del {force}{recursive} $DEST_MACRO
1049 :del {force}{recursive} $DEST_TUTOR
1050 :del {force}{recursive} $DEST_TOOLS
1051 :del {force}{recursive} $DEST_LANG
1052 :del {force}{recursive} $DEST_KMAP
1053 :del {force}{recursive} $DEST_COMP
1054 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1055 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001056 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +00001057 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar87e25fd2005-07-27 21:13:01 +00001058 :deldir {force} $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
Bram Moolenaar071d4272004-06-13 20:20:40 +00001059# This will fail when other Vim versions are installed, no worries.
1060 @try:
1061 :deldir $DEST_VIM
1062 @except:
1063 :print Cannot delete $DEST_VIM
1064
1065
1066# vim: sts=4 sw=4 :