blob: 21b617446c5bd00670808a966259fb0b6cf52b4b [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 Moolenaar4f246a92007-12-31 15:42:13 +000066 config_args = `file2string("config.arg")`
Bram Moolenaar1e015462005-09-25 22:16:38 +000067 :sys CONFIG_STATUS=auto/config.status
Bram Moolenaar4f246a92007-12-31 15:42:13 +000068 ./configure.aap $config_args
Bram Moolenaardfc7aa22007-09-25 20:13:54 +000069 --with-mac-arch=$arch
Bram Moolenaar071d4272004-06-13 20:20:40 +000070 --cache-file=auto/config.cache
71
72 # Configure arguments: create an empty "config.arg" file when its missing
73 config.arg:
Bram Moolenaar1e015462005-09-25 22:16:38 +000074 :touch {exist} config.arg
Bram Moolenaar071d4272004-06-13 20:20:40 +000075
76 # "auto/config.aap" contains a lot of settings, such as the name of the
77 # executable "Target".
78 # First update it, forcefully if the "reconfig" target was used.
79 @if _no.TARGETARG != "comment" and _no.TARGETARG != "make":
Bram Moolenaar1e015462005-09-25 22:16:38 +000080 @if "reconfig" in var2list(_no.TARGETARG):
81 :del {force} auto/config.cache auto/config.status
82 :update {force} auto/config.aap
83 @else:
84 :update auto/config.aap
Bram Moolenaar071d4272004-06-13 20:20:40 +000085
86# Include the recipe that autoconf generated.
87:include auto/config.aap
88
Bram Moolenaara226a6d2006-02-26 23:59:20 +000089# Unfortunately "-M" doesn't work when building for two architectures. Switch
90# back to PPC only.
91@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
92 CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
93
Bram Moolenaar071d4272004-06-13 20:20:40 +000094# A "PREFIX=dir" argument overrules the value of $prefix
Bram Moolenaar8ab561d2006-03-23 22:44:10 +000095# But don't use the default "/usr/local".
96@if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local':
Bram Moolenaar071d4272004-06-13 20:20:40 +000097 prefix = $PREFIX
98
99# Don't want "~/" in prefix.
100prefix = `os.path.expanduser(prefix)`
101
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000102# For Mac.
103APPDIR = $(VIMNAME).app
104
105### Names of the programs and targets
106VIMTARGET = $VIMNAME$EXESUF
107EXTARGET = $EXNAME$LNKSUF
108VIEWTARGET = $VIEWNAME$LNKSUF
109GVIMNAME = g$VIMNAME
110GVIMTARGET = $GVIMNAME$LNKSUF
111GVIEWNAME = g$VIEWNAME
112GVIEWTARGET = $GVIEWNAME$LNKSUF
113RVIMNAME = r$VIMNAME
114RVIMTARGET = $RVIMNAME$LNKSUF
115RVIEWNAME = r$VIEWNAME
116RVIEWTARGET = $RVIEWNAME$LNKSUF
117RGVIMNAME = r$GVIMNAME
118RGVIMTARGET = $RGVIMNAME$LNKSUF
119RGVIEWNAME = r$GVIEWNAME
120RGVIEWTARGET = $RGVIEWNAME$LNKSUF
121VIMDIFFNAME = $(VIMNAME)diff
122GVIMDIFFNAME = g$VIMDIFFNAME
123VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
124GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
125EVIMNAME = e$VIMNAME
126EVIMTARGET = $EVIMNAME$LNKSUF
127EVIEWNAME = e$VIEWNAME
128EVIEWTARGET = $EVIEWNAME$LNKSUF
129
Bram Moolenaar071d4272004-06-13 20:20:40 +0000130#
131# G U I variant
132#
133# The GUI is selected by configure, a lot of other things depend on it.
134#
135:variant GUI
136 GTK
Bram Moolenaar1e015462005-09-25 22:16:38 +0000137 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
138 gui_gtk_f.c
139 GUI_OBJ =
140 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
141 GUI_IPATH = $GUI_INC_LOC
142 GUI_LIBS_DIR = $GUI_LIB_LOC
143 GUI_LIBS1 =
144 GUI_LIBS2 = $GTK_LIBNAME
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000145 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000146 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000147 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000148 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000149 GUI_BUNDLE =
150 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151 MOTIF
Bram Moolenaar1e015462005-09-25 22:16:38 +0000152 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
153 gui_xmdlg.c gui_xmebw.c
154 GUI_OBJ =
155 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
156 GUI_IPATH = $GUI_INC_LOC
157 GUI_LIBS_DIR = $GUI_LIB_LOC
158 GUI_LIBS1 =
159 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000160 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000161 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000162 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000163 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000164 GUI_BUNDLE =
165 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166 ATHENA
Bram Moolenaar1e015462005-09-25 22:16:38 +0000167 # XAW_LIB et al. can be overruled to use Xaw3d widgets
168 XAW_LIB ?= -lXaw
169 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
170 gui_at_sb.c gui_at_fs.c
171 GUI_OBJ =
172 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
173 GUI_IPATH = $GUI_INC_LOC
174 GUI_LIBS_DIR = $GUI_LIB_LOC
175 GUI_LIBS1 = $XAW_LIB
176 GUI_LIBS2 = -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000177 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000178 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000179 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000180 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000181 GUI_BUNDLE =
182 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183 NEXTAW
Bram Moolenaar1e015462005-09-25 22:16:38 +0000184 # XAW_LIB et al. can be overruled to use Xaw3d widgets
185 XAW_LIB ?= -lXaw
186 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
187 gui_at_fs.c
188 GUI_OBJ =
189 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
190 GUI_IPATH = $GUI_INC_LOC
191 GUI_LIBS_DIR = $GUI_LIB_LOC
192 GUI_LIBS1 = $NEXTAW_LIB
193 GUI_LIBS2 = -lXt
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000194 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000195 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000196 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000197 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000198 GUI_BUNDLE =
199 GUI_TESTARG =
200 CARBONGUI
201 GUI_SRC = gui.c gui_mac.c pty.c
202 GUI_OBJ =
203 GUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \
204 -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe
205 GUI_IPATH = $GUI_INC_LOC
206 GUI_LIBS_DIR = $GUI_LIB_LOC
207 GUI_LIBS1 = -framework Carbon
208 GUI_LIBS2 =
209 GUI_INSTALL = install_macosx
210 GUI_TARGETS = installglinks
211 GUI_MAN_TARGETS = yes
212 GUI_TESTTARGET = gui
213 GUI_BUNDLE = gui_bundle
214 GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215 PHOTONGUI
Bram Moolenaar1e015462005-09-25 22:16:38 +0000216 GUI_SRC = gui.c gui_photon.c pty.c
217 GUI_OBJ =
218 GUI_DEFS = -DFEAT_GUI_PHOTON
219 GUI_IPATH =
220 GUI_LIBS_DIR =
221 GUI_LIBS1 = -lph -lphexlib
222 GUI_LIBS2 =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000223 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000224 GUI_TARGETS = installglinks
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000225 GUI_MAN_TARGETS = yes
Bram Moolenaar1e015462005-09-25 22:16:38 +0000226 GUI_TESTTARGET = gui
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000227 GUI_BUNDLE =
228 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229 *
Bram Moolenaar1e015462005-09-25 22:16:38 +0000230 GUI_SRC =
231 GUI_OBJ =
232 GUI_DEFS =
233 GUI_IPATH =
234 GUI_LIBS_DIR =
235 GUI_LIBS1 =
236 GUI_LIBS2 =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000237 GUI_INSTALL = install_normal
Bram Moolenaar1e015462005-09-25 22:16:38 +0000238 GUI_TARGETS =
239 GUI_MAN_TARGETS =
240 GUI_TESTTARGET =
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000241 GUI_BUNDLE =
242 GUI_TESTARG =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000243
244
245PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000246POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000247CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
248CPPFLAGS =
249
250ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
251LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000252LIBS = $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 +0000253
254Target = $VIMNAME
255
256# reconfig target also builds Vim (reconfiguration is handled above).
257reconfig {virtual}: $Target
258
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000259distclean: clean
260 :del {force} auto/config.h auto/config.aap
261 :del {force} auto/config.cache auto/config.status
262
Bram Moolenaar071d4272004-06-13 20:20:40 +0000263
264# Execute the test scripts. Run these after compiling Vim, before installing.
265#
266# This will produce a lot of garbage on your screen, including a few error
267# messages. Don't worry about that.
268# If there is a real error, there will be a difference between "test.out" and
269# a "test99.ok" file.
Bram Moolenaarf711faf2007-05-10 16:48:19 +0000270# If everything is alright, the final message will be "ALL DONE".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000271#
272test check:
273 VimProg = ../$Target
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000274 :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275
276testclean {virtual}:
277 :del {force} testdir/*.out testdir/test.log
278
Bram Moolenaar071d4272004-06-13 20:20:40 +0000279# When no fetch target exists we are not a child of the ../main.aap recipe,
280# Use ../main.aap to do the fetching.
281# --- If you get an error here for wrong number of arguments, you need to
282# update to a newer version of A-A-P.
283@if not has_target("fetch"):
284 fetch:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000285 :execute ../main.aap fetch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000286
287
288# All the source files that need to be compiled.
289# Some are optional and depend on configure.
290# "version.c" is missing, it's always compiled (see below).
291Source =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000292 buffer.c
293 charset.c
294 diff.c
295 digraph.c
296 edit.c
297 eval.c
298 ex_cmds.c
299 ex_cmds2.c
300 ex_docmd.c
301 ex_eval.c
302 ex_getln.c
303 fileio.c
304 fold.c
305 getchar.c
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000306 hardcopy.c
Bram Moolenaar607a95ed2006-03-28 20:57:42 +0000307 hashtab.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000308 if_cscope.c
309 if_xcmdsrv.c
310 main.c
311 mark.c
312 memfile.c
313 memline.c
314 menu.c
315 message.c
316 misc1.c
317 misc2.c
318 move.c
319 mbyte.c
320 normal.c
321 ops.c
322 option.c
323 os_unix.c
324 auto/pathdef.c
Bram Moolenaar607a95ed2006-03-28 20:57:42 +0000325 popupmnu.c
Bram Moolenaar1e015462005-09-25 22:16:38 +0000326 quickfix.c
327 regexp.c
328 screen.c
329 search.c
330 spell.c
331 syntax.c
332 tag.c
333 term.c
334 ui.c
335 undo.c
336 window.c
337 $OS_EXTRA_SRC
338 $GUI_SRC
339 $HANGULIN_SRC
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000340 $MZSCHEME_SRC
Bram Moolenaar1e015462005-09-25 22:16:38 +0000341 $PERL_SRC
342 $NETBEANS_SRC
343 $PYTHON_SRC
344 $TCL_SRC
345 $RUBY_SRC
346 $SNIFF_SRC
347 $WORKSHOP_SRC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000348
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000349Objects =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000350 $GUI_OBJ
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000351
Bram Moolenaar071d4272004-06-13 20:20:40 +0000352# TODO: make is still used for subdirectories, need to write a recipe.
353MAKE ?= make
354
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000355all: $Target $GUI_BUNDLE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000356
357# This dependency is required to build auto/osdef.h before automatic
358# dependencies are generated.
359$Source version.c : auto/osdef.h
360
361# Need to mention that the target also depends on version.c, since it's not
Bram Moolenaarf711faf2007-05-10 16:48:19 +0000362# included in $Source
Bram Moolenaar071d4272004-06-13 20:20:40 +0000363$Target : version.c
364
365# Some sources are to be found in the "auto" directory.
366SRCPATH += auto
367
368# When building Vim always compile version.c to get the timestamp.
369:filetype
370 declare my_prog
371:attr {filetype = my_prog} $Target
372
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000373:program $Target : $Source $Objects
Bram Moolenaar071d4272004-06-13 20:20:40 +0000374
375:action build my_prog object
Bram Moolenaar1e015462005-09-25 22:16:38 +0000376 version_obj = `src2obj("version.c")`
377 :do compile {target = $version_obj} version.c
378 #:do build {target = $target {filetype = program}} $source $version_obj
379 link_sed = $BDIR/link.sed
380 @if os.path.exists(link_sed):
381 :move {force} $link_sed auto/link.sed
382 @else:
383 :del {force} auto/link.sed
384 :update link2.sh
385 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
386 -o $target $source $version_obj $LIBS" \
387 MAKE="aap" sh ./link2.sh
388 :copy {force} auto/link.sed $BDIR/link.sed
Bram Moolenaar071d4272004-06-13 20:20:40 +0000389
390# "link.sh" must be modified for A-A-P
391link2.sh : link.sh
392 :print Adjusting $-source for A-A-P.
393 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000394 >! $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000395
396xxd/xxd$EXESUF: xxd/xxd.c
397 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000398 $MAKE -f Makefile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000399
400# Build the language specific files if they were unpacked.
401# Generate the converted .mo files separately, it's no problem if this fails.
402languages {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000403 @if _no.MAKEMO:
404 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
405 @try:
406 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
407 @except:
408 :print Generated converted language files failed, continuing
Bram Moolenaar071d4272004-06-13 20:20:40 +0000409
410# Update the *.po files for changes in the sources. Only run manually.
411update-po {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000412 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
Bram Moolenaar071d4272004-06-13 20:20:40 +0000413
414auto/if_perl.c: if_perl.xs
Bram Moolenaar1e015462005-09-25 22:16:38 +0000415 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
416 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
417 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418
419auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
Bram Moolenaar1e015462005-09-25 22:16:38 +0000420 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421
422pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
423
424auto/pathdef.c: auto/config.aap
Bram Moolenaar1e015462005-09-25 22:16:38 +0000425 :print Creating $target
426 :print >! $target /* pathdef.c */
427 :print >> $target /* This file is automatically created by main.aap */
428 :print >> $target /* DO NOT EDIT! Change main.aap only. */
429 :print >> $target $#include "vim.h"
430 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
431 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
432 v = $CC -c -I$srcdir $CFLAGS
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000433 @v = string.replace(v, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000434 :print >> $target char_u *all_cflags = (char_u *)"$v";
435 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
436 link_sed = $BDIR/link.sed
437 @if os.path.exists(link_sed):
438 # filter $linkcmd through $BDIR/link.sed
439 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
Bram Moolenaar2df6dcc2004-07-12 15:53:54 +0000440 @linkcmd = string.replace(linkcmd, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000441 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
442 @if _no.get("COMPILEDBY"):
443 who = $COMPILEDBY
Bram Moolenaar4f246a92007-12-31 15:42:13 +0000444 where =
Bram Moolenaar1e015462005-09-25 22:16:38 +0000445 @else:
446 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
Bram Moolenaar071d4272004-06-13 20:20:40 +0000447
Bram Moolenaar1e015462005-09-25 22:16:38 +0000448 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
Bram Moolenaar4f246a92007-12-31 15:42:13 +0000449 @who = string.replace(who, '"', '\\"')
450 @where = string.replace(where, '"', '\\"')
Bram Moolenaar1e015462005-09-25 22:16:38 +0000451 :print >> $target char_u *compiled_user = (char_u *)"$who";
452 :print >> $target char_u *compiled_sys = (char_u *)"$where";
Bram Moolenaar071d4272004-06-13 20:20:40 +0000453
454
Bram Moolenaar071d4272004-06-13 20:20:40 +0000455### Names of the tools that are also made
456TOOLS = xxd/xxd$EXESUF
457
458# Root of the installation tree. Empty for a normal install, set to an
459# existing path to install into a special place (for generating a package).
460DESTDIR ?=
461
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000462### Location of man pages under $MANTOPDIR
463MAN1DIR = /man1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464
465### Location of Vim files (should not need to be changed, and
466### some things might not work when they are changed!)
467VIMDIR = /vim
468@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
469VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
470HELPSUBDIR = /doc
471COLSUBDIR = /colors
472SYNSUBDIR = /syntax
473INDSUBDIR = /indent
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000474AUTOSUBDIR = /autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475PLUGSUBDIR = /plugin
476FTPLUGSUBDIR = /ftplugin
477LANGSUBDIR = /lang
478COMPSUBDIR = /compiler
479KMAPSUBDIR = /keymap
480MACROSUBDIR = /macros
481TOOLSSUBDIR = /tools
482TUTORSUBDIR = /tutor
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000483SPELLSUBDIR = /spell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000484PRINTSUBDIR = /print
485PODIR = po
486
Bram Moolenaar1e015462005-09-25 22:16:38 +0000487### VIMLOC common root of the Vim files (all versions)
488### VIMRTLOC common root of the runtime Vim files (this version)
489### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000490### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
Bram Moolenaar1e015462005-09-25 22:16:38 +0000491### HELPSUBLOC location for help files
492### COLSUBLOC location for colorscheme files
493### SYNSUBLOC location for syntax files
494### INDSUBLOC location for indent files
495### AUTOSUBLOC location for standard autoload files
496### PLUGSUBLOC location for standard plugin files
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497### FTPLUGSUBLOC location for ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000498### LANGSUBLOC location for language files
499### COMPSUBLOC location for compiler files
500### KMAPSUBLOC location for keymap files
501### MACROSUBLOC location for macro files
502### TOOLSSUBLOC location for tools files
503### TUTORSUBLOC location for tutor files
504### PRINTSUBLOC location for print files
505### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000506### You can override these if you want to install them somewhere else.
507### Edit feature.h for compile-time settings.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000508VIMLOC = $DATADIR$VIMDIR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000509@if not _no.get("VIMRTLOC"):
510 VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000511VIMRCLOC = $VIMLOC
512HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
513COLSUBLOC = $VIMRTLOC$COLSUBDIR
514SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
515INDSUBLOC = $VIMRTLOC$INDSUBDIR
516AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
517PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
518FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
519LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
520COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
521KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
522MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
523TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
524TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000525SPELLSUBLOC = $VIMRTLOC$SPELLSUBDIR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000526PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
527SCRIPTLOC = $VIMRTLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000528
529### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
530### the runtime directory is not below it.
531#VIMRUNTIMEDIR = $VIMRTLOC
532
533### Name of the evim file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000534EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
535MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536
537### Name of the menu file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000538SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000539SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
540SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
541
542### Name of the bugreport file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000543SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544
545### Name of the file type detection file target.
546SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
547
548### Name of the file type detection file target.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000549SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000550
551### Name of the file type detection script file target.
552SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
553
554### Name of the ftplugin-on file target.
555SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
556
557### Name of the ftplugin-off file target.
558SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
559
560### Name of the indent-on file target.
561SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
562
563### Name of the indent-off file target.
564SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
565
566### Name of the option window script file target.
567SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
568
569### Permissions for binaries
570BINMOD = 755
571
572### Permissions for man page
573MANMOD = 644
574
575### Permissions for help files
576HELPMOD = 644
577
578### Permissions for Perl and shell scripts
579SCRIPTMOD = 755
580
581### Permission for Vim script files (menu.vim, bugreport.vim, ..)
582VIMSCRIPTMOD = 644
583
584### Permissions for all directories that are created
585DIRMOD = 755
586
587### Permissions for all other files that are created
588FILEMOD = 644
589
590# Where to copy the man and help files from
591HELPSOURCE = ../runtime/doc
592
593# Where to copy the script files from (menu, bugreport)
594SCRIPTSOURCE = ../runtime
595
596# Where to copy the colorscheme files from
597COLSOURCE = ../runtime/colors
598
599# Where to copy the syntax files from
600SYNSOURCE = ../runtime/syntax
601
602# Where to copy the indent files from
603INDSOURCE = ../runtime/indent
604
605# Where to copy the standard plugin files from
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000606AUTOSOURCE = ../runtime/autoload
607
608# Where to copy the standard plugin files from
Bram Moolenaar071d4272004-06-13 20:20:40 +0000609PLUGSOURCE = ../runtime/plugin
610
611# Where to copy the ftplugin files from
612FTPLUGSOURCE = ../runtime/ftplugin
613
614# Where to copy the macro files from
615MACROSOURCE = ../runtime/macros
616
617# Where to copy the tools files from
618TOOLSSOURCE = ../runtime/tools
619
620# Where to copy the tutor files from
621TUTORSOURCE = ../runtime/tutor
622
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000623# Where to copy the spell files from
624SPELLSOURCE = ../runtime/spell
625
Bram Moolenaar071d4272004-06-13 20:20:40 +0000626# Where to look for language specific files
627LANGSOURCE = ../runtime/lang
628
629# Where to look for compiler files
630COMPSOURCE = ../runtime/compiler
631
632# Where to look for keymap files
633KMAPSOURCE = ../runtime/keymap
634
635# Where to look for print resource files
636PRINTSOURCE = ../runtime/print
637
638# abbreviations
639DEST_BIN = $DESTDIR$BINDIR
640DEST_VIM = $DESTDIR$VIMLOC
641DEST_RT = $DESTDIR$VIMRTLOC
642DEST_HELP = $DESTDIR$HELPSUBLOC
643DEST_COL = $DESTDIR$COLSUBLOC
644DEST_SYN = $DESTDIR$SYNSUBLOC
645DEST_IND = $DESTDIR$INDSUBLOC
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000646DEST_AUTO = $DESTDIR$AUTOSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000647DEST_PLUG = $DESTDIR$PLUGSUBLOC
648DEST_FTP = $DESTDIR$FTPLUGSUBLOC
649DEST_LANG = $DESTDIR$LANGSUBLOC
650DEST_COMP = $DESTDIR$COMPSUBLOC
651DEST_KMAP = $DESTDIR$KMAPSUBLOC
652DEST_MACRO = $DESTDIR$MACROSUBLOC
653DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
654DEST_TUTOR = $DESTDIR$TUTORSUBLOC
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000655DEST_SPELL = $DESTDIR$SPELLSUBLOC
Bram Moolenaar071d4272004-06-13 20:20:40 +0000656DEST_SCRIPT = $DESTDIR$SCRIPTLOC
657DEST_PRINT = $DESTDIR$PRINTSUBLOC
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000658DEST_MAN_TOP = $DESTDIR$?(MANDIR)
659
660# We assume that the ".../man/xx/man1/" directory is for latin1 manual pages.
661# Some systems use UTF-8, but these should find the ".../man/xx.UTF-8/man1/"
662# directory first.
663# FreeBSD uses ".../man/xx.ISO8859-1/man1" for latin1, use that one too.
664DEST_MAN = $(DEST_MAN_TOP)$(MAN1DIR)
665DEST_MAN_FR = $(DEST_MAN_TOP)/fr$(MAN1DIR)
666DEST_MAN_FR_I = $(DEST_MAN_TOP)/fr.ISO8859-1$(MAN1DIR)
667DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR)
668DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR)
669DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR)
670DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000671DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR)
672DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000673DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
674DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000675
676# These are directories, create them when needed.
677:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
Bram Moolenaar18144c82006-04-12 21:52:12 +0000678 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG
679 $DEST_FTP $DEST_LANG
Bram Moolenaar1e015462005-09-25 22:16:38 +0000680 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000681 $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL
682 $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000683 $DEST_MAN_IT_I $DEST_MAN_IT_U
684 $DEST_MAN_PL $DEST_MAN_PL_U
685 $DEST_MAN_RU $DEST_MAN_RU_U
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686
687#
688# I N S T A L L
689#
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000690install: $GUI_INSTALL
691
692install_normal:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000693 @if not os.path.isdir(_no.DEST_BIN):
694 @try:
695 :mkdir $DEST_BIN
696 @except:
697 @ pass
698 @if os.access(_no.DEST_BIN, os.W_OK):
699 # Bin directory is writable, install directly.
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000700 :update installvim installtools $INSTALL_LANGS install-icons
Bram Moolenaar071d4272004-06-13 20:20:40 +0000701 @else:
702 # Bin directory is not writable, need to become root.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000703 :print The destination directory "$DEST_BIN" is not writable.
704 :print If this is the wrong directory, use PREFIX to specify another one.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000705 :print Otherwise, type the root password to continue installing.
706 :asroot $AAP install
707
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000708installvim {virtual}: installvimbin installtutorbin \
709 installruntime installlinks installmanlinks
Bram Moolenaar071d4272004-06-13 20:20:40 +0000710
711installvimbin {virtual}{force}: $Target $DEST_BIN
Bram Moolenaar1e015462005-09-25 22:16:38 +0000712 exe = $DEST_BIN/$VIMTARGET
713 @if os.path.exists(exe):
714 # Move the old executable aside and delete it. Any other method
715 # may cause a crash if the executable is currently being used.
716 :move {force} $exe $(exe).rm
717 :del {force} $(exe).rm
718 :copy $VIMTARGET $DEST_BIN
719 :do strip $exe
720 :chmod $BINMOD $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721# may create a link to the new executable from /usr/bin/vi
Bram Moolenaar1e015462005-09-25 22:16:38 +0000722 @if _no.get("LINKIT"):
723 :sys $LINKIT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000724
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000725# Long list of arguments for the shell script that installs the manual pages
726# for one language.
727INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \
728 $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME)
729
730# Install most of the runtime files
731installruntime {virtual}: installrtbase installmacros installtutor installspell
732
Bram Moolenaar071d4272004-06-13 20:20:40 +0000733# install the help files; first adjust the contents for the location
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000734installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000735 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
Bram Moolenaar18144c82006-04-12 21:52:12 +0000736 $DEST_FTP $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG $DEST_TUTOR
737 $DEST_COMP $DEST_SPELL $DEST_PRINT
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000738 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000739 :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000740
741 :cd $HELPSOURCE
742 @try:
743 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
744 @except:
745 XTRA = # It's OK if there are no matches.
Bram Moolenaar1e015462005-09-25 22:16:38 +0000746 :copy *.txt tags $XTRA $DEST_HELP
Bram Moolenaar071d4272004-06-13 20:20:40 +0000747 :cd -
748 :cd $DEST_HELP
Bram Moolenaar1e015462005-09-25 22:16:38 +0000749 :chmod $HELPMOD *.txt tags $XTRA
Bram Moolenaar071d4272004-06-13 20:20:40 +0000750 :cd -
Bram Moolenaar1e015462005-09-25 22:16:38 +0000751 :copy $HELPSOURCE/*.pl $DEST_HELP
752 :chmod $SCRIPTMOD $DEST_HELP/*.pl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000753# install the menu files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000754 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
755 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
756 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
757 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
758 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
759 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760# install the evim file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000761 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
762 :chmod $VIMSCRIPTMOD $MSWIN_FILE
763 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
764 :chmod $VIMSCRIPTMOD $EVIM_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000765# install the bugreport file
Bram Moolenaar1e015462005-09-25 22:16:38 +0000766 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
767 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000768# install the example vimrc files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000769 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
770 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
771 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
772 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000773# install the file type detection files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000774 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
775 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
776 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
777 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
778 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
779 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
780 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
781 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
782 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
783 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
784 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
785 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
786 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
787 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
788 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
789 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000790# install the print resource files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000791 :copy $PRINTSOURCE/*.ps $DEST_PRINT
792 :chmod $FILEMOD $DEST_PRINT/*.ps
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793# install the colorscheme files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000794 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
795 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000796# install the syntax files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000797 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
798 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000799# install the indent files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000800 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
801 :chmod $HELPMOD $DEST_IND/*.vim
Bram Moolenaar87e25fd2005-07-27 21:13:01 +0000802# install the standard autoload files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000803 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
804 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +0000805 :copy $AUTOSOURCE/xml/*.vim $DEST_AUTO/xml
806 :chmod $HELPMOD $DEST_AUTO/xml/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000807# install the standard plugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000808 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
809 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000810# install the ftplugin files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000811 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
812 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000813# install the compiler files
Bram Moolenaar1e015462005-09-25 22:16:38 +0000814 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
815 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000816
817installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
Bram Moolenaar1e015462005-09-25 22:16:38 +0000818 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
819 # Delete any CVS and AAPDIR directories.
820 # Use the ":tree" command if possible. It was added later, fall back
821 # to using "find" when it doesn't work.
822 @try:
823 :tree $DEST_MACRO {dirname = CVS}
824 :del {recursive} $name
825 :tree $DEST_MACRO {dirname = AAPDIR}
826 :del {recursive} $name
827 :tree $DEST_MACRO {dirname = .*}
828 :chmod $DIRMOD $name
829 :tree $DEST_MACRO {filename = .*}
830 :chmod $FILEMOD $name
831 @except:
832 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
833 @ if ok and cvsdirs:
834 :del {recursive} $cvsdirs
835 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
836 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
837 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
Bram Moolenaar071d4272004-06-13 20:20:40 +0000838
839# install the tutor files
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000840installtutorbin {virtual}{force}: $DEST_VIM
Bram Moolenaar1e015462005-09-25 22:16:38 +0000841 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
842 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000843
844installtutor {virtual}{force}: $DEST_RT $DEST_TUTOR
Bram Moolenaar1e015462005-09-25 22:16:38 +0000845 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
846 :chmod $HELPMOD $DEST_TUTOR/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000848# Install the spell files, if they exist. This assumes at least the English
849# spell file is there.
850installspell {virtual}: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL)
851 enspl = $(SPELLSOURCE)/en.latin1.spl
852 @if os.path.exists(enspl):
853 :copy $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.vim $(DEST_SPELL)
854 :chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.vim
855 @try:
856 :copy $(SPELLSOURCE)/*.sug $(DEST_SPELL)
857 :chmod $(HELPMOD) $(DEST_SPELL)/*.sug
858 @except:
859 @ pass
860
Bram Moolenaar071d4272004-06-13 20:20:40 +0000861# install helper program xxd
862installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000863 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS \
864 $INSTALL_TOOL_LANGS
Bram Moolenaar1e015462005-09-25 22:16:38 +0000865 xxd = $DEST_BIN/xxd$EXESUF
866 @if os.path.exists(xxd):
867 :move {force} $xxd $(xxd).rm
868 :del $(xxd).rm
869 :copy xxd/xxd$EXESUF $DEST_BIN
870 :do strip $DEST_BIN/xxd$EXESUF
871 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000872 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000873 :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS)
874#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875# install the runtime tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000876 @try:
877 @ if aap_has(":tree"):
878 # New method: copy everything and delete CVS and AAPDIR dirs
879 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
880 :tree $DEST_TOOLS {dirname = CVS}
881 :delete {recursive} $name
882 :tree $DEST_TOOLS {dirname = AAPDIR}
883 :delete {recursive} $name
884 @except:
885 # Old method: copy only specific files and directories.
886 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
887 :chmod $FILEMOD $DEST_TOOLS/*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000888# replace the path in some tools
Bram Moolenaar1e015462005-09-25 22:16:38 +0000889 :progsearch perlpath perl
890 @if perlpath:
891 :cat $TOOLSSOURCE/efm_perl.pl |
892 :eval re.sub("/usr/bin/perl", perlpath, stdin)
893 >! $DEST_TOOLS/efm_perl.pl
894 @else:
895 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000896
Bram Moolenaar1e015462005-09-25 22:16:38 +0000897 :progsearch awkpath nawk gawk awk
898 @if awkpath:
899 :cat $TOOLSSOURCE/mve.awk |
900 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
901 >! $DEST_TOOLS/mve.awk
902 @else:
903 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000904
Bram Moolenaar1e015462005-09-25 22:16:38 +0000905 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
Bram Moolenaar071d4272004-06-13 20:20:40 +0000906
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000907# install the language specific files for tools, if they were unpacked
908install-tool-languages:
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000909 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000910 :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
911 :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
912 :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
913 :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
914 :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
915 :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000916 :sys ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
917 :sys ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000918 :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
919 :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
920
Bram Moolenaar071d4272004-06-13 20:20:40 +0000921# install the language specific files, if they were unpacked
922install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000923 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000924 :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
925 :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
926 :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
927 :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
928 :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
929 :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000930 :sys ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
931 :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000932 :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
933 :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000934 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000935 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
936 $(DEST_MAN_FR) $(INSTALLMLARGS)
937 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
938 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
939 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
940 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
941 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
942 $(DEST_MAN_IT) $(INSTALLMLARGS)
943 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
944 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
945 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
946 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
947 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
Bram Moolenaar899dddf2006-03-26 21:06:50 +0000948 $(DEST_MAN_PL) $(INSTALLMLARGS)
949 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
950 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
951 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +0000952 $(DEST_MAN_RU) $(INSTALLMLARGS)
953 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
954 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
955
Bram Moolenaar1e015462005-09-25 22:16:38 +0000956 @if _no.MAKEMO:
957 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
958 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
959 @if os.path.exists(_no.LANGSOURCE):
960 :print installing language files
961 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
962 :chmod $FILEMOD $DEST_LANG/*.vim
963 @if os.path.exists(_no.KMAPSOURCE):
964 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
965 :chmod $FILEMOD $DEST_KMAP/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000966
Bram Moolenaar071d4272004-06-13 20:20:40 +0000967# install the icons for KDE, if the directory exists and the icon doesn't.
968ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
969ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
970ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
971KDEPATH = $HOME/.kde/share/icons
972install-icons {virtual}:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000973 gp = $ICON48PATH/gvim.png
974 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
975 :copy $SCRIPTSOURCE/vim48x48.png $gp
976 gp = $ICON32PATH/gvim.png
977 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
978 :copy $SCRIPTSOURCE/vim32x32.png $gp
979 gp = $ICON16PATH/gvim.png
980 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
981 :copy $SCRIPTSOURCE/vim16x16.png $gp
Bram Moolenaar071d4272004-06-13 20:20:40 +0000982
983
984$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
Bram Moolenaar1e015462005-09-25 22:16:38 +0000985 @if not os.path.exists(_no.TOOLSSOURCE):
986 :print Runtime files not found.
987 :error You need to unpack the runtime archive before running "make install".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000988
989# create links from various names to vim. This is only done when the links
990# (or executables with the same name) don't exist yet.
991installlinks {virtual}: $GUI_TARGETS \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000992 $DEST_BIN/$EXTARGET \
993 $DEST_BIN/$VIEWTARGET \
994 $DEST_BIN/$RVIMTARGET \
995 $DEST_BIN/$RVIEWTARGET \
996 $INSTALLVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +0000997
998installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
Bram Moolenaar1e015462005-09-25 22:16:38 +0000999 $DEST_BIN/$GVIEWTARGET \
1000 $DEST_BIN/$RGVIMTARGET \
1001 $DEST_BIN/$RGVIEWTARGET \
1002 $DEST_BIN/$EVIMTARGET \
1003 $DEST_BIN/$EVIEWTARGET \
1004 $INSTALLGVIMDIFF
Bram Moolenaar071d4272004-06-13 20:20:40 +00001005
1006installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
1007installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
1008
1009# These dependencies use an empty buildcheck so that they are only done when
1010# the target doesn't exist.
1011$DEST_BIN/$EXTARGET: {buildcheck = }
1012 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
1013
1014$DEST_BIN/$VIEWTARGET: {buildcheck = }
1015 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
1016
1017$DEST_BIN/$GVIMTARGET: {buildcheck = }
1018 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
1019
1020$DEST_BIN/$GVIEWTARGET: {buildcheck = }
1021 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
1022
1023$DEST_BIN/$RVIMTARGET: {buildcheck = }
1024 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
1025
1026$DEST_BIN/$RVIEWTARGET: {buildcheck = }
1027 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
1028
1029$DEST_BIN/$RGVIMTARGET: {buildcheck = }
1030 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
1031
1032$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
1033 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
1034
1035$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
1036 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
1037
1038$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
1039 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
1040
1041$DEST_BIN/$EVIMTARGET: {buildcheck = }
1042 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
1043
1044$DEST_BIN/$EVIEWTARGET: {buildcheck = }
1045 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
1046
Bram Moolenaar1e015462005-09-25 22:16:38 +00001047# create links for the manual pages with various names to vim. This is only
Bram Moolenaar071d4272004-06-13 20:20:40 +00001048# done when the links (or manpages with the same name) don't exist yet.
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001049INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \
1050 $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \
1051 $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \
1052 $(GVIMDIFFNAME) $(EVIEWNAME)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001053
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001054installmanlinks {virtual}:
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001055 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001056 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
1057 $(DEST_MAN) $(INSTALLMLARGS)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001058
1059#
1060# U N I N S T A L L
1061#
1062uninstall {virtual}{force}: uninstall_runtime
1063 :del {force} $DEST_BIN/$VIMTARGET
Bram Moolenaar071d4272004-06-13 20:20:40 +00001064 :del {force} $DEST_BIN/vimtutor
Bram Moolenaar071d4272004-06-13 20:20:40 +00001065 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
1066 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
1067 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
1068 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
1069 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
1070 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001071 :del {force} $DEST_BIN/xxd$EXESUF
Bram Moolenaar071d4272004-06-13 20:20:40 +00001072
1073# Note: "deldir" will fail if any files were added after "make install", that
1074# is intentionally: Keep files the user added.
1075uninstall_runtime {virtual}{force}:
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001076 :chmod 755 installman.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001077 :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS)
1078 :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS)
1079 :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS)
1080 :sys ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS)
1081 :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS)
1082 :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS)
1083 :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS)
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001084 :sys ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS)
1085 :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001086 :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
1087 :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
Bram Moolenaar910f66f2006-04-05 20:41:53 +00001088 :chmod 755 installml.sh
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001089 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1090 $(DEST_MAN) $(INSTALLMLARGS)
1091 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1092 $(DEST_MAN_FR) $(INSTALLMLARGS)
1093 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1094 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
1095 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1096 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
1097 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1098 $(DEST_MAN_IT) $(INSTALLMLARGS)
1099 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1100 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
1101 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1102 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
1103 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
Bram Moolenaar899dddf2006-03-26 21:06:50 +00001104 $(DEST_MAN_PL) $(INSTALLMLARGS)
1105 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1106 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
1107 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001108 $(DEST_MAN_RU) $(INSTALLMLARGS)
1109 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1110 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
1111 :del {force} $DEST_MAN/xxd.1
1112 :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1
1113 :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 +00001114 :del {force} $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001115 :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1
1116
Bram Moolenaar071d4272004-06-13 20:20:40 +00001117 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
1118 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
1119 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
1120 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1121 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1122 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1123 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1124 :del {force} $SYS_OPTWIN_FILE
1125 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1126 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1127 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1128 :del {force} $DEST_PRINT/*.ps
1129 :del {force}{recursive} $DEST_MACRO
1130 :del {force}{recursive} $DEST_TUTOR
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001131 :del {force}{recursive} $DEST_SPELL
Bram Moolenaar071d4272004-06-13 20:20:40 +00001132 :del {force}{recursive} $DEST_TOOLS
1133 :del {force}{recursive} $DEST_LANG
1134 :del {force}{recursive} $DEST_KMAP
1135 :del {force}{recursive} $DEST_COMP
1136 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1137 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +00001138 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt $DEST_AUTO/xml/*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +00001139 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
Bram Moolenaar18144c82006-04-12 21:52:12 +00001140 :deldir {force} $DEST_FTP $DEST_AUTO/xml $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
Bram Moolenaar1e015462005-09-25 22:16:38 +00001141# This will fail when other Vim versions are installed, no worries.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001142 @try:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001143 :deldir $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001144 @except:
Bram Moolenaar1e015462005-09-25 22:16:38 +00001145 :print Cannot delete $DEST_VIM
Bram Moolenaar071d4272004-06-13 20:20:40 +00001146
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001147###############################################################################
1148### MacOS X installation
1149###
1150### This installs a runnable Vim.app in $(prefix)
1151
1152REZ = /Developer/Tools/Rez
1153RESDIR = $(APPDIR)/Contents/Resources
1154@r = re.compile('.*VIM_VERSION_SHORT\\s*"(\\d[^"]*)".*', re.S)
1155VERSION = /`r.match(open("version.h").read()).group(1)`
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001156
1157### Common flags
1158M4FLAGSX = $?(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001159 -DAPP_VER=$(VERSION)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001160
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001161# Resources used for the Mac are in one directory.
1162RSRC_DIR = os_mac_rsrc
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001163
1164:attr {directory = $DIRMOD} $RESDIR
1165
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001166install_macosx {virtual}: gui_bundle
1167# Remove the link to the runtime dir, don't want to copy all of that.
1168 :delete {force} $(RESDIR)/vim/runtime
1169 :copy {r} $APPDIR $DESTDIR$prefix
1170 :tree $DESTDIR$prefix {dirname = AAPDIR}
1171 :delete {recursive} $name
1172# Install the runtime files. Recursive!
1173 :mkdir {r}{f} $DESTDIR$prefix/$RESDIR/vim/runtime
1174# :mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
1175 :execute main.aap PREFIX=$DESTDIR$prefix/$RESDIR/vim VIMRTLOC=$DESTDIR$prefix/$RESDIR/vim/runtime installruntime
1176# Put the link back.
1177 :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
1178# TODO: Create the vimtutor application.
1179
Bram Moolenaardfc7aa22007-09-25 20:13:54 +00001180gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001181 bundle-resource bundle-language
1182
1183bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
1184# Make a link to the runtime directory, so that we can try out the executable
1185# without installing it.
1186 :mkdir {r}{f} $(RESDIR)/vim
1187 :symlink {quiet} `os.getcwd()`/../runtime $(RESDIR)/vim/runtime
1188
1189bundle-executable {virtual}: $(VIMTARGET)
1190 :mkdir {r}{f} $(APPDIR)/Contents/MacOS
1191 :copy $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
1192
1193bundle-info {virtual}: bundle-dir
1194 :print Creating PkgInfo
1195 :print "APPLVIM!" >! $(APPDIR)/Contents/PkgInfo
1196 :print Creating Info.plist
1197 :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
1198
Bram Moolenaard5ab34b2007-05-05 17:15:44 +00001199bundle-resource {virtual}: bundle-dir bundle-rsrc
Bram Moolenaardfc7aa22007-09-25 20:13:54 +00001200 :copy {force} $(RSRC_DIR)/*.icns $(RESDIR)
Bram Moolenaar8ab561d2006-03-23 22:44:10 +00001201
1202### Classic resources
1203# Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
1204# This file is also required for OS X Vim.
1205bundle-rsrc {virtual}: os_mac.rsr.hqx
1206 :print Creating resource fork
1207 :sys python dehqx.py $source
1208 :del {force} gui_mac.rsrc
1209 :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc
1210
1211# po/Make_osx.pl says something about generating a Mac message file
1212# for Ukrananian. Would somebody using Mac OS X in Ukranian
1213# *really* be upset that Carbon Vim was not localised in
1214# Ukranian?
1215#
1216#bundle-language: bundle-dir po/Make_osx.pl
1217# cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG)
1218bundle-language {virtual}: bundle-dir
1219
1220$(APPDIR)/Contents:
1221 :mkdir {r} $(APPDIR)/Contents/MacOS
1222 :mkdir {r} $(RESDIR)/English.lproj
1223
Bram Moolenaar071d4272004-06-13 20:20:40 +00001224
1225# vim: sts=4 sw=4 :