Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | # 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 Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 9 | # PREFIX=dir Overrules the install directory. |
| 10 | # Can be specified when installing only. |
| 11 | # Example: aap install PREFIX=$HOME |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 12 | # |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 13 | @if os.name != "posix": |
| 14 | :error Sorry, this recipe only works for Unix-like systems. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 15 | |
| 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 Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 19 | @ or not os.path.exists("auto/config.aap")): |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 20 | |
| 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 Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 30 | @if not program_path("autoconf"): |
| 31 | :print Can't find autoconf, using existing configure script. |
| 32 | @else: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 33 | # Move configure aside, autoconf would overwrite it |
| 34 | :move {exist} configure configure.save |
| 35 | :sys autoconf |
Bram Moolenaar | 06b5db9 | 2006-02-10 23:11:56 +0000 | [diff] [blame] | 36 | :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 37 | :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 Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 43 | :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 Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 47 | |
| 48 | # The configure script uses the directory where it's located, use a link. |
| 49 | configure.aap: {buildcheck=} |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 50 | :symlink {f} auto/configure.aap configure.aap |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 51 | |
| 52 | # Dependency: run configure.aap to update config.h and config.aap in the |
| 53 | # "auto" directory. |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 54 | # NOTE: we can only build for one architecture, because -MM doesn't work |
| 55 | # when building for both. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 56 | config {virtual} auto/config.h auto/config.aap : |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 57 | auto/configure.aap configure.aap |
| 58 | config.arg config.h.in config.aap.in |
| 59 | :sys CONFIG_STATUS=auto/config.status |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 60 | ./configure.aap `file2string("config.arg")` |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 61 | --with-mac-arch=ppc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 62 | --cache-file=auto/config.cache |
| 63 | |
| 64 | # Configure arguments: create an empty "config.arg" file when its missing |
| 65 | config.arg: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 66 | :touch {exist} config.arg |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 67 | |
| 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": |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 72 | @if "reconfig" in var2list(_no.TARGETARG): |
| 73 | :del {force} auto/config.cache auto/config.status |
| 74 | :update {force} auto/config.aap |
| 75 | @else: |
| 76 | :update auto/config.aap |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 77 | |
| 78 | # Include the recipe that autoconf generated. |
| 79 | :include auto/config.aap |
| 80 | |
Bram Moolenaar | a226a6d | 2006-02-26 23:59:20 +0000 | [diff] [blame] | 81 | # Unfortunately "-M" doesn't work when building for two architectures. Switch |
| 82 | # back to PPC only. |
| 83 | @if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0: |
| 84 | CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")` |
| 85 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 86 | # A "PREFIX=dir" argument overrules the value of $prefix |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 87 | # But don't use the default "/usr/local". |
| 88 | @if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local': |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 89 | prefix = $PREFIX |
| 90 | |
| 91 | # Don't want "~/" in prefix. |
| 92 | prefix = `os.path.expanduser(prefix)` |
| 93 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 94 | # For Mac. |
| 95 | APPDIR = $(VIMNAME).app |
| 96 | |
| 97 | ### Names of the programs and targets |
| 98 | VIMTARGET = $VIMNAME$EXESUF |
| 99 | EXTARGET = $EXNAME$LNKSUF |
| 100 | VIEWTARGET = $VIEWNAME$LNKSUF |
| 101 | GVIMNAME = g$VIMNAME |
| 102 | GVIMTARGET = $GVIMNAME$LNKSUF |
| 103 | GVIEWNAME = g$VIEWNAME |
| 104 | GVIEWTARGET = $GVIEWNAME$LNKSUF |
| 105 | RVIMNAME = r$VIMNAME |
| 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 |
| 117 | EVIMNAME = e$VIMNAME |
| 118 | EVIMTARGET = $EVIMNAME$LNKSUF |
| 119 | EVIEWNAME = e$VIEWNAME |
| 120 | EVIEWTARGET = $EVIEWNAME$LNKSUF |
| 121 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 122 | # |
| 123 | # G U I variant |
| 124 | # |
| 125 | # The GUI is selected by configure, a lot of other things depend on it. |
| 126 | # |
| 127 | :variant GUI |
| 128 | GTK |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 129 | GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c |
| 130 | gui_gtk_f.c |
| 131 | GUI_OBJ = |
| 132 | GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO |
| 133 | GUI_IPATH = $GUI_INC_LOC |
| 134 | GUI_LIBS_DIR = $GUI_LIB_LOC |
| 135 | GUI_LIBS1 = |
| 136 | GUI_LIBS2 = $GTK_LIBNAME |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 137 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 138 | GUI_TARGETS = installglinks |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 139 | GUI_MAN_TARGETS = yes |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 140 | GUI_TESTTARGET = gui |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 141 | GUI_BUNDLE = |
| 142 | GUI_TESTARG = |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 143 | MOTIF |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 144 | GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c |
| 145 | gui_xmdlg.c gui_xmebw.c |
| 146 | GUI_OBJ = |
| 147 | GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO |
| 148 | GUI_IPATH = $GUI_INC_LOC |
| 149 | GUI_LIBS_DIR = $GUI_LIB_LOC |
| 150 | GUI_LIBS1 = |
| 151 | GUI_LIBS2 = $MOTIF_LIBNAME -lXt |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 152 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 153 | GUI_TARGETS = installglinks |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 154 | GUI_MAN_TARGETS = yes |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 155 | GUI_TESTTARGET = gui |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 156 | GUI_BUNDLE = |
| 157 | GUI_TESTARG = |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 158 | ATHENA |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 159 | # XAW_LIB et al. can be overruled to use Xaw3d widgets |
| 160 | XAW_LIB ?= -lXaw |
| 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 |
| 163 | GUI_OBJ = |
| 164 | GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO |
| 165 | GUI_IPATH = $GUI_INC_LOC |
| 166 | GUI_LIBS_DIR = $GUI_LIB_LOC |
| 167 | GUI_LIBS1 = $XAW_LIB |
| 168 | GUI_LIBS2 = -lXt |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 169 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 170 | GUI_TARGETS = installglinks |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 171 | GUI_MAN_TARGETS = yes |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 172 | GUI_TESTTARGET = gui |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 173 | GUI_BUNDLE = |
| 174 | GUI_TESTARG = |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 175 | NEXTAW |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 176 | # XAW_LIB et al. can be overruled to use Xaw3d widgets |
| 177 | XAW_LIB ?= -lXaw |
| 178 | GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c |
| 179 | gui_at_fs.c |
| 180 | GUI_OBJ = |
| 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 |
| 185 | GUI_LIBS2 = -lXt |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 186 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 187 | GUI_TARGETS = installglinks |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 188 | GUI_MAN_TARGETS = yes |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 189 | GUI_TESTTARGET = gui |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 190 | GUI_BUNDLE = |
| 191 | GUI_TESTARG = |
| 192 | CARBONGUI |
| 193 | GUI_SRC = gui.c gui_mac.c pty.c |
| 194 | GUI_OBJ = |
| 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 |
| 200 | GUI_LIBS2 = |
| 201 | GUI_INSTALL = install_macosx |
| 202 | GUI_TARGETS = installglinks |
| 203 | GUI_MAN_TARGETS = yes |
| 204 | GUI_TESTTARGET = gui |
| 205 | GUI_BUNDLE = gui_bundle |
| 206 | GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 207 | PHOTONGUI |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 208 | GUI_SRC = gui.c gui_photon.c pty.c |
| 209 | GUI_OBJ = |
| 210 | GUI_DEFS = -DFEAT_GUI_PHOTON |
| 211 | GUI_IPATH = |
| 212 | GUI_LIBS_DIR = |
| 213 | GUI_LIBS1 = -lph -lphexlib |
| 214 | GUI_LIBS2 = |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 215 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 216 | GUI_TARGETS = installglinks |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 217 | GUI_MAN_TARGETS = yes |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 218 | GUI_TESTTARGET = gui |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 219 | GUI_BUNDLE = |
| 220 | GUI_TESTARG = |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 221 | * |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 222 | GUI_SRC = |
| 223 | GUI_OBJ = |
| 224 | GUI_DEFS = |
| 225 | GUI_IPATH = |
| 226 | GUI_LIBS_DIR = |
| 227 | GUI_LIBS1 = |
| 228 | GUI_LIBS2 = |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 229 | GUI_INSTALL = install_normal |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 230 | GUI_TARGETS = |
| 231 | GUI_MAN_TARGETS = |
| 232 | GUI_TESTTARGET = |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 233 | GUI_BUNDLE = |
| 234 | GUI_TESTARG = |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 235 | |
| 236 | |
| 237 | PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS) |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 238 | POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 239 | CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS |
| 240 | CPPFLAGS = |
| 241 | |
| 242 | ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR |
| 243 | LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 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) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 245 | |
| 246 | Target = $VIMNAME |
| 247 | |
| 248 | # reconfig target also builds Vim (reconfiguration is handled above). |
| 249 | reconfig {virtual}: $Target |
| 250 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 251 | distclean: clean |
| 252 | :del {force} auto/config.h auto/config.aap |
| 253 | :del {force} auto/config.cache auto/config.status |
| 254 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 255 | |
| 256 | # Execute the test scripts. Run these after compiling Vim, before installing. |
| 257 | # |
| 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". |
| 263 | # |
| 264 | test check: |
| 265 | VimProg = ../$Target |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 266 | :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 267 | |
| 268 | testclean {virtual}: |
| 269 | :del {force} testdir/*.out testdir/test.log |
| 270 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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"): |
| 276 | fetch: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 277 | :execute ../main.aap fetch |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 278 | |
| 279 | |
| 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). |
| 283 | Source = |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 284 | buffer.c |
| 285 | charset.c |
| 286 | diff.c |
| 287 | digraph.c |
| 288 | edit.c |
| 289 | eval.c |
| 290 | ex_cmds.c |
| 291 | ex_cmds2.c |
| 292 | ex_docmd.c |
| 293 | ex_eval.c |
| 294 | ex_getln.c |
| 295 | fileio.c |
| 296 | fold.c |
| 297 | getchar.c |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 298 | hardcopy.c |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 299 | hashtable.c |
| 300 | if_cscope.c |
| 301 | if_xcmdsrv.c |
| 302 | main.c |
| 303 | mark.c |
| 304 | memfile.c |
| 305 | memline.c |
| 306 | menu.c |
| 307 | message.c |
| 308 | misc1.c |
| 309 | misc2.c |
| 310 | move.c |
| 311 | mbyte.c |
| 312 | normal.c |
| 313 | ops.c |
| 314 | option.c |
| 315 | os_unix.c |
| 316 | auto/pathdef.c |
Bram Moolenaar | bb15b65 | 2005-10-03 21:52:09 +0000 | [diff] [blame] | 317 | popupmenu.c |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 318 | quickfix.c |
| 319 | regexp.c |
| 320 | screen.c |
| 321 | search.c |
| 322 | spell.c |
| 323 | syntax.c |
| 324 | tag.c |
| 325 | term.c |
| 326 | ui.c |
| 327 | undo.c |
| 328 | window.c |
| 329 | $OS_EXTRA_SRC |
| 330 | $GUI_SRC |
| 331 | $HANGULIN_SRC |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 332 | $MZSCHEME_SRC |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 333 | $PERL_SRC |
| 334 | $NETBEANS_SRC |
| 335 | $PYTHON_SRC |
| 336 | $TCL_SRC |
| 337 | $RUBY_SRC |
| 338 | $SNIFF_SRC |
| 339 | $WORKSHOP_SRC |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 340 | |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 341 | Objects = |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 342 | $GUI_OBJ |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 343 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 344 | # TODO: make is still used for subdirectories, need to write a recipe. |
| 345 | MAKE ?= make |
| 346 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 347 | all: $Target $GUI_BUNDLE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 348 | |
| 349 | # This dependency is required to build auto/osdef.h before automatic |
| 350 | # dependencies are generated. |
| 351 | $Source version.c : auto/osdef.h |
| 352 | |
| 353 | # Need to mention that the target also depends on version.c, since it's not |
| 354 | # inluded in $Source |
| 355 | $Target : version.c |
| 356 | |
| 357 | # Some sources are to be found in the "auto" directory. |
| 358 | SRCPATH += auto |
| 359 | |
| 360 | # When building Vim always compile version.c to get the timestamp. |
| 361 | :filetype |
| 362 | declare my_prog |
| 363 | :attr {filetype = my_prog} $Target |
| 364 | |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 365 | :program $Target : $Source $Objects |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 366 | |
| 367 | :action build my_prog object |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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 |
| 374 | @else: |
| 375 | :del {force} auto/link.sed |
| 376 | :update link2.sh |
| 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 381 | |
| 382 | # "link.sh" must be modified for A-A-P |
| 383 | link2.sh : link.sh |
| 384 | :print Adjusting $-source for A-A-P. |
| 385 | :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin) |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 386 | >! $target |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 387 | |
| 388 | xxd/xxd$EXESUF: xxd/xxd.c |
| 389 | :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \ |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 390 | $MAKE -f Makefile |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 391 | |
| 392 | # Build the language specific files if they were unpacked. |
| 393 | # Generate the converted .mo files separately, it's no problem if this fails. |
| 394 | languages {virtual}: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 395 | @if _no.MAKEMO: |
| 396 | :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix |
| 397 | @try: |
| 398 | :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted |
| 399 | @except: |
| 400 | :print Generated converted language files failed, continuing |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 401 | |
| 402 | # Update the *.po files for changes in the sources. Only run manually. |
| 403 | update-po {virtual}: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 404 | cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 405 | |
| 406 | auto/if_perl.c: if_perl.xs |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 410 | |
| 411 | auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 412 | :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 413 | |
| 414 | pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF |
| 415 | |
| 416 | auto/pathdef.c: auto/config.aap |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 425 | @v = string.replace(v, '"', '\\"') |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 2df6dcc | 2004-07-12 15:53:54 +0000 | [diff] [blame] | 432 | @linkcmd = string.replace(linkcmd, '"', '\\"') |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 433 | :print >> $target char_u *all_lflags = (char_u *)"$linkcmd"; |
| 434 | @if _no.get("COMPILEDBY"): |
| 435 | who = $COMPILEDBY |
| 436 | where = '' |
| 437 | @else: |
| 438 | :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 439 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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"; |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 443 | |
| 444 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 445 | ### Names of the tools that are also made |
| 446 | TOOLS = xxd/xxd$EXESUF |
| 447 | |
| 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). |
| 450 | DESTDIR ?= |
| 451 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 452 | ### Location of man pages under $MANTOPDIR |
| 453 | MAN1DIR = /man1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 454 | |
| 455 | ### Location of Vim files (should not need to be changed, and |
| 456 | ### some things might not work when they are changed!) |
| 457 | VIMDIR = /vim |
| 458 | @r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S) |
| 459 | VIMRTDIR = /`r.match(open("version.h").read()).group(1)` |
| 460 | HELPSUBDIR = /doc |
| 461 | COLSUBDIR = /colors |
| 462 | SYNSUBDIR = /syntax |
| 463 | INDSUBDIR = /indent |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 464 | AUTOSUBDIR = /autoload |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 465 | PLUGSUBDIR = /plugin |
| 466 | FTPLUGSUBDIR = /ftplugin |
| 467 | LANGSUBDIR = /lang |
| 468 | COMPSUBDIR = /compiler |
| 469 | KMAPSUBDIR = /keymap |
| 470 | MACROSUBDIR = /macros |
| 471 | TOOLSSUBDIR = /tools |
| 472 | TUTORSUBDIR = /tutor |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 473 | SPELLSUBDIR = /spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 474 | PRINTSUBDIR = /print |
| 475 | PODIR = po |
| 476 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 480 | ### VIMRUNTIMEDIR compiled-in location for runtime files (optional) |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 487 | ### FTPLUGSUBLOC location for ftplugin files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 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, ..) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 496 | ### You can override these if you want to install them somewhere else. |
| 497 | ### Edit feature.h for compile-time settings. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 498 | VIMLOC = $DATADIR$VIMDIR |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 499 | @if not _no.get("VIMRTLOC"): |
| 500 | VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 501 | VIMRCLOC = $VIMLOC |
| 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 |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 515 | SPELLSUBLOC = $VIMRTLOC$SPELLSUBDIR |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 516 | PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR |
| 517 | SCRIPTLOC = $VIMRTLOC |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 518 | |
| 519 | ### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and |
| 520 | ### the runtime directory is not below it. |
| 521 | #VIMRUNTIMEDIR = $VIMRTLOC |
| 522 | |
| 523 | ### Name of the evim file target. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 524 | EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim |
| 525 | MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 526 | |
| 527 | ### Name of the menu file target. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 528 | SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 529 | SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim |
| 530 | SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim |
| 531 | |
| 532 | ### Name of the bugreport file target. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 533 | SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 534 | |
| 535 | ### Name of the file type detection file target. |
| 536 | SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim |
| 537 | |
| 538 | ### Name of the file type detection file target. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 539 | SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 540 | |
| 541 | ### Name of the file type detection script file target. |
| 542 | SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim |
| 543 | |
| 544 | ### Name of the ftplugin-on file target. |
| 545 | SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim |
| 546 | |
| 547 | ### Name of the ftplugin-off file target. |
| 548 | SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim |
| 549 | |
| 550 | ### Name of the indent-on file target. |
| 551 | SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim |
| 552 | |
| 553 | ### Name of the indent-off file target. |
| 554 | SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim |
| 555 | |
| 556 | ### Name of the option window script file target. |
| 557 | SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim |
| 558 | |
| 559 | ### Permissions for binaries |
| 560 | BINMOD = 755 |
| 561 | |
| 562 | ### Permissions for man page |
| 563 | MANMOD = 644 |
| 564 | |
| 565 | ### Permissions for help files |
| 566 | HELPMOD = 644 |
| 567 | |
| 568 | ### Permissions for Perl and shell scripts |
| 569 | SCRIPTMOD = 755 |
| 570 | |
| 571 | ### Permission for Vim script files (menu.vim, bugreport.vim, ..) |
| 572 | VIMSCRIPTMOD = 644 |
| 573 | |
| 574 | ### Permissions for all directories that are created |
| 575 | DIRMOD = 755 |
| 576 | |
| 577 | ### Permissions for all other files that are created |
| 578 | FILEMOD = 644 |
| 579 | |
| 580 | # Where to copy the man and help files from |
| 581 | HELPSOURCE = ../runtime/doc |
| 582 | |
| 583 | # Where to copy the script files from (menu, bugreport) |
| 584 | SCRIPTSOURCE = ../runtime |
| 585 | |
| 586 | # Where to copy the colorscheme files from |
| 587 | COLSOURCE = ../runtime/colors |
| 588 | |
| 589 | # Where to copy the syntax files from |
| 590 | SYNSOURCE = ../runtime/syntax |
| 591 | |
| 592 | # Where to copy the indent files from |
| 593 | INDSOURCE = ../runtime/indent |
| 594 | |
| 595 | # Where to copy the standard plugin files from |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 596 | AUTOSOURCE = ../runtime/autoload |
| 597 | |
| 598 | # Where to copy the standard plugin files from |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 599 | PLUGSOURCE = ../runtime/plugin |
| 600 | |
| 601 | # Where to copy the ftplugin files from |
| 602 | FTPLUGSOURCE = ../runtime/ftplugin |
| 603 | |
| 604 | # Where to copy the macro files from |
| 605 | MACROSOURCE = ../runtime/macros |
| 606 | |
| 607 | # Where to copy the tools files from |
| 608 | TOOLSSOURCE = ../runtime/tools |
| 609 | |
| 610 | # Where to copy the tutor files from |
| 611 | TUTORSOURCE = ../runtime/tutor |
| 612 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 613 | # Where to copy the spell files from |
| 614 | SPELLSOURCE = ../runtime/spell |
| 615 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 616 | # Where to look for language specific files |
| 617 | LANGSOURCE = ../runtime/lang |
| 618 | |
| 619 | # Where to look for compiler files |
| 620 | COMPSOURCE = ../runtime/compiler |
| 621 | |
| 622 | # Where to look for keymap files |
| 623 | KMAPSOURCE = ../runtime/keymap |
| 624 | |
| 625 | # Where to look for print resource files |
| 626 | PRINTSOURCE = ../runtime/print |
| 627 | |
| 628 | # abbreviations |
| 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 |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 636 | DEST_AUTO = $DESTDIR$AUTOSUBLOC |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 645 | DEST_SPELL = $DESTDIR$SPELLSUBLOC |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 646 | DEST_SCRIPT = $DESTDIR$SCRIPTLOC |
| 647 | DEST_PRINT = $DESTDIR$PRINTSUBLOC |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 648 | DEST_MAN_TOP = $DESTDIR$?(MANDIR) |
| 649 | |
| 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/" |
| 652 | # directory first. |
| 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_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) |
| 662 | DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 663 | |
| 664 | # These are directories, create them when needed. |
| 665 | :attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 666 | $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG |
| 667 | $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 668 | $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL |
| 669 | $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT |
| 670 | $DEST_MAN_IT_I $DEST_MAN_IT_U $DEST_MAN_RU $DEST_MAN_RU_U |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 671 | |
| 672 | # |
| 673 | # I N S T A L L |
| 674 | # |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 675 | install: $GUI_INSTALL |
| 676 | |
| 677 | install_normal: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 678 | @if not os.path.isdir(_no.DEST_BIN): |
| 679 | @try: |
| 680 | :mkdir $DEST_BIN |
| 681 | @except: |
| 682 | @ pass |
| 683 | @if os.access(_no.DEST_BIN, os.W_OK): |
| 684 | # Bin directory is writable, install directly. |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 685 | :update installvim installtools $INSTALL_LANGS install-icons |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 686 | @else: |
| 687 | # Bin directory is not writable, need to become root. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 688 | :print The destination directory "$DEST_BIN" is not writable. |
| 689 | :print If this is the wrong directory, use PREFIX to specify another one. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 690 | :print Otherwise, type the root password to continue installing. |
| 691 | :asroot $AAP install |
| 692 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 693 | installvim {virtual}: installvimbin installtutorbin \ |
| 694 | installruntime installlinks installmanlinks |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 695 | |
| 696 | installvimbin {virtual}{force}: $Target $DEST_BIN |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 697 | exe = $DEST_BIN/$VIMTARGET |
| 698 | @if os.path.exists(exe): |
| 699 | # Move the old executable aside and delete it. Any other method |
| 700 | # may cause a crash if the executable is currently being used. |
| 701 | :move {force} $exe $(exe).rm |
| 702 | :del {force} $(exe).rm |
| 703 | :copy $VIMTARGET $DEST_BIN |
| 704 | :do strip $exe |
| 705 | :chmod $BINMOD $DEST_BIN/$VIMTARGET |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 706 | # may create a link to the new executable from /usr/bin/vi |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 707 | @if _no.get("LINKIT"): |
| 708 | :sys $LINKIT |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 709 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 710 | # Long list of arguments for the shell script that installs the manual pages |
| 711 | # for one language. |
| 712 | INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \ |
| 713 | $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) |
| 714 | |
| 715 | # Install most of the runtime files |
| 716 | installruntime {virtual}: installrtbase installmacros installtutor installspell |
| 717 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 718 | # install the help files; first adjust the contents for the location |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 719 | installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 720 | $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND |
| 721 | $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 722 | $DEST_SPELL $DEST_PRINT |
| 723 | :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 724 | |
| 725 | :cd $HELPSOURCE |
| 726 | @try: |
| 727 | XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")` |
| 728 | @except: |
| 729 | XTRA = # It's OK if there are no matches. |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 730 | :copy *.txt tags $XTRA $DEST_HELP |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 731 | :cd - |
| 732 | :cd $DEST_HELP |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 733 | :chmod $HELPMOD *.txt tags $XTRA |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 734 | :cd - |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 735 | :copy $HELPSOURCE/*.pl $DEST_HELP |
| 736 | :chmod $SCRIPTMOD $DEST_HELP/*.pl |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 737 | # install the menu files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 738 | :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE |
| 739 | :chmod $VIMSCRIPTMOD $SYS_MENU_FILE |
| 740 | :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE |
| 741 | :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE |
| 742 | :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE |
| 743 | :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 744 | # install the evim file |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 745 | :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE |
| 746 | :chmod $VIMSCRIPTMOD $MSWIN_FILE |
| 747 | :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE |
| 748 | :chmod $VIMSCRIPTMOD $EVIM_FILE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 749 | # install the bugreport file |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 750 | :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE |
| 751 | :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 752 | # install the example vimrc files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 753 | :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT |
| 754 | :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim |
| 755 | :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT |
| 756 | :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 757 | # install the file type detection files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 758 | :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE |
| 759 | :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE |
| 760 | :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE |
| 761 | :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE |
| 762 | :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE |
| 763 | :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE |
| 764 | :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE |
| 765 | :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE |
| 766 | :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE |
| 767 | :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE |
| 768 | :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE |
| 769 | :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE |
| 770 | :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE |
| 771 | :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE |
| 772 | :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE |
| 773 | :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 774 | # install the print resource files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 775 | :copy $PRINTSOURCE/*.ps $DEST_PRINT |
| 776 | :chmod $FILEMOD $DEST_PRINT/*.ps |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 777 | # install the colorscheme files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 778 | :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL |
| 779 | :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 780 | # install the syntax files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 781 | :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN |
| 782 | :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 783 | # install the indent files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 784 | :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND |
| 785 | :chmod $HELPMOD $DEST_IND/*.vim |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 786 | # install the standard autoload files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 787 | :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO |
| 788 | :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 789 | # install the standard plugin files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 790 | :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG |
| 791 | :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 792 | # install the ftplugin files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 793 | :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP |
| 794 | :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 795 | # install the compiler files |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 796 | :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP |
| 797 | :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 798 | |
| 799 | installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 800 | :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO |
| 801 | # Delete any CVS and AAPDIR directories. |
| 802 | # Use the ":tree" command if possible. It was added later, fall back |
| 803 | # to using "find" when it doesn't work. |
| 804 | @try: |
| 805 | :tree $DEST_MACRO {dirname = CVS} |
| 806 | :del {recursive} $name |
| 807 | :tree $DEST_MACRO {dirname = AAPDIR} |
| 808 | :del {recursive} $name |
| 809 | :tree $DEST_MACRO {dirname = .*} |
| 810 | :chmod $DIRMOD $name |
| 811 | :tree $DEST_MACRO {filename = .*} |
| 812 | :chmod $FILEMOD $name |
| 813 | @except: |
| 814 | @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO) |
| 815 | @ if ok and cvsdirs: |
| 816 | :del {recursive} $cvsdirs |
| 817 | :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print`` |
| 818 | :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print`` |
| 819 | :chmod $SCRIPTMOD $DEST_MACRO/less.sh |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 820 | |
| 821 | # install the tutor files |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 822 | installtutorbin {virtual}{force}: $DEST_VIM |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 823 | :copy vimtutor $DEST_BIN/$(VIMNAME)tutor |
| 824 | :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 825 | |
| 826 | installtutor {virtual}{force}: $DEST_RT $DEST_TUTOR |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 827 | :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR |
| 828 | :chmod $HELPMOD $DEST_TUTOR/* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 829 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 830 | # Install the spell files, if they exist. This assumes at least the English |
| 831 | # spell file is there. |
| 832 | installspell {virtual}: $(DEST_VIM) $(DEST_RT) $(DEST_SPELL) |
| 833 | enspl = $(SPELLSOURCE)/en.latin1.spl |
| 834 | @if os.path.exists(enspl): |
| 835 | :copy $(SPELLSOURCE)/*.spl $(SPELLSOURCE)/*.vim $(DEST_SPELL) |
| 836 | :chmod $(HELPMOD) $(DEST_SPELL)/*.spl $(DEST_SPELL)/*.vim |
| 837 | @try: |
| 838 | :copy $(SPELLSOURCE)/*.sug $(DEST_SPELL) |
| 839 | :chmod $(HELPMOD) $(DEST_SPELL)/*.sug |
| 840 | @except: |
| 841 | @ pass |
| 842 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 843 | # install helper program xxd |
| 844 | installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \ |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 845 | $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS \ |
| 846 | $INSTALL_TOOL_LANGS |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 847 | xxd = $DEST_BIN/xxd$EXESUF |
| 848 | @if os.path.exists(xxd): |
| 849 | :move {force} $xxd $(xxd).rm |
| 850 | :del $(xxd).rm |
| 851 | :copy xxd/xxd$EXESUF $DEST_BIN |
| 852 | :do strip $DEST_BIN/xxd$EXESUF |
| 853 | :chmod $BINMOD $DEST_BIN/xxd$EXESUF |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 854 | :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS) |
| 855 | # |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 856 | # install the runtime tools |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 857 | @try: |
| 858 | @ if aap_has(":tree"): |
| 859 | # New method: copy everything and delete CVS and AAPDIR dirs |
| 860 | :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS |
| 861 | :tree $DEST_TOOLS {dirname = CVS} |
| 862 | :delete {recursive} $name |
| 863 | :tree $DEST_TOOLS {dirname = AAPDIR} |
| 864 | :delete {recursive} $name |
| 865 | @except: |
| 866 | # Old method: copy only specific files and directories. |
| 867 | :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS |
| 868 | :chmod $FILEMOD $DEST_TOOLS/* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 869 | # replace the path in some tools |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 870 | :progsearch perlpath perl |
| 871 | @if perlpath: |
| 872 | :cat $TOOLSSOURCE/efm_perl.pl | |
| 873 | :eval re.sub("/usr/bin/perl", perlpath, stdin) |
| 874 | >! $DEST_TOOLS/efm_perl.pl |
| 875 | @else: |
| 876 | :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 877 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 878 | :progsearch awkpath nawk gawk awk |
| 879 | @if awkpath: |
| 880 | :cat $TOOLSSOURCE/mve.awk | |
| 881 | :eval re.sub("/usr/bin/nawk", awkpath, stdin) |
| 882 | >! $DEST_TOOLS/mve.awk |
| 883 | @else: |
| 884 | :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 885 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 886 | :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*`` |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 887 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 888 | # install the language specific files for tools, if they were unpacked |
| 889 | install-tool-languages: |
| 890 | :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) |
| 891 | :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) |
| 892 | :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) |
| 893 | :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) |
| 894 | :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) |
| 895 | :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) |
| 896 | :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) |
| 897 | :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) |
| 898 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 899 | # install the language specific files, if they were unpacked |
| 900 | install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 901 | :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) |
| 902 | :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) |
| 903 | :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) |
| 904 | :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) |
| 905 | :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) |
| 906 | :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) |
| 907 | :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) |
| 908 | :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) |
| 909 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 910 | $(DEST_MAN_FR) $(INSTALLMLARGS) |
| 911 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 912 | $(DEST_MAN_FR_I) $(INSTALLMLARGS) |
| 913 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 914 | $(DEST_MAN_FR_U) $(INSTALLMLARGS) |
| 915 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 916 | $(DEST_MAN_IT) $(INSTALLMLARGS) |
| 917 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 918 | $(DEST_MAN_IT_I) $(INSTALLMLARGS) |
| 919 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 920 | $(DEST_MAN_IT_U) $(INSTALLMLARGS) |
| 921 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 922 | $(DEST_MAN_RU) $(INSTALLMLARGS) |
| 923 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 924 | $(DEST_MAN_RU_U) $(INSTALLMLARGS) |
| 925 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 926 | @if _no.MAKEMO: |
| 927 | :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \ |
| 928 | LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install |
| 929 | @if os.path.exists(_no.LANGSOURCE): |
| 930 | :print installing language files |
| 931 | :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG |
| 932 | :chmod $FILEMOD $DEST_LANG/*.vim |
| 933 | @if os.path.exists(_no.KMAPSOURCE): |
| 934 | :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP |
| 935 | :chmod $FILEMOD $DEST_KMAP/*.vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 936 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 937 | # install the icons for KDE, if the directory exists and the icon doesn't. |
| 938 | ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps |
| 939 | ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps |
| 940 | ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps |
| 941 | KDEPATH = $HOME/.kde/share/icons |
| 942 | install-icons {virtual}: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 943 | gp = $ICON48PATH/gvim.png |
| 944 | @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp): |
| 945 | :copy $SCRIPTSOURCE/vim48x48.png $gp |
| 946 | gp = $ICON32PATH/gvim.png |
| 947 | @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp): |
| 948 | :copy $SCRIPTSOURCE/vim32x32.png $gp |
| 949 | gp = $ICON16PATH/gvim.png |
| 950 | @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp): |
| 951 | :copy $SCRIPTSOURCE/vim16x16.png $gp |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 952 | |
| 953 | |
| 954 | $HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 955 | @if not os.path.exists(_no.TOOLSSOURCE): |
| 956 | :print Runtime files not found. |
| 957 | :error You need to unpack the runtime archive before running "make install". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 958 | |
| 959 | # create links from various names to vim. This is only done when the links |
| 960 | # (or executables with the same name) don't exist yet. |
| 961 | installlinks {virtual}: $GUI_TARGETS \ |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 962 | $DEST_BIN/$EXTARGET \ |
| 963 | $DEST_BIN/$VIEWTARGET \ |
| 964 | $DEST_BIN/$RVIMTARGET \ |
| 965 | $DEST_BIN/$RVIEWTARGET \ |
| 966 | $INSTALLVIMDIFF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 967 | |
| 968 | installglinks {virtual}: $DEST_BIN/$GVIMTARGET \ |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 969 | $DEST_BIN/$GVIEWTARGET \ |
| 970 | $DEST_BIN/$RGVIMTARGET \ |
| 971 | $DEST_BIN/$RGVIEWTARGET \ |
| 972 | $DEST_BIN/$EVIMTARGET \ |
| 973 | $DEST_BIN/$EVIEWTARGET \ |
| 974 | $INSTALLGVIMDIFF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 975 | |
| 976 | installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET |
| 977 | installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET |
| 978 | |
| 979 | # These dependencies use an empty buildcheck so that they are only done when |
| 980 | # the target doesn't exist. |
| 981 | $DEST_BIN/$EXTARGET: {buildcheck = } |
| 982 | :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET |
| 983 | |
| 984 | $DEST_BIN/$VIEWTARGET: {buildcheck = } |
| 985 | :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET |
| 986 | |
| 987 | $DEST_BIN/$GVIMTARGET: {buildcheck = } |
| 988 | :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET |
| 989 | |
| 990 | $DEST_BIN/$GVIEWTARGET: {buildcheck = } |
| 991 | :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET |
| 992 | |
| 993 | $DEST_BIN/$RVIMTARGET: {buildcheck = } |
| 994 | :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET |
| 995 | |
| 996 | $DEST_BIN/$RVIEWTARGET: {buildcheck = } |
| 997 | :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET |
| 998 | |
| 999 | $DEST_BIN/$RGVIMTARGET: {buildcheck = } |
| 1000 | :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET |
| 1001 | |
| 1002 | $DEST_BIN/$RGVIEWTARGET: {buildcheck = } |
| 1003 | :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET |
| 1004 | |
| 1005 | $DEST_BIN/$VIMDIFFTARGET: {buildcheck = } |
| 1006 | :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET |
| 1007 | |
| 1008 | $DEST_BIN/$GVIMDIFFTARGET: {buildcheck = } |
| 1009 | :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET |
| 1010 | |
| 1011 | $DEST_BIN/$EVIMTARGET: {buildcheck = } |
| 1012 | :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET |
| 1013 | |
| 1014 | $DEST_BIN/$EVIEWTARGET: {buildcheck = } |
| 1015 | :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET |
| 1016 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 1017 | # create links for the manual pages with various names to vim. This is only |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1018 | # done when the links (or manpages with the same name) don't exist yet. |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1019 | INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \ |
| 1020 | $(EXNAME) $(VIEWNAME) $(RVIMNAME) $(RVIEWNAME) \ |
| 1021 | $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \ |
| 1022 | $(GVIMDIFFNAME) $(EVIEWNAME) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1023 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1024 | installmanlinks {virtual}: |
| 1025 | :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ |
| 1026 | $(DEST_MAN) $(INSTALLMLARGS) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1027 | |
| 1028 | # |
| 1029 | # U N I N S T A L L |
| 1030 | # |
| 1031 | uninstall {virtual}{force}: uninstall_runtime |
| 1032 | :del {force} $DEST_BIN/$VIMTARGET |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1033 | :del {force} $DEST_BIN/vimtutor |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1034 | :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET |
| 1035 | :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET |
| 1036 | :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET |
| 1037 | :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET |
| 1038 | :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET |
| 1039 | :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1040 | :del {force} $DEST_BIN/xxd$EXESUF |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1041 | |
| 1042 | # Note: "deldir" will fail if any files were added after "make install", that |
| 1043 | # is intentionally: Keep files the user added. |
| 1044 | uninstall_runtime {virtual}{force}: |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1045 | :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS) |
| 1046 | :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS) |
| 1047 | :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS) |
| 1048 | :sys ./installman.sh uninstall $(DEST_MAN_FR_U) "" $(INSTALLMANARGS) |
| 1049 | :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS) |
| 1050 | :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS) |
| 1051 | :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS) |
| 1052 | :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) |
| 1053 | :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) |
| 1054 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1055 | $(DEST_MAN) $(INSTALLMLARGS) |
| 1056 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1057 | $(DEST_MAN_FR) $(INSTALLMLARGS) |
| 1058 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1059 | $(DEST_MAN_FR_I) $(INSTALLMLARGS) |
| 1060 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1061 | $(DEST_MAN_FR_U) $(INSTALLMLARGS) |
| 1062 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1063 | $(DEST_MAN_IT) $(INSTALLMLARGS) |
| 1064 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1065 | $(DEST_MAN_IT_I) $(INSTALLMLARGS) |
| 1066 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1067 | $(DEST_MAN_IT_U) $(INSTALLMLARGS) |
| 1068 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1069 | $(DEST_MAN_RU) $(INSTALLMLARGS) |
| 1070 | :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ |
| 1071 | $(DEST_MAN_RU_U) $(INSTALLMLARGS) |
| 1072 | :del {force} $DEST_MAN/xxd.1 |
| 1073 | :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1 |
| 1074 | :del {force} $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1 |
| 1075 | :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 |
| 1076 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1077 | :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl |
| 1078 | :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE |
| 1079 | :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE |
| 1080 | :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim |
| 1081 | :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE |
| 1082 | :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE |
| 1083 | :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE |
| 1084 | :del {force} $SYS_OPTWIN_FILE |
| 1085 | :del {force} $DEST_COL/*.vim $DEST_COL/README.txt |
| 1086 | :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt |
| 1087 | :del {force} $DEST_IND/*.vim $DEST_IND/README.txt |
| 1088 | :del {force} $DEST_PRINT/*.ps |
| 1089 | :del {force}{recursive} $DEST_MACRO |
| 1090 | :del {force}{recursive} $DEST_TUTOR |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1091 | :del {force}{recursive} $DEST_SPELL |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1092 | :del {force}{recursive} $DEST_TOOLS |
| 1093 | :del {force}{recursive} $DEST_LANG |
| 1094 | :del {force}{recursive} $DEST_KMAP |
| 1095 | :del {force}{recursive} $DEST_COMP |
| 1096 | :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND |
| 1097 | :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 1098 | :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1099 | :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt |
Bram Moolenaar | 87e25fd | 2005-07-27 21:13:01 +0000 | [diff] [blame] | 1100 | :deldir {force} $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 1101 | # This will fail when other Vim versions are installed, no worries. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1102 | @try: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 1103 | :deldir $DEST_VIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1104 | @except: |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 1105 | :print Cannot delete $DEST_VIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1106 | |
Bram Moolenaar | 8ab561d | 2006-03-23 22:44:10 +0000 | [diff] [blame^] | 1107 | ############################################################################### |
| 1108 | ### MacOS X installation |
| 1109 | ### |
| 1110 | ### This installs a runnable Vim.app in $(prefix) |
| 1111 | |
| 1112 | REZ = /Developer/Tools/Rez |
| 1113 | RESDIR = $(APPDIR)/Contents/Resources |
| 1114 | @r = re.compile('.*VIM_VERSION_SHORT\\s*"(\\d[^"]*)".*', re.S) |
| 1115 | VERSION = /`r.match(open("version.h").read()).group(1)` |
| 1116 | ICON_APP = gui_mac.icns |
| 1117 | |
| 1118 | ### Common flags |
| 1119 | M4FLAGSX = $?(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \ |
| 1120 | -DAPP_VER=$(VERSION) -DICON_APP=$(ICON_APP) |
| 1121 | |
| 1122 | ### Icons |
| 1123 | ICONS = $(RESDIR)/$(ICON_APP) |
| 1124 | |
| 1125 | :attr {directory = $DIRMOD} $RESDIR |
| 1126 | |
| 1127 | # If you uncomment the following lines the *.icns in the src directory will be |
| 1128 | # detected by this Makefile automatically, and used for Vim. |
| 1129 | #ICON_APP = $(shell if [ -e app.icns ] ; then echo app.icns ; else echo gui_mac.icns ; fi) |
| 1130 | #ICON_DOC = $(shell if [ -e doc.icns ] ; then echo doc.icns ; else echo ; fi) |
| 1131 | #ICON_DOCTXT = $(shell if [ -e doc-txt.icns ] ; then echo doc-txt.icns ; else echo ; fi) |
| 1132 | #ICONS = $(addprefix $(RESDIR)/, $(ICON_APP) $(ICON_DOC) $(ICON_DOCTXT)) |
| 1133 | |
| 1134 | install_macosx {virtual}: gui_bundle |
| 1135 | # Remove the link to the runtime dir, don't want to copy all of that. |
| 1136 | :delete {force} $(RESDIR)/vim/runtime |
| 1137 | :copy {r} $APPDIR $DESTDIR$prefix |
| 1138 | :tree $DESTDIR$prefix {dirname = AAPDIR} |
| 1139 | :delete {recursive} $name |
| 1140 | # Install the runtime files. Recursive! |
| 1141 | :mkdir {r}{f} $DESTDIR$prefix/$RESDIR/vim/runtime |
| 1142 | # :mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin |
| 1143 | :execute main.aap PREFIX=$DESTDIR$prefix/$RESDIR/vim VIMRTLOC=$DESTDIR$prefix/$RESDIR/vim/runtime installruntime |
| 1144 | # Put the link back. |
| 1145 | :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime |
| 1146 | # TODO: Create the vimtutor application. |
| 1147 | |
| 1148 | gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \ |
| 1149 | bundle-resource bundle-language |
| 1150 | |
| 1151 | bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET) |
| 1152 | # Make a link to the runtime directory, so that we can try out the executable |
| 1153 | # without installing it. |
| 1154 | :mkdir {r}{f} $(RESDIR)/vim |
| 1155 | :symlink {quiet} `os.getcwd()`/../runtime $(RESDIR)/vim/runtime |
| 1156 | |
| 1157 | bundle-executable {virtual}: $(VIMTARGET) |
| 1158 | :mkdir {r}{f} $(APPDIR)/Contents/MacOS |
| 1159 | :copy $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET) |
| 1160 | |
| 1161 | bundle-info {virtual}: bundle-dir |
| 1162 | :print Creating PkgInfo |
| 1163 | :print "APPLVIM!" >! $(APPDIR)/Contents/PkgInfo |
| 1164 | :print Creating Info.plist |
| 1165 | :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist |
| 1166 | |
| 1167 | bundle-resource {virtual}: bundle-dir bundle-icons bundle-rsrc |
| 1168 | |
| 1169 | bundle-icons {virtual}: $ICONS |
| 1170 | |
| 1171 | ### Classic resources |
| 1172 | # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) |
| 1173 | # This file is also required for OS X Vim. |
| 1174 | bundle-rsrc {virtual}: os_mac.rsr.hqx |
| 1175 | :print Creating resource fork |
| 1176 | :sys python dehqx.py $source |
| 1177 | :del {force} gui_mac.rsrc |
| 1178 | :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc |
| 1179 | |
| 1180 | # po/Make_osx.pl says something about generating a Mac message file |
| 1181 | # for Ukrananian. Would somebody using Mac OS X in Ukranian |
| 1182 | # *really* be upset that Carbon Vim was not localised in |
| 1183 | # Ukranian? |
| 1184 | # |
| 1185 | #bundle-language: bundle-dir po/Make_osx.pl |
| 1186 | # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) |
| 1187 | bundle-language {virtual}: bundle-dir |
| 1188 | |
| 1189 | $(APPDIR)/Contents: |
| 1190 | :mkdir {r} $(APPDIR)/Contents/MacOS |
| 1191 | :mkdir {r} $(RESDIR)/English.lproj |
| 1192 | |
| 1193 | $ICONS: $ICON_APP |
| 1194 | :copy $source $target |
| 1195 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1196 | |
| 1197 | # vim: sts=4 sw=4 : |