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 :sys CONFIG_STATUS=auto/config.status
60 ./configure.aap `file2string("config.arg")`
62 --cache-file=auto/config.cache
64 # Configure arguments: create an empty "config.arg" file when its missing
66 :touch {exist} config.arg
68 # "auto/config.aap" contains a lot of settings, such as the name of the
69 # executable "Target".
70 # First update it, forcefully if the "reconfig" target was used.
71 @if _no.TARGETARG != "comment" and _no.TARGETARG != "make":
72 @if "reconfig" in var2list(_no.TARGETARG):
73 :del {force} auto/config.cache auto/config.status
74 :update {force} auto/config.aap
76 :update auto/config.aap
78 # Include the recipe that autoconf generated.
79 :include auto/config.aap
81 # Unfortunately "-M" doesn't work when building for two architectures. Switch
83 @if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
84 CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
86 # A "PREFIX=dir" argument overrules the value of $prefix
87 # But don't use the default "/usr/local".
88 @if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local':
91 # Don't want "~/" in prefix.
92 prefix = `os.path.expanduser(prefix)`
95 APPDIR = $(VIMNAME).app
97 ### Names of the programs and targets
98 VIMTARGET = $VIMNAME$EXESUF
99 EXTARGET = $EXNAME$LNKSUF
100 VIEWTARGET = $VIEWNAME$LNKSUF
102 GVIMTARGET = $GVIMNAME$LNKSUF
103 GVIEWNAME = g$VIEWNAME
104 GVIEWTARGET = $GVIEWNAME$LNKSUF
106 RVIMTARGET = $RVIMNAME$LNKSUF
107 RVIEWNAME = r$VIEWNAME
108 RVIEWTARGET = $RVIEWNAME$LNKSUF
109 RGVIMNAME = r$GVIMNAME
110 RGVIMTARGET = $RGVIMNAME$LNKSUF
111 RGVIEWNAME = r$GVIEWNAME
112 RGVIEWTARGET = $RGVIEWNAME$LNKSUF
113 VIMDIFFNAME = $(VIMNAME)diff
114 GVIMDIFFNAME = g$VIMDIFFNAME
115 VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
116 GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
118 EVIMTARGET = $EVIMNAME$LNKSUF
119 EVIEWNAME = e$VIEWNAME
120 EVIEWTARGET = $EVIEWNAME$LNKSUF
125 # The GUI is selected by configure, a lot of other things depend on it.
129 GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
132 GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
133 GUI_IPATH = $GUI_INC_LOC
134 GUI_LIBS_DIR = $GUI_LIB_LOC
136 GUI_LIBS2 = $GTK_LIBNAME
137 GUI_INSTALL = install_normal
138 GUI_TARGETS = installglinks
139 GUI_MAN_TARGETS = yes
144 GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
145 gui_xmdlg.c gui_xmebw.c
147 GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
148 GUI_IPATH = $GUI_INC_LOC
149 GUI_LIBS_DIR = $GUI_LIB_LOC
151 GUI_LIBS2 = $MOTIF_LIBNAME -lXt
152 GUI_INSTALL = install_normal
153 GUI_TARGETS = installglinks
154 GUI_MAN_TARGETS = yes
159 # XAW_LIB et al. can be overruled to use Xaw3d widgets
161 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
162 gui_at_sb.c gui_at_fs.c
164 GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
165 GUI_IPATH = $GUI_INC_LOC
166 GUI_LIBS_DIR = $GUI_LIB_LOC
169 GUI_INSTALL = install_normal
170 GUI_TARGETS = installglinks
171 GUI_MAN_TARGETS = yes
176 # XAW_LIB et al. can be overruled to use Xaw3d widgets
178 GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
181 GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
182 GUI_IPATH = $GUI_INC_LOC
183 GUI_LIBS_DIR = $GUI_LIB_LOC
184 GUI_LIBS1 = $NEXTAW_LIB
186 GUI_INSTALL = install_normal
187 GUI_TARGETS = installglinks
188 GUI_MAN_TARGETS = yes
193 GUI_SRC = gui.c gui_mac.c pty.c
195 GUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \
196 -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe
197 GUI_IPATH = $GUI_INC_LOC
198 GUI_LIBS_DIR = $GUI_LIB_LOC
199 GUI_LIBS1 = -framework Carbon
201 GUI_INSTALL = install_macosx
202 GUI_TARGETS = installglinks
203 GUI_MAN_TARGETS = yes
205 GUI_BUNDLE = gui_bundle
206 GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
208 GUI_SRC = gui.c gui_photon.c pty.c
210 GUI_DEFS = -DFEAT_GUI_PHOTON
213 GUI_LIBS1 = -lph -lphexlib
215 GUI_INSTALL = install_normal
216 GUI_TARGETS = installglinks
217 GUI_MAN_TARGETS = yes
229 GUI_INSTALL = install_normal
237 PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
238 POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
239 CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
242 ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
243 LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
244 LIBS = $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)
248 # reconfig target also builds Vim (reconfiguration is handled above).
249 reconfig {virtual}: $Target
252 :del {force} auto/config.h auto/config.aap
253 :del {force} auto/config.cache auto/config.status
256 # Execute the test scripts. Run these after compiling Vim, before installing.
258 # This will produce a lot of garbage on your screen, including a few error
259 # messages. Don't worry about that.
260 # If there is a real error, there will be a difference between "test.out" and
261 # a "test99.ok" file.
262 # If everything is allright, the final message will be "ALL DONE".
266 :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG
269 :del {force} testdir/*.out testdir/test.log
271 # When no fetch target exists we are not a child of the ../main.aap recipe,
272 # Use ../main.aap to do the fetching.
273 # --- If you get an error here for wrong number of arguments, you need to
274 # update to a newer version of A-A-P.
275 @if not has_target("fetch"):
277 :execute ../main.aap fetch
280 # All the source files that need to be compiled.
281 # Some are optional and depend on configure.
282 # "version.c" is missing, it's always compiled (see below).
344 # TODO: make is still used for subdirectories, need to write a recipe.
347 all: $Target $GUI_BUNDLE
349 # This dependency is required to build auto/osdef.h before automatic
350 # dependencies are generated.
351 $Source version.c : auto/osdef.h
353 # Need to mention that the target also depends on version.c, since it's not
357 # Some sources are to be found in the "auto" directory.
360 # When building Vim always compile version.c to get the timestamp.
363 :attr {filetype = my_prog} $Target
365 :program $Target : $Source $Objects
367 :action build my_prog object
368 version_obj = `src2obj("version.c")`
369 :do compile {target = $version_obj} version.c
370 #:do build {target = $target {filetype = program}} $source $version_obj
371 link_sed = $BDIR/link.sed
372 @if os.path.exists(link_sed):
373 :move {force} $link_sed auto/link.sed
375 :del {force} auto/link.sed
377 :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
378 -o $target $source $version_obj $LIBS" \
379 MAKE="aap" sh ./link2.sh
380 :copy {force} auto/link.sed $BDIR/link.sed
382 # "link.sh" must be modified for A-A-P
384 :print Adjusting $-source for A-A-P.
385 :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
388 xxd/xxd$EXESUF: xxd/xxd.c
389 :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
392 # Build the language specific files if they were unpacked.
393 # Generate the converted .mo files separately, it's no problem if this fails.
396 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
398 :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
400 :print Generated converted language files failed, continuing
402 # Update the *.po files for changes in the sources. Only run manually.
404 cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
406 auto/if_perl.c: if_perl.xs
407 :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
408 :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
409 $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
411 auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
412 :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
414 pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
416 auto/pathdef.c: auto/config.aap
417 :print Creating $target
418 :print >! $target /* pathdef.c */
419 :print >> $target /* This file is automatically created by main.aap */
420 :print >> $target /* DO NOT EDIT! Change main.aap only. */
421 :print >> $target $#include "vim.h"
422 :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
423 :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
424 v = $CC -c -I$srcdir $CFLAGS
425 @v = string.replace(v, '"', '\\"')
426 :print >> $target char_u *all_cflags = (char_u *)"$v";
427 linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
428 link_sed = $BDIR/link.sed
429 @if os.path.exists(link_sed):
430 # filter $linkcmd through $BDIR/link.sed
431 :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
432 @linkcmd = string.replace(linkcmd, '"', '\\"')
433 :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
434 @if _no.get("COMPILEDBY"):
438 :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
440 :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
441 :print >> $target char_u *compiled_user = (char_u *)"$who";
442 :print >> $target char_u *compiled_sys = (char_u *)"$where";
445 ### Names of the tools that are also made
446 TOOLS = xxd/xxd$EXESUF
448 # Root of the installation tree. Empty for a normal install, set to an
449 # existing path to install into a special place (for generating a package).
452 ### Location of man pages under $MANTOPDIR
455 ### Location of Vim files (should not need to be changed, and
456 ### some things might not work when they are changed!)
458 @r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
459 VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
464 AUTOSUBDIR = /autoload
466 FTPLUGSUBDIR = /ftplugin
468 COMPSUBDIR = /compiler
470 MACROSUBDIR = /macros
477 ### VIMLOC common root of the Vim files (all versions)
478 ### VIMRTLOC common root of the runtime Vim files (this version)
479 ### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
480 ### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
481 ### HELPSUBLOC location for help files
482 ### COLSUBLOC location for colorscheme files
483 ### SYNSUBLOC location for syntax files
484 ### INDSUBLOC location for indent files
485 ### AUTOSUBLOC location for standard autoload files
486 ### PLUGSUBLOC location for standard plugin files
487 ### FTPLUGSUBLOC location for ftplugin files
488 ### LANGSUBLOC location for language files
489 ### COMPSUBLOC location for compiler files
490 ### KMAPSUBLOC location for keymap files
491 ### MACROSUBLOC location for macro files
492 ### TOOLSSUBLOC location for tools files
493 ### TUTORSUBLOC location for tutor files
494 ### PRINTSUBLOC location for print files
495 ### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
496 ### You can override these if you want to install them somewhere else.
497 ### Edit feature.h for compile-time settings.
498 VIMLOC = $DATADIR$VIMDIR
499 @if not _no.get("VIMRTLOC"):
500 VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
502 HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
503 COLSUBLOC = $VIMRTLOC$COLSUBDIR
504 SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
505 INDSUBLOC = $VIMRTLOC$INDSUBDIR
506 AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR
507 PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
508 FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
509 LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
510 COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
511 KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
512 MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
513 TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
514 TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
515 SPELLSUBLOC = $VIMRTLOC$SPELLSUBDIR
516 PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
517 SCRIPTLOC = $VIMRTLOC
519 ### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
520 ### the runtime directory is not below it.
521 #VIMRUNTIMEDIR = $VIMRTLOC
523 ### Name of the evim file target.
524 EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
525 MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
527 ### Name of the menu file target.
528 SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
529 SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
530 SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
532 ### Name of the bugreport file target.
533 SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
535 ### Name of the file type detection file target.
536 SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
538 ### Name of the file type detection file target.
539 SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
541 ### Name of the file type detection script file target.
542 SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
544 ### Name of the ftplugin-on file target.
545 SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
547 ### Name of the ftplugin-off file target.
548 SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
550 ### Name of the indent-on file target.
551 SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
553 ### Name of the indent-off file target.
554 SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
556 ### Name of the option window script file target.
557 SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
559 ### Permissions for binaries
562 ### Permissions for man page
565 ### Permissions for help files
568 ### Permissions for Perl and shell scripts
571 ### Permission for Vim script files (menu.vim, bugreport.vim, ..)
574 ### Permissions for all directories that are created
577 ### Permissions for all other files that are created
580 # Where to copy the man and help files from
581 HELPSOURCE = ../runtime/doc
583 # Where to copy the script files from (menu, bugreport)
584 SCRIPTSOURCE = ../runtime
586 # Where to copy the colorscheme files from
587 COLSOURCE = ../runtime/colors
589 # Where to copy the syntax files from
590 SYNSOURCE = ../runtime/syntax
592 # Where to copy the indent files from
593 INDSOURCE = ../runtime/indent
595 # Where to copy the standard plugin files from
596 AUTOSOURCE = ../runtime/autoload
598 # Where to copy the standard plugin files from
599 PLUGSOURCE = ../runtime/plugin
601 # Where to copy the ftplugin files from
602 FTPLUGSOURCE = ../runtime/ftplugin
604 # Where to copy the macro files from
605 MACROSOURCE = ../runtime/macros
607 # Where to copy the tools files from
608 TOOLSSOURCE = ../runtime/tools
610 # Where to copy the tutor files from
611 TUTORSOURCE = ../runtime/tutor
613 # Where to copy the spell files from
614 SPELLSOURCE = ../runtime/spell
616 # Where to look for language specific files
617 LANGSOURCE = ../runtime/lang
619 # Where to look for compiler files
620 COMPSOURCE = ../runtime/compiler
622 # Where to look for keymap files
623 KMAPSOURCE = ../runtime/keymap
625 # Where to look for print resource files
626 PRINTSOURCE = ../runtime/print
629 DEST_BIN = $DESTDIR$BINDIR
630 DEST_VIM = $DESTDIR$VIMLOC
631 DEST_RT = $DESTDIR$VIMRTLOC
632 DEST_HELP = $DESTDIR$HELPSUBLOC
633 DEST_COL = $DESTDIR$COLSUBLOC
634 DEST_SYN = $DESTDIR$SYNSUBLOC
635 DEST_IND = $DESTDIR$INDSUBLOC
636 DEST_AUTO = $DESTDIR$AUTOSUBLOC
637 DEST_PLUG = $DESTDIR$PLUGSUBLOC
638 DEST_FTP = $DESTDIR$FTPLUGSUBLOC
639 DEST_LANG = $DESTDIR$LANGSUBLOC
640 DEST_COMP = $DESTDIR$COMPSUBLOC
641 DEST_KMAP = $DESTDIR$KMAPSUBLOC
642 DEST_MACRO = $DESTDIR$MACROSUBLOC
643 DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
644 DEST_TUTOR = $DESTDIR$TUTORSUBLOC
645 DEST_SPELL = $DESTDIR$SPELLSUBLOC
646 DEST_SCRIPT = $DESTDIR$SCRIPTLOC
647 DEST_PRINT = $DESTDIR$PRINTSUBLOC
648 DEST_MAN_TOP = $DESTDIR$?(MANDIR)
650 # We assume that the ".../man/xx/man1/" directory is for latin1 manual pages.
651 # Some systems use UTF-8, but these should find the ".../man/xx.UTF-8/man1/"
653 # FreeBSD uses ".../man/xx.ISO8859-1/man1" for latin1, use that one too.
654 DEST_MAN = $(DEST_MAN_TOP)$(MAN1DIR)
655 DEST_MAN_FR = $(DEST_MAN_TOP)/fr$(MAN1DIR)
656 DEST_MAN_FR_I = $(DEST_MAN_TOP)/fr.ISO8859-1$(MAN1DIR)
657 DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR)
658 DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR)
659 DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR)
660 DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR)
661 DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR)
662 DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
663 DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
664 DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
666 # These are directories, create them when needed.
667 :attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
668 $DEST_SYN $DEST_IND $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG
670 $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
671 $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL
672 $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT
673 $DEST_MAN_IT_I $DEST_MAN_IT_U
674 $DEST_MAN_PL $DEST_MAN_PL_U
675 $DEST_MAN_RU $DEST_MAN_RU_U
680 install: $GUI_INSTALL
683 @if not os.path.isdir(_no.DEST_BIN):
688 @if os.access(_no.DEST_BIN, os.W_OK):
689 # Bin directory is writable, install directly.
690 :update installvim installtools $INSTALL_LANGS install-icons
692 # Bin directory is not writable, need to become root.
693 :print The destination directory "$DEST_BIN" is not writable.
694 :print If this is the wrong directory, use PREFIX to specify another one.
695 :print Otherwise, type the root password to continue installing.
698 installvim {virtual}: installvimbin installtutorbin \
699 installruntime installlinks installmanlinks
701 installvimbin {virtual}{force}: $Target $DEST_BIN
702 exe = $DEST_BIN/$VIMTARGET
703 @if os.path.exists(exe):
704 # Move the old executable aside and delete it. Any other method
705 # may cause a crash if the executable is currently being used.
706 :move {force} $exe $(exe).rm
707 :del {force} $(exe).rm
708 :copy $VIMTARGET $DEST_BIN
710 :chmod $BINMOD $DEST_BIN/$VIMTARGET
711 # may create a link to the new executable from /usr/bin/vi
712 @if _no.get("LINKIT"):
715 # Long list of arguments for the shell script that installs the manual pages
717 INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \
718 $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME)
720 # Install most of the runtime files
721 installruntime {virtual}: installrtbase installmacros installtutor installspell
723 # install the help files; first adjust the contents for the location
724 installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM
725 $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
726 $DEST_FTP $DEST_AUTO $DEST_AUTO/xml $DEST_PLUG $DEST_TUTOR
727 $DEST_COMP $DEST_SPELL $DEST_PRINT
728 :chmod 755 installman.sh
729 :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
733 XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
735 XTRA = # It's OK if there are no matches.
736 :copy *.txt tags $XTRA $DEST_HELP
739 :chmod $HELPMOD *.txt tags $XTRA
741 :copy $HELPSOURCE/*.pl $DEST_HELP
742 :chmod $SCRIPTMOD $DEST_HELP/*.pl
743 # install the menu files
744 :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
745 :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
746 :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
747 :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
748 :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
749 :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
750 # install the evim file
751 :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
752 :chmod $VIMSCRIPTMOD $MSWIN_FILE
753 :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
754 :chmod $VIMSCRIPTMOD $EVIM_FILE
755 # install the bugreport file
756 :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
757 :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
758 # install the example vimrc files
759 :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
760 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
761 :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
762 :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
763 # install the file type detection files
764 :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
765 :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
766 :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
767 :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
768 :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
769 :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
770 :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
771 :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
772 :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
773 :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
774 :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
775 :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
776 :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
777 :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
778 :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
779 :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
780 # install the print resource files
781 :copy $PRINTSOURCE/*.ps $DEST_PRINT
782 :chmod $FILEMOD $DEST_PRINT/*.ps
783 # install the colorscheme files
784 :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
785 :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
786 # install the syntax files
787 :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
788 :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
789 # install the indent files
790 :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
791 :chmod $HELPMOD $DEST_IND/*.vim
792 # install the standard autoload files
793 :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO
794 :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt
795 :copy $AUTOSOURCE/xml/*.vim $DEST_AUTO/xml
796 :chmod $HELPMOD $DEST_AUTO/xml/*.vim
797 # install the standard plugin files
798 :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
799 :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
800 # install the ftplugin files
801 :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
802 :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
803 # install the compiler files
804 :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
805 :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
807 installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
808 :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
809 # Delete any CVS and AAPDIR directories.
810 # Use the ":tree" command if possible. It was added later, fall back
811 # to using "find" when it doesn't work.
813 :tree $DEST_MACRO {dirname = CVS}
814 :del {recursive} $name
815 :tree $DEST_MACRO {dirname = AAPDIR}
816 :del {recursive} $name
817 :tree $DEST_MACRO {dirname = .*}
819 :tree $DEST_MACRO {filename = .*}
820 :chmod $FILEMOD $name
822 @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
824 :del {recursive} $cvsdirs
825 :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
826 :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
827 :chmod $SCRIPTMOD $DEST_MACRO/less.sh
829 # install the tutor files
830 installtutorbin {virtual}{force}: $DEST_VIM
831 :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
832 :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
834 installtutor {virtual}{force}: $DEST_RT $DEST_TUTOR
835 :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
836 :chmod $HELPMOD $DEST_TUTOR/*
838 # Install the spell files, if they exist. This assumes at least the English
839 # spell file is there.
840 installspell {virtual}: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL)
841 enspl = $(SPELLSOURCE)/en.latin1.spl
842 @if os.path.exists(enspl):
843 :copy $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.vim $(DEST_SPELL)
844 :chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.vim
846 :copy $(SPELLSOURCE)/*.sug $(DEST_SPELL)
847 :chmod $(HELPMOD) $(DEST_SPELL)/*.sug
851 # install helper program xxd
852 installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
853 $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS \
855 xxd = $DEST_BIN/xxd$EXESUF
856 @if os.path.exists(xxd):
857 :move {force} $xxd $(xxd).rm
859 :copy xxd/xxd$EXESUF $DEST_BIN
860 :do strip $DEST_BIN/xxd$EXESUF
861 :chmod $BINMOD $DEST_BIN/xxd$EXESUF
862 :chmod 755 installman.sh
863 :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS)
865 # install the runtime tools
867 @ if aap_has(":tree"):
868 # New method: copy everything and delete CVS and AAPDIR dirs
869 :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
870 :tree $DEST_TOOLS {dirname = CVS}
871 :delete {recursive} $name
872 :tree $DEST_TOOLS {dirname = AAPDIR}
873 :delete {recursive} $name
875 # Old method: copy only specific files and directories.
876 :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
877 :chmod $FILEMOD $DEST_TOOLS/*
878 # replace the path in some tools
879 :progsearch perlpath perl
881 :cat $TOOLSSOURCE/efm_perl.pl |
882 :eval re.sub("/usr/bin/perl", perlpath, stdin)
883 >! $DEST_TOOLS/efm_perl.pl
885 :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
887 :progsearch awkpath nawk gawk awk
889 :cat $TOOLSSOURCE/mve.awk |
890 :eval re.sub("/usr/bin/nawk", awkpath, stdin)
891 >! $DEST_TOOLS/mve.awk
893 :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
895 :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
897 # install the language specific files for tools, if they were unpacked
898 install-tool-languages:
899 :chmod 755 installman.sh
900 :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
901 :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
902 :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
903 :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
904 :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
905 :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
906 :sys ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
907 :sys ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
908 :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
909 :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
911 # install the language specific files, if they were unpacked
912 install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
913 :chmod 755 installman.sh
914 :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
915 :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
916 :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
917 :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS)
918 :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
919 :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
920 :sys ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
921 :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
922 :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
923 :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
924 :chmod 755 installml.sh
925 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
926 $(DEST_MAN_FR) $(INSTALLMLARGS)
927 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
928 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
929 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
930 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
931 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
932 $(DEST_MAN_IT) $(INSTALLMLARGS)
933 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
934 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
935 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
936 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
937 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
938 $(DEST_MAN_PL) $(INSTALLMLARGS)
939 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
940 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
941 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
942 $(DEST_MAN_RU) $(INSTALLMLARGS)
943 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
944 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
947 :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
948 LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
949 @if os.path.exists(_no.LANGSOURCE):
950 :print installing language files
951 :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
952 :chmod $FILEMOD $DEST_LANG/*.vim
953 @if os.path.exists(_no.KMAPSOURCE):
954 :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
955 :chmod $FILEMOD $DEST_KMAP/*.vim
957 # install the icons for KDE, if the directory exists and the icon doesn't.
958 ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
959 ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
960 ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
961 KDEPATH = $HOME/.kde/share/icons
962 install-icons {virtual}:
963 gp = $ICON48PATH/gvim.png
964 @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
965 :copy $SCRIPTSOURCE/vim48x48.png $gp
966 gp = $ICON32PATH/gvim.png
967 @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
968 :copy $SCRIPTSOURCE/vim32x32.png $gp
969 gp = $ICON16PATH/gvim.png
970 @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
971 :copy $SCRIPTSOURCE/vim16x16.png $gp
974 $HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
975 @if not os.path.exists(_no.TOOLSSOURCE):
976 :print Runtime files not found.
977 :error You need to unpack the runtime archive before running "make install".
979 # create links from various names to vim. This is only done when the links
980 # (or executables with the same name) don't exist yet.
981 installlinks {virtual}: $GUI_TARGETS \
982 $DEST_BIN/$EXTARGET \
983 $DEST_BIN/$VIEWTARGET \
984 $DEST_BIN/$RVIMTARGET \
985 $DEST_BIN/$RVIEWTARGET \
988 installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
989 $DEST_BIN/$GVIEWTARGET \
990 $DEST_BIN/$RGVIMTARGET \
991 $DEST_BIN/$RGVIEWTARGET \
992 $DEST_BIN/$EVIMTARGET \
993 $DEST_BIN/$EVIEWTARGET \
996 installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
997 installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
999 # These dependencies use an empty buildcheck so that they are only done when
1000 # the target doesn't exist.
1001 $DEST_BIN/$EXTARGET: {buildcheck = }
1002 :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
1004 $DEST_BIN/$VIEWTARGET: {buildcheck = }
1005 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
1007 $DEST_BIN/$GVIMTARGET: {buildcheck = }
1008 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
1010 $DEST_BIN/$GVIEWTARGET: {buildcheck = }
1011 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
1013 $DEST_BIN/$RVIMTARGET: {buildcheck = }
1014 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
1016 $DEST_BIN/$RVIEWTARGET: {buildcheck = }
1017 :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
1019 $DEST_BIN/$RGVIMTARGET: {buildcheck = }
1020 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
1022 $DEST_BIN/$RGVIEWTARGET: {buildcheck = }
1023 :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
1025 $DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
1026 :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
1028 $DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
1029 :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
1031 $DEST_BIN/$EVIMTARGET: {buildcheck = }
1032 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
1034 $DEST_BIN/$EVIEWTARGET: {buildcheck = }
1035 :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
1037 # create links for the manual pages with various names to vim. This is only
1038 # done when the links (or manpages with the same name) don't exist yet.
1039 INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \
1040 $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \
1041 $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \
1042 $(GVIMDIFFNAME) $(EVIEWNAME)
1044 installmanlinks {virtual}:
1045 :chmod 755 installml.sh
1046 :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
1047 $(DEST_MAN) $(INSTALLMLARGS)
1052 uninstall {virtual}{force}: uninstall_runtime
1053 :del {force} $DEST_BIN/$VIMTARGET
1054 :del {force} $DEST_BIN/vimtutor
1055 :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
1056 :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
1057 :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
1058 :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
1059 :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
1060 :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
1061 :del {force} $DEST_BIN/xxd$EXESUF
1063 # Note: "deldir" will fail if any files were added after "make install", that
1064 # is intentionally: Keep files the user added.
1065 uninstall_runtime {virtual}{force}:
1066 :chmod 755 installman.sh
1067 :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS)
1068 :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS)
1069 :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS)
1070 :sys ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS)
1071 :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS)
1072 :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS)
1073 :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS)
1074 :sys ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS)
1075 :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
1076 :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
1077 :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
1078 :chmod 755 installml.sh
1079 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1080 $(DEST_MAN) $(INSTALLMLARGS)
1081 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1082 $(DEST_MAN_FR) $(INSTALLMLARGS)
1083 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1084 $(DEST_MAN_FR_I) $(INSTALLMLARGS)
1085 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1086 $(DEST_MAN_FR_U) $(INSTALLMLARGS)
1087 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1088 $(DEST_MAN_IT) $(INSTALLMLARGS)
1089 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1090 $(DEST_MAN_IT_I) $(INSTALLMLARGS)
1091 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1092 $(DEST_MAN_IT_U) $(INSTALLMLARGS)
1093 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1094 $(DEST_MAN_PL) $(INSTALLMLARGS)
1095 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1096 $(DEST_MAN_PL_U) $(INSTALLMLARGS)
1097 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1098 $(DEST_MAN_RU) $(INSTALLMLARGS)
1099 :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
1100 $(DEST_MAN_RU_U) $(INSTALLMLARGS)
1101 :del {force} $DEST_MAN/xxd.1
1102 :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1
1103 :del {force} $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1
1104 :del {force} $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1
1105 :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1
1107 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
1108 :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
1109 :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
1110 :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
1111 :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
1112 :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
1113 :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
1114 :del {force} $SYS_OPTWIN_FILE
1115 :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
1116 :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
1117 :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
1118 :del {force} $DEST_PRINT/*.ps
1119 :del {force}{recursive} $DEST_MACRO
1120 :del {force}{recursive} $DEST_TUTOR
1121 :del {force}{recursive} $DEST_SPELL
1122 :del {force}{recursive} $DEST_TOOLS
1123 :del {force}{recursive} $DEST_LANG
1124 :del {force}{recursive} $DEST_KMAP
1125 :del {force}{recursive} $DEST_COMP
1126 :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
1127 :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
1128 :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt $DEST_AUTO/xml/*.vim
1129 :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
1130 :deldir {force} $DEST_FTP $DEST_AUTO/xml $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT
1131 # This will fail when other Vim versions are installed, no worries.
1135 :print Cannot delete $DEST_VIM
1137 ###############################################################################
1138 ### MacOS X installation
1140 ### This installs a runnable Vim.app in $(prefix)
1142 REZ = /Developer/Tools/Rez
1143 RESDIR = $(APPDIR)/Contents/Resources
1144 @r = re.compile('.*VIM_VERSION_SHORT\\s*"(\\d[^"]*)".*', re.S)
1145 VERSION = /`r.match(open("version.h").read()).group(1)`
1146 ICON_APP = gui_mac.icns
1149 M4FLAGSX = $?(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
1150 -DAPP_VER=$(VERSION) -DICON_APP=$(ICON_APP)
1153 ICONS = $(RESDIR)/$(ICON_APP)
1155 :attr {directory = $DIRMOD} $RESDIR
1157 # If you uncomment the following lines the *.icns in the src directory will be
1158 # detected by this Makefile automatically, and used for Vim.
1159 #ICON_APP = $(shell if [ -e app.icns ] ; then echo app.icns ; else echo gui_mac.icns ; fi)
1160 #ICON_DOC = $(shell if [ -e doc.icns ] ; then echo doc.icns ; else echo ; fi)
1161 #ICON_DOCTXT = $(shell if [ -e doc-txt.icns ] ; then echo doc-txt.icns ; else echo ; fi)
1162 #ICONS = $(addprefix $(RESDIR)/, $(ICON_APP) $(ICON_DOC) $(ICON_DOCTXT))
1164 install_macosx {virtual}: gui_bundle
1165 # Remove the link to the runtime dir, don't want to copy all of that.
1166 :delete {force} $(RESDIR)/vim/runtime
1167 :copy {r} $APPDIR $DESTDIR$prefix
1168 :tree $DESTDIR$prefix {dirname = AAPDIR}
1169 :delete {recursive} $name
1170 # Install the runtime files. Recursive!
1171 :mkdir {r}{f} $DESTDIR$prefix/$RESDIR/vim/runtime
1172 # :mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
1173 :execute main.aap PREFIX=$DESTDIR$prefix/$RESDIR/vim VIMRTLOC=$DESTDIR$prefix/$RESDIR/vim/runtime installruntime
1174 # Put the link back.
1175 :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
1176 # TODO: Create the vimtutor application.
1178 gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \
1179 bundle-resource bundle-language
1181 bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
1182 # Make a link to the runtime directory, so that we can try out the executable
1183 # without installing it.
1184 :mkdir {r}{f} $(RESDIR)/vim
1185 :symlink {quiet} `os.getcwd()`/../runtime $(RESDIR)/vim/runtime
1187 bundle-executable {virtual}: $(VIMTARGET)
1188 :mkdir {r}{f} $(APPDIR)/Contents/MacOS
1189 :copy $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
1191 bundle-info {virtual}: bundle-dir
1192 :print Creating PkgInfo
1193 :print "APPLVIM!" >! $(APPDIR)/Contents/PkgInfo
1194 :print Creating Info.plist
1195 :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
1197 bundle-resource {virtual}: bundle-dir bundle-icons bundle-rsrc
1199 bundle-icons {virtual}: $ICONS
1201 ### Classic resources
1202 # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
1203 # This file is also required for OS X Vim.
1204 bundle-rsrc {virtual}: os_mac.rsr.hqx
1205 :print Creating resource fork
1206 :sys python dehqx.py $source
1207 :del {force} gui_mac.rsrc
1208 :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc
1210 # po/Make_osx.pl says something about generating a Mac message file
1211 # for Ukrananian. Would somebody using Mac OS X in Ukranian
1212 # *really* be upset that Carbon Vim was not localised in
1215 #bundle-language: bundle-dir po/Make_osx.pl
1216 # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG)
1217 bundle-language {virtual}: bundle-dir
1220 :mkdir {r} $(APPDIR)/Contents/MacOS
1221 :mkdir {r} $(RESDIR)/English.lproj
1224 :copy $source $target