blob: 54debd60766ba2da38793ef902e65b9b4c02aa5e [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#
Bram Moolenaar8ab561d2006-03-23 22:44:10 +000013@if os.name != "posix":
14 :error Sorry, this recipe only works for Unix-like systems.
Bram Moolenaar071d4272004-06-13 20:20:40 +000015
16# Skip the configure stuff when "link.sh" is executing this recipe recursively
17# to build pathdef.c or not building something and auto/config.aap does exist.
18@if ((_no.TARGETARG != "pathdef" and has_build_target())
Bram Moolenaar1e015462005-09-25 22:16:38 +000019@ or not os.path.exists("auto/config.aap")):
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
21 #
22 # A U T O C O N F
23 #
24
25 # Run autoconf when configure.in has been changed since it was last run.
26 # This is skipped when the signatures in "mysign" are up-to-date. When
27 # there is no autoconf program skip this (the signature is often the only
28 # thing that's outdated)
29 auto/configure {signfile = mysign} : configure.in
Bram Moolenaar1e015462005-09-25 22:16:38 +000030 @if not program_path("autoconf"):
31 :print Can't find autoconf, using existing configure script.
32 @else:
Bram Moolenaar071d4272004-06-13 20:20:40 +000033 # Move configure aside, autoconf would overwrite it
34 :move {exist} configure configure.save
35 :sys autoconf
Bram Moolenaar06b5db92006-02-10 23:11:56 +000036 :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 +000037 :chmod 755 auto/configure
38 :move configure.save configure
39 :del {force} auto/config.cache auto/config.status
40
41 # Change the configure script to produce config.aap instead of config.mk.
42 auto/configure.aap : auto/configure
Bram Moolenaar1e015462005-09-25 22:16:38 +000043 :print Adjusting auto/configure for A-A-P.
44 :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin)
45 >! auto/configure.aap
46 :chmod 755 auto/configure.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
48 # The configure script uses the directory where it's located, use a link.
49 configure.aap: {buildcheck=}
Bram Moolenaar1e015462005-09-25 22:16:38 +000050 :symlink {f} auto/configure.aap configure.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000051
52 # Dependency: run configure.aap to update config.h and config.aap in the
53 # "auto" directory.
Bram Moolenaar8ab561d2006-03-23 22:44:10 +000054 # NOTE: we can only build for one architecture, because -MM doesn't work
55 # when building for both.
Bram Moolenaar071d4272004-06-13 20:20:40 +000056 config {virtual} auto/config.h auto/config.aap :
Bram Moolenaar1e015462005-09-25 22:16:38 +000057 auto/configure.aap configure.aap
58 config.arg config.h.in config.aap.in
Bram Moolenaardfc7aa22007-09-25 20:13:54 +000059 # Use "uname -a" to detect the architecture of the system.
60 @ok, uname = redir_system('uname -a', 0)
61 @if string.find(uname, "i386") >= 0:
62 @ arch = "i386"
63 @else:
64 @ arch = "ppc"
65 :print Building for $arch system
Bram Moolenaar1e015462005-09-25 22:16:38 +000066 :sys CONFIG_STATUS=auto/config.status
Bram Moolenaar071d4272004-06-13 20:20:40 +000067 ./configure.aap `file2string("config.arg")`
Bram Moolenaardfc7aa22007-09-25 20:13:54 +000068 --with-mac-arch=$arch
Bram Moolenaar071d4272004-06-13 20:20:40 +000069 --cache-file=auto/config.cache
70
71 # Configure arguments: create an empty "config.arg" file when its missing
72 config.arg:
Bram Moolenaar1e015462005-09-25 22:16:38 +000073 :touch {exist} config.arg
Bram Moolenaar071d4272004-06-13 20:20:40 +000074
75 # "auto/config.aap" contains a lot of settings, such as the name of the
76 # executable "Target".
77 # First update it, forcefully if the "reconfig" target was used.
78 @if _no.TARGETARG != "comment" and _no.TARGETARG != "make":
Bram Moolenaar1e015462005-09-25 22:16:38 +000079 @if "reconfig" in var2list(_no.TARGETARG):
80 :del {force} auto/config.cache auto/config.status
81 :update {force} auto/config.aap
82 @else:
83 :update auto/config.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000084
85# Include the recipe that autoconf generated.
86:include auto/config.aap
87
Bram Moolenaara226a6d2006-02-26 23:59:20 +000088# Unfortunately "-M" doesn't work when building for two architectures. Switch
89# back to PPC only.
90@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
91 CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
92
Bram Moolenaar071d4272004-06-13 20:20:40 +000093# A "PREFIX=dir" argument overrules the value of $prefix
Bram Moolenaar8ab561d2006-03-23 22:44:10 +000094# But don't use the default "/usr/local".
95@if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local':
Bram Moolenaar071d4272004-06-13 20:20:40 +000096 prefix = $PREFIX
97
98# Don't want "~/" in prefix.
99prefix = `os.path.expanduser(prefix)`
100
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000101# For Mac.
102APPDIR = $(VIMNAME).app
103
104### Names of the programs and targets
105VIMTARGET = $VIMNAME$EXESUF
106EXTARGET = $EXNAME$LNKSUF
107VIEWTARGET = $VIEWNAME$LNKSUF
108GVIMNAME = g$VIMNAME
109GVIMTARGET = $GVIMNAME$LNKSUF
110GVIEWNAME = g$VIEWNAME
111GVIEWTARGET = $GVIEWNAME$LNKSUF
112RVIMNAME = r$VIMNAME
113RVIMTARGET = $RVIMNAME$LNKSUF
114RVIEWNAME = r$VIEWNAME
115RVIEWTARGET = $RVIEWNAME$LNKSUF
116RGVIMNAME = r$GVIMNAME
117RGVIMTARGET = $RGVIMNAME$LNKSUF
118RGVIEWNAME = r$GVIEWNAME
119RGVIEWTARGET = $RGVIEWNAME$LNKSUF
120VIMDIFFNAME = $(VIMNAME)diff
121GVIMDIFFNAME = g$VIMDIFFNAME
122VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
123GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
124EVIMNAME = e$VIMNAME
125EVIMTARGET = $EVIMNAME$LNKSUF
126EVIEWNAME = e$VIEWNAME
127EVIEWTARGET = $EVIEWNAME$LNKSUF
128
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129#
130# G U I variant
131#
132# The GUI is selected by configure, a lot of other things depend on it.
133#
134:variant GUI
135 GTK
Bram Moolenaar1e015462005-09-25 22:16:38 +0000136 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
137 gui_gtk_f.c
138 GUI_OBJ =
139 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
140 GUI_IPATH = $GUI_INC_LOC
141 GUI_LIBS_DIR = $GUI_LIB_LOC
142 GUI_LIBS1 =
143 GUI_LIBS2 = $GTK_LIBNAME
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000144 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000145 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000146 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000147 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000148 GUI_BUNDLE =
149 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150 MOTIF
Bram Moolenaar1e015462005-09-25 22:16:38 +0000151 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
152 gui_xmdlg.c gui_xmebw.c
153 GUI_OBJ =
154 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
155 GUI_IPATH = $GUI_INC_LOC
156 GUI_LIBS_DIR = $GUI_LIB_LOC
157 GUI_LIBS1 =
158 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000159 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000160 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000161 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000162 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000163 GUI_BUNDLE =
164 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165 ATHENA
Bram Moolenaar1e015462005-09-25 22:16:38 +0000166 # XAW_LIB et al. can be overruled to use Xaw3d widgets
167 XAW_LIB ?= -lXaw
168 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
169 gui_at_sb.c gui_at_fs.c
170 GUI_OBJ =
171 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
172 GUI_IPATH = $GUI_INC_LOC
173 GUI_LIBS_DIR = $GUI_LIB_LOC
174 GUI_LIBS1 = $XAW_LIB
175 GUI_LIBS2 = -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000176 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000177 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000178 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000179 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000180 GUI_BUNDLE =
181 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000182 NEXTAW
Bram Moolenaar1e015462005-09-25 22:16:38 +0000183 # XAW_LIB et al. can be overruled to use Xaw3d widgets
184 XAW_LIB ?= -lXaw
185 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
186 gui_at_fs.c
187 GUI_OBJ =
188 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
189 GUI_IPATH = $GUI_INC_LOC
190 GUI_LIBS_DIR = $GUI_LIB_LOC
191 GUI_LIBS1 = $NEXTAW_LIB
192 GUI_LIBS2 = -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000193 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000194 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000195 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000196 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000197 GUI_BUNDLE =
198 GUI_TESTARG =
199 CARBONGUI
200 GUI_SRC = gui.c gui_mac.c pty.c
201 GUI_OBJ =
202 GUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \
203 -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe
204 GUI_IPATH = $GUI_INC_LOC
205 GUI_LIBS_DIR = $GUI_LIB_LOC
206 GUI_LIBS1 = -framework Carbon
207 GUI_LIBS2 =
208 GUI_INSTALL = install_macosx
209 GUI_TARGETS = installglinks
210 GUI_MAN_TARGETS = yes
211 GUI_TESTTARGET = gui
212 GUI_BUNDLE = gui_bundle
213 GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214 PHOTONGUI
Bram Moolenaar1e015462005-09-25 22:16:38 +0000215 GUI_SRC = gui.c gui_photon.c pty.c
216 GUI_OBJ =
217 GUI_DEFS = -DFEAT_GUI_PHOTON
218 GUI_IPATH =
219 GUI_LIBS_DIR =
220 GUI_LIBS1 = -lph -lphexlib
221 GUI_LIBS2 =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000222 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000223 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000224 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000225 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000226 GUI_BUNDLE =
227 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228 *
Bram Moolenaar1e015462005-09-25 22:16:38 +0000229 GUI_SRC =
230 GUI_OBJ =
231 GUI_DEFS =
232 GUI_IPATH =
233 GUI_LIBS_DIR =
234 GUI_LIBS1 =
235 GUI_LIBS2 =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000236 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000237 GUI_TARGETS =
238 GUI_MAN_TARGETS =
239 GUI_TESTTARGET =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000240 GUI_BUNDLE =
241 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242
243
244PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000245POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
247CPPFLAGS =
248
249ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
250LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000251LIBS = $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 +0000252
253Target = $VIMNAME
254
255# reconfig target also builds Vim (reconfiguration is handled above).
256reconfig {virtual}: $Target
257
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000258distclean: clean
259 :del {force} auto/config.h auto/config.aap
260 :del {force} auto/config.cache auto/config.status
261
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262
263# Execute the test scripts. Run these after compiling Vim, before installing.
264#
265# This will produce a lot of garbage on your screen, including a few error
266# messages. Don't worry about that.
267# If there is a real error, there will be a difference between "test.out" and
268# a "test99.ok" file.
Bram Moolenaarf711faf2007-05-10 16:48:19 +0000269# If everything is alright, the final message will be "ALL DONE".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270#
271test check:
272 VimProg = ../$Target
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000273 :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274
275testclean {virtual}:
276 :del {force} testdir/*.out testdir/test.log
277
Bram Moolenaar071d4272004-06-13 20:20:40 +0000278# When no fetch target exists we are not a child of the ../main.aap recipe,
279# Use ../main.aap to do the fetching.
280# --- If you get an error here for wrong number of arguments, you need to
281# update to a newer version of A-A-P.
282@if not has_target("fetch"):
283 fetch:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000284 :execute ../main.aap fetch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000285
286
287# All the source files that need to be compiled.
288# Some are optional and depend on configure.
289# "version.c" is missing, it's always compiled (see below).
290Source =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000291 buffer.c
292 charset.c
293 diff.c
294 digraph.c
295 edit.c
296 eval.c
297 ex_cmds.c
298 ex_cmds2.c
299 ex_docmd.c
300 ex_eval.c
301 ex_getln.c
302 fileio.c
303 fold.c
304 getchar.c
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000305 hardcopy.c
Bram Moolenaar607a95ed2006-03-28 20:57:42 +0000306 hashtab.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000307 if_cscope.c
308 if_xcmdsrv.c
309 main.c
310 mark.c
311 memfile.c
312 memline.c
313 menu.c
314 message.c
315 misc1.c
316 misc2.c
317 move.c
318 mbyte.c
319 normal.c
320 ops.c
321 option.c
322 os_unix.c
323 auto/pathdef.c
Bram Moolenaar607a95ed2006-03-28 20:57:42 +0000324 popupmnu.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000325 quickfix.c
326 regexp.c
327 screen.c
328 search.c
329 spell.c
330 syntax.c
331 tag.c
332 term.c
333 ui.c
334 undo.c
335 window.c
336 $OS_EXTRA_SRC
337 $GUI_SRC
338 $HANGULIN_SRC
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000339 $MZSCHEME_SRC
Bram Moolenaar1e015462005-09-25 22:16:38 +0000340 $PERL_SRC
341 $NETBEANS_SRC
342 $PYTHON_SRC
343 $TCL_SRC
344 $RUBY_SRC
345 $SNIFF_SRC
346 $WORKSHOP_SRC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000347
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000348Objects =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000349 $GUI_OBJ
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000350
Bram Moolenaar071d4272004-06-13 20:20:40 +0000351# TODO: make is still used for subdirectories, need to write a recipe.
352MAKE ?= make
353
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000354all: $Target $GUI_BUNDLE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000355
356# This dependency is required to build auto/osdef.h before automatic
357# dependencies are generated.
358$Source version.c : auto/osdef.h
359
360# Need to mention that the target also depends on version.c, since it's not
Bram Moolenaarf711faf2007-05-10 16:48:19 +0000361# included in $Source
Bram Moolenaar071d4272004-06-13 20:20:40 +0000362$Target : version.c
363
364# Some sources are to be found in the "auto" directory.
365SRCPATH += auto
366
367# When building Vim always compile version.c to get the timestamp.
368:filetype
369 declare my_prog
370:attr {filetype = my_prog} $Target
371
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000372:program $Target : $Source $Objects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000373
374:action build my_prog object
Bram Moolenaar1e015462005-09-25 22:16:38 +0000375 version_obj = `src2obj("version.c")`
376 :do compile {target = $version_obj} version.c
377 #:do build {target = $target {filetype = program}} $source $version_obj
378 link_sed = $BDIR/link.sed
379 @if os.path.exists(link_sed):
380 :move {force} $link_sed auto/link.sed
381 @else:
382 :del {force} auto/link.sed
383 :update link2.sh
384 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
385 -o $target $source $version_obj $LIBS" \
386 MAKE="aap" sh ./link2.sh
387 :copy {force} auto/link.sed $BDIR/link.sed
Bram Moolenaar071d4272004-06-13 20:20:40 +0000388
389# "link.sh" must be modified for A-A-P
390link2.sh : link.sh
391 :print Adjusting $-source for A-A-P.
392 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000393 >! $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000394
395xxd/xxd$EXESUF: xxd/xxd.c
396 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000397 $MAKE -f Makefile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000398
399# Build the language specific files if they were unpacked.
400# Generate the converted .mo files separately, it's no problem if this fails.
401languages {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000402 @if _no.MAKEMO:
403 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
404 @try:
405 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
406 @except:
407 :print Generated converted language files failed, continuing
Bram Moolenaar071d4272004-06-13 20:20:40 +0000408
409# Update the *.po files for changes in the sources. Only run manually.
410update-po {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000411 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
Bram Moolenaar071d4272004-06-13 20:20:40 +0000412
413auto/if_perl.c: if_perl.xs
Bram Moolenaar1e015462005-09-25 22:16:38 +0000414 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
415 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
416 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000417
418auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
Bram Moolenaar1e015462005-09-25 22:16:38 +0000419 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000420
421pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
422
423auto/pathdef.c: auto/config.aap
Bram Moolenaar1e015462005-09-25 22:16:38 +0000424 :print Creating $target
425 :print >! $target /* pathdef.c */
426 :print >> $target /* This file is automatically created by main.aap */
427 :print >> $target /* DO NOT EDIT! Change main.aap only. */
428 :print >> $target $#include "vim.h"
429 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
430 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
431 v = $CC -c -I$srcdir $CFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000432 @v = string.replace(v, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000433 :print >> $target char_u *all_cflags = (char_u *)"$v";
434 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
435 link_sed = $BDIR/link.sed
436 @if os.path.exists(link_sed):
437 # filter $linkcmd through $BDIR/link.sed
438 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000439 @linkcmd = string.replace(linkcmd, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000440 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
441 @if _no.get("COMPILEDBY"):
442 who = $COMPILEDBY
443 where = ''
444 @else:
445 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
Bram Moolenaar071d4272004-06-13 20:20:40 +0000446
Bram Moolenaar1e015462005-09-25 22:16:38 +0000447 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
448 :print >> $target char_u *compiled_user = (char_u *)"$who";
449 :print >> $target char_u *compiled_sys = (char_u *)"$where";
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450
451
Bram Moolenaar071d4272004-06-13 20:20:40 +0000452### Names of the tools that are also made
453TOOLS = xxd/xxd$EXESUF
454
455# Root of the installation tree. Empty for a normal install, set to an
456# existing path to install into a special place (for generating a package).
457DESTDIR ?=
458
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000459### Location of man pages under $MANTOPDIR
460MAN1DIR = /man1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000461
462### Location of Vim files (should not need to be changed, and
463### some things might not work when they are changed!)
464VIMDIR = /vim
465@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
466VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
467HELPSUBDIR = /doc
468COLSUBDIR = /colors
469SYNSUBDIR = /syntax
470INDSUBDIR = /indent
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000471AUTOSUBDIR = /autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +0000472PLUGSUBDIR = /plugin
473FTPLUGSUBDIR = /ftplugin
474LANGSUBDIR = /lang
475COMPSUBDIR = /compiler
476KMAPSUBDIR = /keymap
477MACROSUBDIR = /macros
478TOOLSSUBDIR = /tools
479TUTORSUBDIR = /tutor
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000480SPELLSUBDIR = /spell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481PRINTSUBDIR = /print
482PODIR = po
483
Bram Moolenaar1e015462005-09-25 22:16:38 +0000484### VIMLOC common root of the Vim files (all versions)
485### VIMRTLOC common root of the runtime Vim files (this version)
486### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000487### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000488### HELPSUBLOC location for help files
489### COLSUBLOC location for colorscheme files
490### SYNSUBLOC location for syntax files
491### INDSUBLOC location for indent files
492### AUTOSUBLOC location for standard autoload files
493### PLUGSUBLOC location for standard plugin files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000494### FTPLUGSUBLOC location for ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000495### LANGSUBLOC location for language files
496### COMPSUBLOC location for compiler files
497### KMAPSUBLOC location for keymap files
498### MACROSUBLOC location for macro files
499### TOOLSSUBLOC location for tools files
500### TUTORSUBLOC location for tutor files
501### PRINTSUBLOC location for print files
502### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000503### You can override these if you want to install them somewhere else.
504### Edit feature.h for compile-time settings.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000505VIMLOC = $DATADIR$VIMDIR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000506@if not _no.get("VIMRTLOC"):
507 VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000508VIMRCLOC = $VIMLOC
509HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
510COLSUBLOC = $VIMRTLOC$COLSUBDIR
511SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
512INDSUBLOC = $VIMRTLOC$INDSUBDIR
513AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
514PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
515FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
516LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
517COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
518KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
519MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
520TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
521TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000522SPELLSUBLOC = $VIMRTLOC$SPELLSUBDIR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000523PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
524SCRIPTLOC = $VIMRTLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000525
526### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
527### the runtime directory is not below it.
528#VIMRUNTIMEDIR = $VIMRTLOC
529
530### Name of the evim file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000531EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
532MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533
534### Name of the menu file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000535SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
537SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
538
539### Name of the bugreport file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000540SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000541
542### Name of the file type detection file target.
543SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
544
545### Name of the file type detection file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000546SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000547
548### Name of the file type detection script file target.
549SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
550
551### Name of the ftplugin-on file target.
552SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
553
554### Name of the ftplugin-off file target.
555SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
556
557### Name of the indent-on file target.
558SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
559
560### Name of the indent-off file target.
561SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
562
563### Name of the option window script file target.
564SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
565
566### Permissions for binaries
567BINMOD = 755
568
569### Permissions for man page
570MANMOD = 644
571
572### Permissions for help files
573HELPMOD = 644
574
575### Permissions for Perl and shell scripts
576SCRIPTMOD = 755
577
578### Permission for Vim script files (menu.vim, bugreport.vim, ..)
579VIMSCRIPTMOD = 644
580
581### Permissions for all directories that are created
582DIRMOD = 755
583
584### Permissions for all other files that are created
585FILEMOD = 644
586
587# Where to copy the man and help files from
588HELPSOURCE = ../runtime/doc
589
590# Where to copy the script files from (menu, bugreport)
591SCRIPTSOURCE = ../runtime
592
593# Where to copy the colorscheme files from
594COLSOURCE = ../runtime/colors
595
596# Where to copy the syntax files from
597SYNSOURCE = ../runtime/syntax
598
599# Where to copy the indent files from
600INDSOURCE = ../runtime/indent
601
602# Where to copy the standard plugin files from
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000603AUTOSOURCE = ../runtime/autoload
604
605# Where to copy the standard plugin files from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606PLUGSOURCE = ../runtime/plugin
607
608# Where to copy the ftplugin files from
609FTPLUGSOURCE = ../runtime/ftplugin
610
611# Where to copy the macro files from
612MACROSOURCE = ../runtime/macros
613
614# Where to copy the tools files from
615TOOLSSOURCE = ../runtime/tools
616
617# Where to copy the tutor files from
618TUTORSOURCE = ../runtime/tutor
619
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000620# Where to copy the spell files from
621SPELLSOURCE = ../runtime/spell
622
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623# Where to look for language specific files
624LANGSOURCE = ../runtime/lang
625
626# Where to look for compiler files
627COMPSOURCE = ../runtime/compiler
628
629# Where to look for keymap files
630KMAPSOURCE = ../runtime/keymap
631
632# Where to look for print resource files
633PRINTSOURCE = ../runtime/print
634
635# abbreviations
636DEST_BIN = $DESTDIR$BINDIR
637DEST_VIM = $DESTDIR$VIMLOC
638DEST_RT = $DESTDIR$VIMRTLOC
639DEST_HELP = $DESTDIR$HELPSUBLOC
640DEST_COL = $DESTDIR$COLSUBLOC
641DEST_SYN = $DESTDIR$SYNSUBLOC
642DEST_IND = $DESTDIR$INDSUBLOC
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000643DEST_AUTO = $DESTDIR$AUTOSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000644DEST_PLUG = $DESTDIR$PLUGSUBLOC
645DEST_FTP = $DESTDIR$FTPLUGSUBLOC
646DEST_LANG = $DESTDIR$LANGSUBLOC
647DEST_COMP = $DESTDIR$COMPSUBLOC
648DEST_KMAP = $DESTDIR$KMAPSUBLOC
649DEST_MACRO = $DESTDIR$MACROSUBLOC
650DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
651DEST_TUTOR = $DESTDIR$TUTORSUBLOC
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000652DEST_SPELL = $DESTDIR$SPELLSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000653DEST_SCRIPT = $DESTDIR$SCRIPTLOC
654DEST_PRINT = $DESTDIR$PRINTSUBLOC
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000655DEST_MAN_TOP = $DESTDIR$?(MANDIR)
656
657# We assume that the ".../man/xx/man1/" directory is for latin1 manual pages.
658# Some systems use UTF-8, but these should find the ".../man/xx.UTF-8/man1/"
659# directory first.
660# FreeBSD uses ".../man/xx.ISO8859-1/man1" for latin1, use that one too.
661DEST_MAN = $(DEST_MAN_TOP)$(MAN1DIR)
662DEST_MAN_FR = $(DEST_MAN_TOP)/fr$(MAN1DIR)
663DEST_MAN_FR_I = $(DEST_MAN_TOP)/fr.ISO8859-1$(MAN1DIR)
664DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR)
665DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR)
666DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR)
667DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000668DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR)
669DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000670DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
671DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000672
673# These are directories, create them when needed.
674:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
Bram Moolenaar18144c82006-04-12 21:52:12 +0000675 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG
676 $DEST_FTP $DEST_LANG
Bram Moolenaar1e015462005-09-25 22:16:38 +0000677 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000678 $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL
679 $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000680 $DEST_MAN_IT_I $DEST_MAN_IT_U
681 $DEST_MAN_PL $DEST_MAN_PL_U
682 $DEST_MAN_RU $DEST_MAN_RU_U
Bram Moolenaar071d4272004-06-13 20:20:40 +0000683
684#
685# I N S T A L L
686#
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000687install: $GUI_INSTALL
688
689install_normal:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000690 @if not os.path.isdir(_no.DEST_BIN):
691 @try:
692 :mkdir $DEST_BIN
693 @except:
694 @ pass
695 @if os.access(_no.DEST_BIN, os.W_OK):
696 # Bin directory is writable, install directly.
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000697 :update installvim installtools $INSTALL_LANGS install-icons
Bram Moolenaar071d4272004-06-13 20:20:40 +0000698 @else:
699 # Bin directory is not writable, need to become root.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000700 :print The destination directory "$DEST_BIN" is not writable.
701 :print If this is the wrong directory, use PREFIX to specify another one.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000702 :print Otherwise, type the root password to continue installing.
703 :asroot $AAP install
704
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000705installvim {virtual}: installvimbin installtutorbin \
706 installruntime installlinks installmanlinks
Bram Moolenaar071d4272004-06-13 20:20:40 +0000707
708installvimbin {virtual}{force}: $Target $DEST_BIN
Bram Moolenaar1e015462005-09-25 22:16:38 +0000709 exe = $DEST_BIN/$VIMTARGET
710 @if os.path.exists(exe):
711 # Move the old executable aside and delete it. Any other method
712 # may cause a crash if the executable is currently being used.
713 :move {force} $exe $(exe).rm
714 :del {force} $(exe).rm
715 :copy $VIMTARGET $DEST_BIN
716 :do strip $exe
717 :chmod $BINMOD $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +0000718# may create a link to the new executable from /usr/bin/vi
Bram Moolenaar1e015462005-09-25 22:16:38 +0000719 @if _no.get("LINKIT"):
720 :sys $LINKIT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000722# Long list of arguments for the shell script that installs the manual pages
723# for one language.
724INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \
725 $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME)
726
727# Install most of the runtime files
728installruntime {virtual}: installrtbase installmacros installtutor installspell
729
Bram Moolenaar071d4272004-06-13 20:20:40 +0000730# install the help files; first adjust the contents for the location
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000731installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000732 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
Bram Moolenaar18144c82006-04-12 21:52:12 +0000733 $DEST_FTP $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG $DEST_TUTOR
734 $DEST_COMP $DEST_SPELL $DEST_PRINT
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000735 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000736 :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000737
738 :cd $HELPSOURCE
739 @try:
740 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
741 @except:
742 XTRA = # It's OK if there are no matches.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000743 :copy *.txt tags $XTRA $DEST_HELP
Bram Moolenaar071d4272004-06-13 20:20:40 +0000744 :cd -
745 :cd $DEST_HELP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000746 :chmod $HELPMOD *.txt tags $XTRA
Bram Moolenaar071d4272004-06-13 20:20:40 +0000747 :cd -
Bram Moolenaar1e015462005-09-25 22:16:38 +0000748 :copy $HELPSOURCE/*.pl $DEST_HELP
749 :chmod $SCRIPTMOD $DEST_HELP/*.pl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000750# install the menu files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000751 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
752 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
753 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
754 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
755 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
756 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000757# install the evim file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000758 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
759 :chmod $VIMSCRIPTMOD $MSWIN_FILE
760 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
761 :chmod $VIMSCRIPTMOD $EVIM_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000762# install the bugreport file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000763 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
764 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000765# install the example vimrc files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000766 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
767 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
768 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
769 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000770# install the file type detection files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000771 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
772 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
773 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
774 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
775 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
776 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
777 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
778 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
779 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
780 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
781 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
782 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
783 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
784 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
785 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
786 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000787# install the print resource files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000788 :copy $PRINTSOURCE/*.ps $DEST_PRINT
789 :chmod $FILEMOD $DEST_PRINT/*.ps
Bram Moolenaar071d4272004-06-13 20:20:40 +0000790# install the colorscheme files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000791 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
792 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793# install the syntax files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000794 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
795 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000796# install the indent files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000797 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
798 :chmod $HELPMOD $DEST_IND/*.vim
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000799# install the standard autoload files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000800 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
801 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +0000802 :copy $AUTOSOURCE/xml/*.vim $DEST_AUTO/xml
803 :chmod $HELPMOD $DEST_AUTO/xml/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000804# install the standard plugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000805 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
806 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000807# install the ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000808 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
809 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000810# install the compiler files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000811 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
812 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000813
814installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
Bram Moolenaar1e015462005-09-25 22:16:38 +0000815 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
816 # Delete any CVS and AAPDIR directories.
817 # Use the ":tree" command if possible. It was added later, fall back
818 # to using "find" when it doesn't work.
819 @try:
820 :tree $DEST_MACRO {dirname = CVS}
821 :del {recursive} $name
822 :tree $DEST_MACRO {dirname = AAPDIR}
823 :del {recursive} $name
824 :tree $DEST_MACRO {dirname = .*}
825 :chmod $DIRMOD $name
826 :tree $DEST_MACRO {filename = .*}
827 :chmod $FILEMOD $name
828 @except:
829 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
830 @ if ok and cvsdirs:
831 :del {recursive} $cvsdirs
832 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
833 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
834 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000835
836# install the tutor files
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000837installtutorbin {virtual}{force}: $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000838 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
839 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000840
841installtutor {virtual}{force}: $DEST_RT $DEST_TUTOR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000842 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
843 :chmod $HELPMOD $DEST_TUTOR/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000844
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000845# Install the spell files, if they exist. This assumes at least the English
846# spell file is there.
847installspell {virtual}: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL)
848 enspl = $(SPELLSOURCE)/en.latin1.spl
849 @if os.path.exists(enspl):
850 :copy $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.vim $(DEST_SPELL)
851 :chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.vim
852 @try:
853 :copy $(SPELLSOURCE)/*.sug $(DEST_SPELL)
854 :chmod $(HELPMOD) $(DEST_SPELL)/*.sug
855 @except:
856 @ pass
857
Bram Moolenaar071d4272004-06-13 20:20:40 +0000858# install helper program xxd
859installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000860 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS \
861 $INSTALL_TOOL_LANGS
Bram Moolenaar1e015462005-09-25 22:16:38 +0000862 xxd = $DEST_BIN/xxd$EXESUF
863 @if os.path.exists(xxd):
864 :move {force} $xxd $(xxd).rm
865 :del $(xxd).rm
866 :copy xxd/xxd$EXESUF $DEST_BIN
867 :do strip $DEST_BIN/xxd$EXESUF
868 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000869 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000870 :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS)
871#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000872# install the runtime tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000873 @try:
874 @ if aap_has(":tree"):
875 # New method: copy everything and delete CVS and AAPDIR dirs
876 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
877 :tree $DEST_TOOLS {dirname = CVS}
878 :delete {recursive} $name
879 :tree $DEST_TOOLS {dirname = AAPDIR}
880 :delete {recursive} $name
881 @except:
882 # Old method: copy only specific files and directories.
883 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
884 :chmod $FILEMOD $DEST_TOOLS/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000885# replace the path in some tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000886 :progsearch perlpath perl
887 @if perlpath:
888 :cat $TOOLSSOURCE/efm_perl.pl |
889 :eval re.sub("/usr/bin/perl", perlpath, stdin)
890 >! $DEST_TOOLS/efm_perl.pl
891 @else:
892 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000893
Bram Moolenaar1e015462005-09-25 22:16:38 +0000894 :progsearch awkpath nawk gawk awk
895 @if awkpath:
896 :cat $TOOLSSOURCE/mve.awk |
897 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
898 >! $DEST_TOOLS/mve.awk
899 @else:
900 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000901
Bram Moolenaar1e015462005-09-25 22:16:38 +0000902 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
Bram Moolenaar071d4272004-06-13 20:20:40 +0000903
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000904# install the language specific files for tools, if they were unpacked
905install-tool-languages:
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000906 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000907 :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
908 :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
909 :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
910 :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
911 :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
912 :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000913 :sys ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
914 :sys ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000915 :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
916 :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
917
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918# install the language specific files, if they were unpacked
919install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000920 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000921 :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
922 :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
923 :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
924 :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
925 :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
926 :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000927 :sys ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
928 :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000929 :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
930 :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000931 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000932 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
933 $(DEST_MAN_FR) $(INSTALLMLARGS)
934 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
935 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
936 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
937 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
938 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
939 $(DEST_MAN_IT) $(INSTALLMLARGS)
940 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
941 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
942 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
943 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
944 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000945 $(DEST_MAN_PL) $(INSTALLMLARGS)
946 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
947 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
948 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000949 $(DEST_MAN_RU) $(INSTALLMLARGS)
950 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
951 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
952
Bram Moolenaar1e015462005-09-25 22:16:38 +0000953 @if _no.MAKEMO:
954 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
955 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
956 @if os.path.exists(_no.LANGSOURCE):
957 :print installing language files
958 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
959 :chmod $FILEMOD $DEST_LANG/*.vim
960 @if os.path.exists(_no.KMAPSOURCE):
961 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
962 :chmod $FILEMOD $DEST_KMAP/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000963
Bram Moolenaar071d4272004-06-13 20:20:40 +0000964# install the icons for KDE, if the directory exists and the icon doesn't.
965ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
966ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
967ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
968KDEPATH = $HOME/.kde/share/icons
969install-icons {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000970 gp = $ICON48PATH/gvim.png
971 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
972 :copy $SCRIPTSOURCE/vim48x48.png $gp
973 gp = $ICON32PATH/gvim.png
974 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
975 :copy $SCRIPTSOURCE/vim32x32.png $gp
976 gp = $ICON16PATH/gvim.png
977 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
978 :copy $SCRIPTSOURCE/vim16x16.png $gp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000979
980
981$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000982 @if not os.path.exists(_no.TOOLSSOURCE):
983 :print Runtime files not found.
984 :error You need to unpack the runtime archive before running "make install".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000985
986# create links from various names to vim. This is only done when the links
987# (or executables with the same name) don't exist yet.
988installlinks {virtual}: $GUI_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000989 $DEST_BIN/$EXTARGET \
990 $DEST_BIN/$VIEWTARGET \
991 $DEST_BIN/$RVIMTARGET \
992 $DEST_BIN/$RVIEWTARGET \
993 $INSTALLVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000994
995installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000996 $DEST_BIN/$GVIEWTARGET \
997 $DEST_BIN/$RGVIMTARGET \
998 $DEST_BIN/$RGVIEWTARGET \
999 $DEST_BIN/$EVIMTARGET \
1000 $DEST_BIN/$EVIEWTARGET \
1001 $INSTALLGVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +00001002
1003installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
1004installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
1005
1006# These dependencies use an empty buildcheck so that they are only done when
1007# the target doesn't exist.
1008$DEST_BIN/$EXTARGET: {buildcheck = }
1009 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
1010
1011$DEST_BIN/$VIEWTARGET: {buildcheck = }
1012 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
1013
1014$DEST_BIN/$GVIMTARGET: {buildcheck = }
1015 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
1016
1017$DEST_BIN/$GVIEWTARGET: {buildcheck = }
1018 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
1019
1020$DEST_BIN/$RVIMTARGET: {buildcheck = }
1021 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
1022
1023$DEST_BIN/$RVIEWTARGET: {buildcheck = }
1024 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
1025
1026$DEST_BIN/$RGVIMTARGET: {buildcheck = }
1027 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
1028
1029$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
1030 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
1031
1032$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
1033 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
1034
1035$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
1036 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
1037
1038$DEST_BIN/$EVIMTARGET: {buildcheck = }
1039 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
1040
1041$DEST_BIN/$EVIEWTARGET: {buildcheck = }
1042 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
1043
Bram Moolenaar1e015462005-09-25 22:16:38 +00001044# create links for the manual pages with various names to vim. This is only
Bram Moolenaar071d4272004-06-13 20:20:40 +00001045# done when the links (or manpages with the same name) don't exist yet.
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001046INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \
1047 $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \
1048 $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \
1049 $(GVIMDIFFNAME) $(EVIEWNAME)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001050
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001051installmanlinks {virtual}:
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001052 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001053 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
1054 $(DEST_MAN) $(INSTALLMLARGS)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001055
1056#
1057# U N I N S T A L L
1058#
1059uninstall {virtual}{force}: uninstall_runtime
1060 :del {force} $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +00001061 :del {force} $DEST_BIN/vimtutor
Bram Moolenaar071d4272004-06-13 20:20:40 +00001062 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
1063 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
1064 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
1065 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
1066 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
1067 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001068 :del {force} $DEST_BIN/xxd$EXESUF
Bram Moolenaar071d4272004-06-13 20:20:40 +00001069
1070# Note: "deldir" will fail if any files were added after "make install", that
1071# is intentionally: Keep files the user added.
1072uninstall_runtime {virtual}{force}:
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001073 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001074 :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS)
1075 :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS)
1076 :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS)
1077 :sys ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS)
1078 :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS)
1079 :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS)
1080 :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001081 :sys ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS)
1082 :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001083 :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
1084 :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001085 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001086 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1087 $(DEST_MAN) $(INSTALLMLARGS)
1088 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1089 $(DEST_MAN_FR) $(INSTALLMLARGS)
1090 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1091 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
1092 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1093 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
1094 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1095 $(DEST_MAN_IT) $(INSTALLMLARGS)
1096 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1097 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
1098 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1099 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
1100 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001101 $(DEST_MAN_PL) $(INSTALLMLARGS)
1102 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1103 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
1104 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001105 $(DEST_MAN_RU) $(INSTALLMLARGS)
1106 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1107 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
1108 :del {force} $DEST_MAN/xxd.1
1109 :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1
1110 :del {force} $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001111 :del {force} $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001112 :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1
1113
Bram Moolenaar071d4272004-06-13 20:20:40 +00001114 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
1115 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
1116 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
1117 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1118 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1119 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1120 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1121 :del {force} $SYS_OPTWIN_FILE
1122 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1123 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1124 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1125 :del {force} $DEST_PRINT/*.ps
1126 :del {force}{recursive} $DEST_MACRO
1127 :del {force}{recursive} $DEST_TUTOR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001128 :del {force}{recursive} $DEST_SPELL
Bram Moolenaar071d4272004-06-13 20:20:40 +00001129 :del {force}{recursive} $DEST_TOOLS
1130 :del {force}{recursive} $DEST_LANG
1131 :del {force}{recursive} $DEST_KMAP
1132 :del {force}{recursive} $DEST_COMP
1133 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1134 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +00001135 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt $DEST_AUTO/xml/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00001136 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +00001137 :deldir {force} $DEST_FTP $DEST_AUTO/xml $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
Bram Moolenaar1e015462005-09-25 22:16:38 +00001138# This will fail when other Vim versions are installed, no worries.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001139 @try:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001140 :deldir $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001141 @except:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001142 :print Cannot delete $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001143
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001144###############################################################################
1145### MacOS X installation
1146###
1147### This installs a runnable Vim.app in $(prefix)
1148
1149REZ = /Developer/Tools/Rez
1150RESDIR = $(APPDIR)/Contents/Resources
1151@r = re.compile('.*VIM_VERSION_SHORT\\s*"(\\d[^"]*)".*', re.S)
1152VERSION = /`r.match(open("version.h").read()).group(1)`
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001153
1154### Common flags
1155M4FLAGSX = $?(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001156 -DAPP_VER=$(VERSION)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001157
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001158# Resources used for the Mac are in one directory.
1159RSRC_DIR = os_mac_rsrc
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001160
1161:attr {directory = $DIRMOD} $RESDIR
1162
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001163install_macosx {virtual}: gui_bundle
1164# Remove the link to the runtime dir, don't want to copy all of that.
1165 :delete {force} $(RESDIR)/vim/runtime
1166 :copy {r} $APPDIR $DESTDIR$prefix
1167 :tree $DESTDIR$prefix {dirname = AAPDIR}
1168 :delete {recursive} $name
1169# Install the runtime files. Recursive!
1170 :mkdir {r}{f} $DESTDIR$prefix/$RESDIR/vim/runtime
1171# :mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
1172 :execute main.aap PREFIX=$DESTDIR$prefix/$RESDIR/vim VIMRTLOC=$DESTDIR$prefix/$RESDIR/vim/runtime installruntime
1173# Put the link back.
1174 :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
1175# TODO: Create the vimtutor application.
1176
Bram Moolenaardfc7aa22007-09-25 20:13:54 +00001177gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001178 bundle-resource bundle-language
1179
1180bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
1181# Make a link to the runtime directory, so that we can try out the executable
1182# without installing it.
1183 :mkdir {r}{f} $(RESDIR)/vim
1184 :symlink {quiet} `os.getcwd()`/../runtime $(RESDIR)/vim/runtime
1185
1186bundle-executable {virtual}: $(VIMTARGET)
1187 :mkdir {r}{f} $(APPDIR)/Contents/MacOS
1188 :copy $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
1189
1190bundle-info {virtual}: bundle-dir
1191 :print Creating PkgInfo
1192 :print "APPLVIM!" >! $(APPDIR)/Contents/PkgInfo
1193 :print Creating Info.plist
1194 :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
1195
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001196bundle-resource {virtual}: bundle-dir bundle-rsrc
Bram Moolenaardfc7aa22007-09-25 20:13:54 +00001197 :copy {force} $(RSRC_DIR)/*.icns $(RESDIR)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001198
1199### Classic resources
1200# Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
1201# This file is also required for OS X Vim.
1202bundle-rsrc {virtual}: os_mac.rsr.hqx
1203 :print Creating resource fork
1204 :sys python dehqx.py $source
1205 :del {force} gui_mac.rsrc
1206 :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc
1207
1208# po/Make_osx.pl says something about generating a Mac message file
1209# for Ukrananian. Would somebody using Mac OS X in Ukranian
1210# *really* be upset that Carbon Vim was not localised in
1211# Ukranian?
1212#
1213#bundle-language: bundle-dir po/Make_osx.pl
1214# cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG)
1215bundle-language {virtual}: bundle-dir
1216
1217$(APPDIR)/Contents:
1218 :mkdir {r} $(APPDIR)/Contents/MacOS
1219 :mkdir {r} $(RESDIR)/English.lproj
1220
Bram Moolenaar071d4272004-06-13 20:20:40 +00001221
1222# vim: sts=4 sw=4 :