1 # A-A-P recipe for building Vim
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
9 # PREFIX=dir Overrules the install directory.
10 # Can be specified when installing only.
11 # Example: aap install PREFIX=$HOME
13 @if os.name != "posix":
14 :error Sorry, this recipe only works for Unix-like systems.
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())
19 @ or not os.path.exists("auto/config.aap")):
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
30 @if not program_path("autoconf"):
31 :print Can't find autoconf, using existing configure script.
33 # Move configure aside, autoconf would overwrite it
34 :move {exist} configure configure.save
36 :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure
37 :chmod 755 auto/configure
38 :move configure.save configure
39 :del {force} auto/config.cache auto/config.status
41 # Change the configure script to produce config.aap instead of config.mk.
42 auto/configure.aap : auto/configure
43 :print Adjusting auto/configure for A-A-P.
44 :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin)
46 :chmod 755 auto/configure.aap
48 # The configure script uses the directory where it's located, use a link.
49 configure.aap: {buildcheck=}
50 :symlink {f} auto/configure.aap configure.aap
52 # Dependency: run configure.aap to update config.h and config.aap in the
54 # NOTE: we can only build for one architecture, because -MM doesn't work
55 # when building for both.
56 config {virtual} auto/config.h auto/config.aap :
57 auto/configure.aap configure.aap
58 config.arg config.h.in config.aap.in
59 # 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:
65 :print Building for $arch system
66 config_args = `file2string("config.arg")`
67 :sys CONFIG_STATUS=auto/config.status
68 ./configure.aap $config_args
70 --cache-file=auto/config.cache
72 # Configure arguments: create an empty "config.arg" file when its missing
74 :touch {exist} config.arg
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":
80 @if "reconfig" in var2list(_no.TARGETARG):
81 :del {force} auto/config.cache auto/config.status
82 :update {force} auto/config.aap
84 :update auto/config.aap
86 # Include the recipe that autoconf generated.
87 :include auto/config.aap
89 # Unfortunately "-M" doesn't work when building for two architectures. Switch
91 @if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
92 CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
94 # A "PREFIX=dir" argument overrules the value of $prefix
95 # But don't use the default "/usr/local".
96 @if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local':
99 # Don't want "~/" in prefix.
100 prefix = `os.path.expanduser(prefix)`
103 APPDIR = $(VIMNAME).app
105 ### Names of the programs and targets
106 VIMTARGET = $VIMNAME$EXESUF
107 EXTARGET = $EXNAME$LNKSUF
108 VIEWTARGET = $VIEWNAME$LNKSUF
110 GVIMTARGET = $GVIMNAME$LNKSUF
111 GVIEWNAME = g$VIEWNAME
112 GVIEWTARGET = $GVIEWNAME$LNKSUF
114 RVIMTARGET = $RVIMNAME$LNKSUF
115 RVIEWNAME = r$VIEWNAME
116 RVIEWTARGET = $RVIEWNAME$LNKSUF
117 RGVIMNAME = r$GVIMNAME
118 RGVIMTARGET = $RGVIMNAME$LNKSUF
119 RGVIEWNAME = r$GVIEWNAME
120 RGVIEWTARGET = $RGVIEWNAME$LNKSUF
121 VIMDIFFNAME = $(VIMNAME)diff
122 GVIMDIFFNAME = g$VIMDIFFNAME
123 VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
124 GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
126 EVIMTARGET = $EVIMNAME$LNKSUF
127 EVIEWNAME = e$VIEWNAME
128 EVIEWTARGET = $EVIEWNAME$LNKSUF
133 # The GUI is selected by configure, a lot of other things depend on it.
137 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
140 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
141 GUI_IPATH = $GUI_INC_LOC
142 GUI_LIBS_DIR = $GUI_LIB_LOC
144 GUI_LIBS2 = $GTK_LIBNAME
145 GUI_INSTALL = install_normal
146 GUI_TARGETS = installglinks
147 GUI_MAN_TARGETS = yes
152 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
153 gui_xmdlg.c gui_xmebw.c
155 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
156 GUI_IPATH = $GUI_INC_LOC
157 GUI_LIBS_DIR = $GUI_LIB_LOC
159 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
160 GUI_INSTALL = install_normal
161 GUI_TARGETS = installglinks
162 GUI_MAN_TARGETS = yes
167 # XAW_LIB et al. can be overruled to use Xaw3d widgets
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
172 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
173 GUI_IPATH = $GUI_INC_LOC
174 GUI_LIBS_DIR = $GUI_LIB_LOC
177 GUI_INSTALL = install_normal
178 GUI_TARGETS = installglinks
179 GUI_MAN_TARGETS = yes
184 # XAW_LIB et al. can be overruled to use Xaw3d widgets
186 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
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
194 GUI_INSTALL = install_normal
195 GUI_TARGETS = installglinks
196 GUI_MAN_TARGETS = yes
201 GUI_SRC = gui.c gui_mac.c pty.c
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
209 GUI_INSTALL = install_macosx
210 GUI_TARGETS = installglinks
211 GUI_MAN_TARGETS = yes
213 GUI_BUNDLE = gui_bundle
214 GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
216 GUI_SRC = gui.c gui_photon.c pty.c
218 GUI_DEFS = -DFEAT_GUI_PHOTON
221 GUI_LIBS1 = -lph -lphexlib
223 GUI_INSTALL = install_normal
224 GUI_TARGETS = installglinks
225 GUI_MAN_TARGETS = yes
237 GUI_INSTALL = install_normal
245 PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
246 POST_DEFS = $X_CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
247 CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
250 ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
251 LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
252 LIBS = $GUI_LIBS1 $GUI_X_LIBS $GUI_LIBS2 $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $CONF_LIBS $?(EXTRA_LIBS) $LUA_LIBS $MZSCHEME_LIBS $PERL_LIBS $PYTHON_LIBS $TCL_LIBS $RUBY_LIBS $?(PROFILE_LIBS)
256 # reconfig target also builds Vim (reconfiguration is handled above).
257 reconfig {virtual}: $Target
260 :del {force} auto/config.h auto/config.aap
261 :del {force} auto/config.cache auto/config.status
264 # Execute the test scripts. Run these after compiling Vim, before installing.
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.
270 # If everything is alright, the final message will be "ALL DONE".
274 :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG
277 :del {force} testdir/*.out testdir/test.log
279 # 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"):
285 :execute ../main.aap fetch
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).
353 # TODO: make is still used for subdirectories, need to write a recipe.
356 all: $Target $GUI_BUNDLE
358 # This dependency is required to build auto/osdef.h before automatic
359 # dependencies are generated.
360 $Source version.c : auto/osdef.h
362 # Need to mention that the target also depends on version.c, since it's not
363 # included in $Source
366 # Some sources are to be found in the "auto" directory.
369 # When building Vim always compile version.c to get the timestamp.
372 :attr {filetype = my_prog} $Target
374 :program $Target : $Source $Objects
376 :action build my_prog object
377 version_obj = `src2obj("version.c")`
378 :do compile {target = $version_obj} version.c
379 #:do build {target = $target {filetype = program}} $source $version_obj
380 link_sed = $BDIR/link.sed
381 @if os.path.exists(link_sed):
382 :move {force} $link_sed auto/link.sed
384 :del {force} auto/link.sed
386 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
387 -o $target $source $version_obj $LIBS" \
388 MAKE="aap" sh ./link2.sh
389 :copy {force} auto/link.sed $BDIR/link.sed
391 # "link.sh" must be modified for A-A-P
393 :print Adjusting $-source for A-A-P.
394 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
397 xxd/xxd$EXESUF: xxd/xxd.c
398 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
401 # Build the language specific files if they were unpacked.
402 # Generate the converted .mo files separately, it's no problem if this fails.
405 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
407 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
409 :print Generated converted language files failed, continuing
411 # Update the *.po files for changes in the sources. Only run manually.
413 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
415 auto/if_perl.c: if_perl.xs
416 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
417 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
418 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
420 auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
421 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
423 pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
425 auto/pathdef.c: auto/config.aap
426 :print Creating $target
427 :print >! $target /* pathdef.c */
428 :print >> $target /* This file is automatically created by main.aap */
429 :print >> $target /* DO NOT EDIT! Change main.aap only. */
430 :print >> $target $#include "vim.h"
431 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
432 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
433 v = $CC -c -I$srcdir $CFLAGS
434 @v = string.replace(v, '"', '\\"')
435 :print >> $target char_u *all_cflags = (char_u *)"$v";
436 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
437 link_sed = $BDIR/link.sed
438 @if os.path.exists(link_sed):
439 # filter $linkcmd through $BDIR/link.sed
440 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
441 @linkcmd = string.replace(linkcmd, '"', '\\"')
442 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
443 @if _no.get("COMPILEDBY"):
447 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
449 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
450 @who = string.replace(who, '"', '\\"')
451 @where = string.replace(where, '"', '\\"')
452 :print >> $target char_u *compiled_user = (char_u *)"$who";
453 :print >> $target char_u *compiled_sys = (char_u *)"$where";
456 ### Names of the tools that are also made
457 TOOLS = xxd/xxd$EXESUF
459 # Root of the installation tree. Empty for a normal install, set to an
460 # existing path to install into a special place (for generating a package).
463 ### Location of man pages under $MANTOPDIR
466 ### Location of Vim files (should not need to be changed, and
467 ### some things might not work when they are changed!)
469 @r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
470 VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
475 AUTOSUBDIR = /autoload
477 FTPLUGSUBDIR = /ftplugin
479 COMPSUBDIR = /compiler
481 MACROSUBDIR = /macros
488 ### VIMLOC common root of the Vim files (all versions)
489 ### VIMRTLOC common root of the runtime Vim files (this version)
490 ### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
491 ### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
492 ### HELPSUBLOC location for help files
493 ### COLSUBLOC location for colorscheme files
494 ### SYNSUBLOC location for syntax files
495 ### INDSUBLOC location for indent files
496 ### AUTOSUBLOC location for standard autoload files
497 ### PLUGSUBLOC location for standard plugin files
498 ### FTPLUGSUBLOC location for ftplugin files
499 ### LANGSUBLOC location for language files
500 ### COMPSUBLOC location for compiler files
501 ### KMAPSUBLOC location for keymap files
502 ### MACROSUBLOC location for macro files
503 ### TOOLSSUBLOC location for tools files
504 ### TUTORSUBLOC location for tutor files
505 ### PRINTSUBLOC location for print files
506 ### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
507 ### You can override these if you want to install them somewhere else.
508 ### Edit feature.h for compile-time settings.
509 VIMLOC = $DATADIR$VIMDIR
510 @if not _no.get("VIMRTLOC"):
511 VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
513 HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
514 COLSUBLOC = $VIMRTLOC$COLSUBDIR
515 SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
516 INDSUBLOC = $VIMRTLOC$INDSUBDIR
517 AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
518 PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
519 FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
520 LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
521 COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
522 KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
523 MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
524 TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
525 TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
526 SPELLSUBLOC = $VIMRTLOC$SPELLSUBDIR
527 PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
528 SCRIPTLOC = $VIMRTLOC
530 ### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
531 ### the runtime directory is not below it.
532 #VIMRUNTIMEDIR = $VIMRTLOC
534 ### Name of the evim file target.
535 EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
536 MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
538 ### Name of the menu file target.
539 SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
540 SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
541 SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
543 ### Name of the bugreport file target.
544 SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
546 ### Name of the file type detection file target.
547 SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
549 ### Name of the file type detection file target.
550 SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
552 ### Name of the file type detection script file target.
553 SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
555 ### Name of the ftplugin-on file target.
556 SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
558 ### Name of the ftplugin-off file target.
559 SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
561 ### Name of the indent-on file target.
562 SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
564 ### Name of the indent-off file target.
565 SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
567 ### Name of the option window script file target.
568 SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
570 ### Permissions for binaries
573 ### Permissions for man page
576 ### Permissions for help files
579 ### Permissions for Perl and shell scripts
582 ### Permission for Vim script files (menu.vim, bugreport.vim, ..)
585 ### Permissions for all directories that are created
588 ### Permissions for all other files that are created
591 # Where to copy the man and help files from
592 HELPSOURCE = ../runtime/doc
594 # Where to copy the script files from (menu, bugreport)
595 SCRIPTSOURCE = ../runtime
597 # Where to copy the colorscheme files from
598 COLSOURCE = ../runtime/colors
600 # Where to copy the syntax files from
601 SYNSOURCE = ../runtime/syntax
603 # Where to copy the indent files from
604 INDSOURCE = ../runtime/indent
606 # Where to copy the standard plugin files from
607 AUTOSOURCE = ../runtime/autoload
609 # Where to copy the standard plugin files from
610 PLUGSOURCE = ../runtime/plugin
612 # Where to copy the ftplugin files from
613 FTPLUGSOURCE = ../runtime/ftplugin
615 # Where to copy the macro files from
616 MACROSOURCE = ../runtime/macros
618 # Where to copy the tools files from
619 TOOLSSOURCE = ../runtime/tools
621 # Where to copy the tutor files from
622 TUTORSOURCE = ../runtime/tutor
624 # Where to copy the spell files from
625 SPELLSOURCE = ../runtime/spell
627 # Where to look for language specific files
628 LANGSOURCE = ../runtime/lang
630 # Where to look for compiler files
631 COMPSOURCE = ../runtime/compiler
633 # Where to look for keymap files
634 KMAPSOURCE = ../runtime/keymap
636 # Where to look for print resource files
637 PRINTSOURCE = ../runtime/print
640 DEST_BIN = $DESTDIR$BINDIR
641 DEST_VIM = $DESTDIR$VIMLOC
642 DEST_RT = $DESTDIR$VIMRTLOC
643 DEST_HELP = $DESTDIR$HELPSUBLOC
644 DEST_COL = $DESTDIR$COLSUBLOC
645 DEST_SYN = $DESTDIR$SYNSUBLOC
646 DEST_IND = $DESTDIR$INDSUBLOC
647 DEST_AUTO = $DESTDIR$AUTOSUBLOC
648 DEST_PLUG = $DESTDIR$PLUGSUBLOC
649 DEST_FTP = $DESTDIR$FTPLUGSUBLOC
650 DEST_LANG = $DESTDIR$LANGSUBLOC
651 DEST_COMP = $DESTDIR$COMPSUBLOC
652 DEST_KMAP = $DESTDIR$KMAPSUBLOC
653 DEST_MACRO = $DESTDIR$MACROSUBLOC
654 DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
655 DEST_TUTOR = $DESTDIR$TUTORSUBLOC
656 DEST_SPELL = $DESTDIR$SPELLSUBLOC
657 DEST_SCRIPT = $DESTDIR$SCRIPTLOC
658 DEST_PRINT = $DESTDIR$PRINTSUBLOC
659 DEST_MAN_TOP = $DESTDIR$?(MANDIR)
661 # We assume that the ".../man/xx/man1/" directory is for latin1 manual pages.
662 # Some systems use UTF-8, but these should find the ".../man/xx.UTF-8/man1/"
664 # FreeBSD uses ".../man/xx.ISO8859-1/man1" for latin1, use that one too.
665 DEST_MAN = $(DEST_MAN_TOP)$(MAN1DIR)
666 DEST_MAN_FR = $(DEST_MAN_TOP)/fr$(MAN1DIR)
667 DEST_MAN_FR_I = $(DEST_MAN_TOP)/fr.ISO8859-1$(MAN1DIR)
668 DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR)
669 DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR)
670 DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR)
671 DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR)
672 DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR)
673 DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
674 DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
675 DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
677 # These are directories, create them when needed.
678 :attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
679 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG
681 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
682 $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL
683 $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT
684 $DEST_MAN_IT_I $DEST_MAN_IT_U
685 $DEST_MAN_PL $DEST_MAN_PL_U
686 $DEST_MAN_RU $DEST_MAN_RU_U
691 install: $GUI_INSTALL
694 @if not os.path.isdir(_no.DEST_BIN):
699 @if os.access(_no.DEST_BIN, os.W_OK):
700 # Bin directory is writable, install directly.
701 :update installvim installtools $INSTALL_LANGS install-icons
703 # Bin directory is not writable, need to become root.
704 :print The destination directory "$DEST_BIN" is not writable.
705 :print If this is the wrong directory, use PREFIX to specify another one.
706 :print Otherwise, type the root password to continue installing.
709 installvim {virtual}: installvimbin installtutorbin \
710 installruntime installlinks installmanlinks
712 installvimbin {virtual}{force}: $Target $DEST_BIN
713 exe = $DEST_BIN/$VIMTARGET
714 @if os.path.exists(exe):
715 # Move the old executable aside and delete it. Any other method
716 # may cause a crash if the executable is currently being used.
717 :move {force} $exe $(exe).rm
718 :del {force} $(exe).rm
719 :copy $VIMTARGET $DEST_BIN
721 :chmod $BINMOD $DEST_BIN/$VIMTARGET
722 # may create a link to the new executable from /usr/bin/vi
723 @if _no.get("LINKIT"):
726 # Long list of arguments for the shell script that installs the manual pages
728 INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \
729 $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME)
731 # Install most of the runtime files
732 installruntime {virtual}: installrtbase installmacros installtutor installspell
734 # install the help files; first adjust the contents for the location
735 installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM
736 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
737 $DEST_FTP $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG $DEST_TUTOR
738 $DEST_COMP $DEST_SPELL $DEST_PRINT
739 :chmod 755 installman.sh
740 :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
744 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
746 XTRA = # It's OK if there are no matches.
747 :copy *.txt tags $XTRA $DEST_HELP
750 :chmod $HELPMOD *.txt tags $XTRA
752 :copy $HELPSOURCE/*.pl $DEST_HELP
753 :chmod $SCRIPTMOD $DEST_HELP/*.pl
754 # install the menu files
755 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
756 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
757 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
758 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
759 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
760 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
761 # install the evim file
762 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
763 :chmod $VIMSCRIPTMOD $MSWIN_FILE
764 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
765 :chmod $VIMSCRIPTMOD $EVIM_FILE
766 # install the bugreport file
767 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
768 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
769 # install the example vimrc files
770 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
771 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
772 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
773 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
774 # install the file type detection files
775 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
776 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
777 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
778 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
779 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
780 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
781 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
782 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
783 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
784 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
785 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
786 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
787 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
788 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
789 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
790 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
791 # install the print resource files
792 :copy $PRINTSOURCE/*.ps $DEST_PRINT
793 :chmod $FILEMOD $DEST_PRINT/*.ps
794 # install the colorscheme files
795 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
796 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
797 # install the syntax files
798 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
799 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
800 # install the indent files
801 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
802 :chmod $HELPMOD $DEST_IND/*.vim
803 # install the standard autoload files
804 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
805 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
806 :copy $AUTOSOURCE/xml/*.vim $DEST_AUTO/xml
807 :chmod $HELPMOD $DEST_AUTO/xml/*.vim
808 # install the standard plugin files
809 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
810 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
811 # install the ftplugin files
812 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
813 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
814 # install the compiler files
815 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
816 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
818 installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
819 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
820 # Delete any CVS and AAPDIR directories.
821 # Use the ":tree" command if possible. It was added later, fall back
822 # to using "find" when it doesn't work.
824 :tree $DEST_MACRO {dirname = CVS}
825 :del {recursive} $name
826 :tree $DEST_MACRO {dirname = AAPDIR}
827 :del {recursive} $name
828 :tree $DEST_MACRO {dirname = .*}
830 :tree $DEST_MACRO {filename = .*}
831 :chmod $FILEMOD $name
833 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
835 :del {recursive} $cvsdirs
836 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
837 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
838 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
840 # install the tutor files
841 installtutorbin {virtual}{force}: $DEST_VIM
842 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
843 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
845 installtutor {virtual}{force}: $DEST_RT $DEST_TUTOR
846 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
847 :chmod $HELPMOD $DEST_TUTOR/*
849 # Install the spell files, if they exist. This assumes at least the English
850 # spell file is there.
851 installspell {virtual}: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL)
852 enspl = $(SPELLSOURCE)/en.latin1.spl
853 @if os.path.exists(enspl):
854 :copy $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.vim $(DEST_SPELL)
855 :chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.vim
857 :copy $(SPELLSOURCE)/*.sug $(DEST_SPELL)
858 :chmod $(HELPMOD) $(DEST_SPELL)/*.sug
862 # install helper program xxd
863 installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
864 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS \
866 xxd = $DEST_BIN/xxd$EXESUF
867 @if os.path.exists(xxd):
868 :move {force} $xxd $(xxd).rm
870 :copy xxd/xxd$EXESUF $DEST_BIN
871 :do strip $DEST_BIN/xxd$EXESUF
872 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
873 :chmod 755 installman.sh
874 :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS)
876 # install the runtime tools
878 @ if aap_has(":tree"):
879 # New method: copy everything and delete CVS and AAPDIR dirs
880 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
881 :tree $DEST_TOOLS {dirname = CVS}
882 :delete {recursive} $name
883 :tree $DEST_TOOLS {dirname = AAPDIR}
884 :delete {recursive} $name
886 # Old method: copy only specific files and directories.
887 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
888 :chmod $FILEMOD $DEST_TOOLS/*
889 # replace the path in some tools
890 :progsearch perlpath perl
892 :cat $TOOLSSOURCE/efm_perl.pl |
893 :eval re.sub("/usr/bin/perl", perlpath, stdin)
894 >! $DEST_TOOLS/efm_perl.pl
896 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
898 :progsearch awkpath nawk gawk awk
900 :cat $TOOLSSOURCE/mve.awk |
901 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
902 >! $DEST_TOOLS/mve.awk
904 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
906 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
908 # install the language specific files for tools, if they were unpacked
909 install-tool-languages:
910 :chmod 755 installman.sh
911 :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
912 :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
913 :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
914 :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
915 :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
916 :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
917 :sys ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
918 :sys ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
919 :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
920 :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
922 # install the language specific files, if they were unpacked
923 install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
924 :chmod 755 installman.sh
925 :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
926 :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
927 :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
928 :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
929 :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
930 :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
931 :sys ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
932 :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
933 :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
934 :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
935 :chmod 755 installml.sh
936 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
937 $(DEST_MAN_FR) $(INSTALLMLARGS)
938 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
939 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
940 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
941 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
942 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
943 $(DEST_MAN_IT) $(INSTALLMLARGS)
944 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
945 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
946 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
947 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
948 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
949 $(DEST_MAN_PL) $(INSTALLMLARGS)
950 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
951 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
952 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
953 $(DEST_MAN_RU) $(INSTALLMLARGS)
954 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
955 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
958 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
959 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
960 @if os.path.exists(_no.LANGSOURCE):
961 :print installing language files
962 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
963 :chmod $FILEMOD $DEST_LANG/*.vim
964 @if os.path.exists(_no.KMAPSOURCE):
965 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
966 :chmod $FILEMOD $DEST_KMAP/*.vim
968 # install the icons for KDE, if the directory exists and the icon doesn't.
969 ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
970 ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
971 ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
972 KDEPATH = $HOME/.kde/share/icons
973 install-icons {virtual}:
974 gp = $ICON48PATH/gvim.png
975 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
976 :copy $SCRIPTSOURCE/vim48x48.png $gp
977 gp = $ICON32PATH/gvim.png
978 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
979 :copy $SCRIPTSOURCE/vim32x32.png $gp
980 gp = $ICON16PATH/gvim.png
981 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
982 :copy $SCRIPTSOURCE/vim16x16.png $gp
985 $HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
986 @if not os.path.exists(_no.TOOLSSOURCE):
987 :print Runtime files not found.
988 :error You need to unpack the runtime archive before running "make install".
990 # create links from various names to vim. This is only done when the links
991 # (or executables with the same name) don't exist yet.
992 installlinks {virtual}: $GUI_TARGETS \
993 $DEST_BIN/$EXTARGET \
994 $DEST_BIN/$VIEWTARGET \
995 $DEST_BIN/$RVIMTARGET \
996 $DEST_BIN/$RVIEWTARGET \
999 installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
1000 $DEST_BIN/$GVIEWTARGET \
1001 $DEST_BIN/$RGVIMTARGET \
1002 $DEST_BIN/$RGVIEWTARGET \
1003 $DEST_BIN/$EVIMTARGET \
1004 $DEST_BIN/$EVIEWTARGET \
1007 installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
1008 installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
1010 # These dependencies use an empty buildcheck so that they are only done when
1011 # the target doesn't exist.
1012 $DEST_BIN/$EXTARGET: {buildcheck = }
1013 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
1015 $DEST_BIN/$VIEWTARGET: {buildcheck = }
1016 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
1018 $DEST_BIN/$GVIMTARGET: {buildcheck = }
1019 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
1021 $DEST_BIN/$GVIEWTARGET: {buildcheck = }
1022 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
1024 $DEST_BIN/$RVIMTARGET: {buildcheck = }
1025 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
1027 $DEST_BIN/$RVIEWTARGET: {buildcheck = }
1028 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
1030 $DEST_BIN/$RGVIMTARGET: {buildcheck = }
1031 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
1033 $DEST_BIN/$RGVIEWTARGET: {buildcheck = }
1034 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
1036 $DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
1037 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
1039 $DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
1040 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
1042 $DEST_BIN/$EVIMTARGET: {buildcheck = }
1043 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
1045 $DEST_BIN/$EVIEWTARGET: {buildcheck = }
1046 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
1048 # create links for the manual pages with various names to vim. This is only
1049 # done when the links (or manpages with the same name) don't exist yet.
1050 INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \
1051 $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \
1052 $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \
1053 $(GVIMDIFFNAME) $(EVIEWNAME)
1055 installmanlinks {virtual}:
1056 :chmod 755 installml.sh
1057 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
1058 $(DEST_MAN) $(INSTALLMLARGS)
1063 uninstall {virtual}{force}: uninstall_runtime
1064 :del {force} $DEST_BIN/$VIMTARGET
1065 :del {force} $DEST_BIN/vimtutor
1066 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
1067 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
1068 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
1069 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
1070 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
1071 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
1072 :del {force} $DEST_BIN/xxd$EXESUF
1074 # Note: "deldir" will fail if any files were added after "make install", that
1075 # is intentionally: Keep files the user added.
1076 uninstall_runtime {virtual}{force}:
1077 :chmod 755 installman.sh
1078 :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS)
1079 :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS)
1080 :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS)
1081 :sys ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS)
1082 :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS)
1083 :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS)
1084 :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS)
1085 :sys ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS)
1086 :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
1087 :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
1088 :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
1089 :chmod 755 installml.sh
1090 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1091 $(DEST_MAN) $(INSTALLMLARGS)
1092 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1093 $(DEST_MAN_FR) $(INSTALLMLARGS)
1094 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1095 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
1096 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1097 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
1098 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1099 $(DEST_MAN_IT) $(INSTALLMLARGS)
1100 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1101 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
1102 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1103 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
1104 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1105 $(DEST_MAN_PL) $(INSTALLMLARGS)
1106 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1107 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
1108 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1109 $(DEST_MAN_RU) $(INSTALLMLARGS)
1110 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1111 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
1112 :del {force} $DEST_MAN/xxd.1
1113 :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1
1114 :del {force} $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1
1115 :del {force} $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1
1116 :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1
1118 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
1119 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
1120 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
1121 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1122 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1123 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1124 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1125 :del {force} $SYS_OPTWIN_FILE
1126 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1127 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1128 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1129 :del {force} $DEST_PRINT/*.ps
1130 :del {force}{recursive} $DEST_MACRO
1131 :del {force}{recursive} $DEST_TUTOR
1132 :del {force}{recursive} $DEST_SPELL
1133 :del {force}{recursive} $DEST_TOOLS
1134 :del {force}{recursive} $DEST_LANG
1135 :del {force}{recursive} $DEST_KMAP
1136 :del {force}{recursive} $DEST_COMP
1137 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1138 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
1139 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt $DEST_AUTO/xml/*.vim
1140 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
1141 :deldir {force} $DEST_FTP $DEST_AUTO/xml $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
1142 # This will fail when other Vim versions are installed, no worries.
1146 :print Cannot delete $DEST_VIM
1148 ###############################################################################
1149 ### MacOS X installation
1151 ### This installs a runnable Vim.app in $(prefix)
1153 REZ = /Developer/Tools/Rez
1154 RESDIR = $(APPDIR)/Contents/Resources
1155 @r = re.compile('.*VIM_VERSION_SHORT\\s*"(\\d[^"]*)".*', re.S)
1156 VERSION = /`r.match(open("version.h").read()).group(1)`
1159 M4FLAGSX = $?(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
1160 -DAPP_VER=$(VERSION)
1162 # Resources used for the Mac are in one directory.
1163 RSRC_DIR = os_mac_rsrc
1165 :attr {directory = $DIRMOD} $RESDIR
1167 install_macosx {virtual}: gui_bundle
1168 # Remove the link to the runtime dir, don't want to copy all of that.
1169 :delete {force} $(RESDIR)/vim/runtime
1170 :copy {r} $APPDIR $DESTDIR$prefix
1171 :tree $DESTDIR$prefix {dirname = AAPDIR}
1172 :delete {recursive} $name
1173 # Install the runtime files. Recursive!
1174 :mkdir {r}{f} $DESTDIR$prefix/$RESDIR/vim/runtime
1175 # :mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
1176 :execute main.aap PREFIX=$DESTDIR$prefix/$RESDIR/vim VIMRTLOC=$DESTDIR$prefix/$RESDIR/vim/runtime installruntime
1177 # Put the link back.
1178 :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
1179 # TODO: Create the vimtutor application.
1181 gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \
1182 bundle-resource bundle-language
1184 bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
1185 # Make a link to the runtime directory, so that we can try out the executable
1186 # without installing it.
1187 :mkdir {r}{f} $(RESDIR)/vim
1188 :symlink {quiet} `os.getcwd()`/../runtime $(RESDIR)/vim/runtime
1190 bundle-executable {virtual}: $(VIMTARGET)
1191 :mkdir {r}{f} $(APPDIR)/Contents/MacOS
1192 :copy $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
1194 bundle-info {virtual}: bundle-dir
1195 :print Creating PkgInfo
1196 :print "APPLVIM!" >! $(APPDIR)/Contents/PkgInfo
1197 :print Creating Info.plist
1198 :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
1200 bundle-resource {virtual}: bundle-dir bundle-rsrc
1201 :copy {force} $(RSRC_DIR)/*.icns $(RESDIR)
1203 ### Classic resources
1204 # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
1205 # This file is also required for OS X Vim.
1206 bundle-rsrc {virtual}: os_mac.rsr.hqx
1207 :print Creating resource fork
1208 :sys python dehqx.py $source
1209 :del {force} gui_mac.rsrc
1210 :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc
1212 # po/Make_osx.pl says something about generating a Mac message file
1213 # for Ukrananian. Would somebody using Mac OS X in Ukranian
1214 # *really* be upset that Carbon Vim was not localised in
1217 #bundle-language: bundle-dir po/Make_osx.pl
1218 # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG)
1219 bundle-language {virtual}: bundle-dir
1222 :mkdir {r} $(APPDIR)/Contents/MacOS
1223 :mkdir {r} $(RESDIR)/English.lproj