# A-A-P recipe for building Vim## There are no user choices in here!# Put configure arguments in the file config.arg.# Later there will be a config.txt file that contains examples and# explanations.## Optional arguments:# PREFIX=dir Overrules the install directory.# Can be specified when installing only.# Example: aap install PREFIX=$HOME#@if os.name != "posix": :error Sorry, this recipe only works for Unix-like systems. # Skip the configure stuff when "link.sh" is executing this recipe recursively# to build pathdef.c or not building something and auto/config.aap does exist.@if ((_no.TARGETARG != "pathdef" and has_build_target())@ or not os.path.exists("auto/config.aap")): # # A U T O C O N F # # Run autoconf when configure.in has been changed since it was last run. # This is skipped when the signatures in "mysign" are up-to-date. When # there is no autoconf program skip this (the signature is often the only # thing that's outdated) auto/configure {signfile = mysign} : configure.in @if not program_path("autoconf"): :print Can't find autoconf, using existing configure script. @else: # Move configure aside, autoconf would overwrite it :move {exist} configure configure.save :sys autoconf :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure :chmod 755 auto/configure :move configure.save configure :del {force} auto/config.cache auto/config.status # Change the configure script to produce config.aap instead of config.mk. auto/configure.aap : auto/configure :print Adjusting auto/configure for A-A-P. :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin) >! auto/configure.aap :chmod 755 auto/configure.aap # The configure script uses the directory where it's located, use a link. configure.aap: {buildcheck=} :symlink {f} auto/configure.aap configure.aap # Dependency: run configure.aap to update config.h and config.aap in the # "auto" directory. # NOTE: we can only build for one architecture, because -MM doesn't work # when building for both. config {virtual} auto/config.h auto/config.aap : auto/configure.aap configure.aap config.arg config.h.in config.aap.in :sys CONFIG_STATUS=auto/config.status ./configure.aap `file2string("config.arg")` --with-mac-arch=ppc --cache-file=auto/config.cache # Configure arguments: create an empty "config.arg" file when its missing config.arg: :touch {exist} config.arg # "auto/config.aap" contains a lot of settings, such as the name of the # executable "Target". # First update it, forcefully if the "reconfig" target was used. @if _no.TARGETARG != "comment" and _no.TARGETARG != "make": @if "reconfig" in var2list(_no.TARGETARG): :del {force} auto/config.cache auto/config.status :update {force} auto/config.aap @else: :update auto/config.aap # Include the recipe that autoconf generated.:include auto/config.aap # Unfortunately "-M" doesn't work when building for two architectures. Switch# back to PPC only.@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0: CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")` # A "PREFIX=dir" argument overrules the value of $prefix# But don't use the default "/usr/local".@if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local': prefix = $PREFIX # Don't want "~/" in prefix.prefix = `os.path.expanduser(prefix)` # For Mac.APPDIR = $(VIMNAME).app ### Names of the programs and targetsVIMTARGET = $VIMNAME$EXESUFEXTARGET = $EXNAME$LNKSUFVIEWTARGET = $VIEWNAME$LNKSUFGVIMNAME = g$VIMNAMEGVIMTARGET = $GVIMNAME$LNKSUFGVIEWNAME = g$VIEWNAMEGVIEWTARGET = $GVIEWNAME$LNKSUFRVIMNAME = r$VIMNAMERVIMTARGET = $RVIMNAME$LNKSUFRVIEWNAME = r$VIEWNAMERVIEWTARGET = $RVIEWNAME$LNKSUFRGVIMNAME = r$GVIMNAMERGVIMTARGET = $RGVIMNAME$LNKSUFRGVIEWNAME = r$GVIEWNAMERGVIEWTARGET = $RGVIEWNAME$LNKSUFVIMDIFFNAME = $(VIMNAME)diffGVIMDIFFNAME = g$VIMDIFFNAMEVIMDIFFTARGET = $VIMDIFFNAME$LNKSUFGVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUFEVIMNAME = e$VIMNAMEEVIMTARGET = $EVIMNAME$LNKSUFEVIEWNAME = e$VIEWNAMEEVIEWTARGET = $EVIEWNAME$LNKSUF ## G U I variant## The GUI is selected by configure, a lot of other things depend on it.#:variant GUI GTK GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c gui_gtk_f.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = GUI_LIBS2 = $GTK_LIBNAME GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = MOTIF GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c gui_xmdlg.c gui_xmebw.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = GUI_LIBS2 = $MOTIF_LIBNAME -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = ATHENA # XAW_LIB et al. can be overruled to use Xaw3d widgets XAW_LIB ?= -lXaw GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \ gui_at_sb.c gui_at_fs.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = $XAW_LIB GUI_LIBS2 = -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = NEXTAW # XAW_LIB et al. can be overruled to use Xaw3d widgets XAW_LIB ?= -lXaw GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c gui_at_fs.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = $NEXTAW_LIB GUI_LIBS2 = -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = CARBONGUI GUI_SRC = gui.c gui_mac.c pty.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = -framework Carbon GUI_LIBS2 = GUI_INSTALL = install_macosx GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = gui_bundle GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET) PHOTONGUI GUI_SRC = gui.c gui_photon.c pty.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_PHOTON GUI_IPATH = GUI_LIBS_DIR = GUI_LIBS1 = -lph -lphexlib GUI_LIBS2 = GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = * GUI_SRC = GUI_OBJ = GUI_DEFS = GUI_IPATH = GUI_LIBS_DIR = GUI_LIBS1 = GUI_LIBS2 = GUI_INSTALL = install_normal GUI_TARGETS = GUI_MAN_TARGETS = GUI_TESTTARGET = GUI_BUNDLE = GUI_TESTARG = PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFSCPPFLAGS = ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIRLDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGSLIBS = $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) Target = $VIMNAME # reconfig target also builds Vim (reconfiguration is handled above).reconfig {virtual}: $Target distclean: clean :del {force} auto/config.h auto/config.aap :del {force} auto/config.cache auto/config.status # Execute the test scripts. Run these after compiling Vim, before installing.## This will produce a lot of garbage on your screen, including a few error# messages. Don't worry about that.# If there is a real error, there will be a difference between "test.out" and# a "test99.ok" file.# If everything is alright, the final message will be "ALL DONE".#test check: VimProg = ../$Target :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG testclean {virtual}: :del {force} testdir/*.out testdir/test.log # When no fetch target exists we are not a child of the ../main.aap recipe,# Use ../main.aap to do the fetching.# --- If you get an error here for wrong number of arguments, you need to# update to a newer version of A-A-P.@if not has_target("fetch"): fetch: :execute ../main.aap fetch # All the source files that need to be compiled.# Some are optional and depend on configure.# "version.c" is missing, it's always compiled (see below).Source = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c ex_docmd.c ex_eval.c ex_getln.c fileio.c fold.c getchar.c hardcopy.c hashtab.c if_cscope.c if_xcmdsrv.c main.c mark.c memfile.c memline.c menu.c message.c misc1.c misc2.c move.c mbyte.c normal.c ops.c option.c os_unix.c auto/pathdef.c popupmnu.c quickfix.c regexp.c screen.c search.c spell.c syntax.c tag.c term.c ui.c undo.c window.c $OS_EXTRA_SRC $GUI_SRC $HANGULIN_SRC $MZSCHEME_SRC $PERL_SRC $NETBEANS_SRC $PYTHON_SRC $TCL_SRC $RUBY_SRC $SNIFF_SRC $WORKSHOP_SRC Objects = $GUI_OBJ # TODO: make is still used for subdirectories, need to write a recipe.MAKE ?= make all: $Target $GUI_BUNDLE # This dependency is required to build auto/osdef.h before automatic# dependencies are generated.$Source version.c : auto/osdef.h # Need to mention that the target also depends on version.c, since it's not# included in $Source$Target : version.c # Some sources are to be found in the "auto" directory.SRCPATH += auto # When building Vim always compile version.c to get the timestamp.:filetype declare my_prog:attr {filetype = my_prog} $Target :program $Target : $Source $Objects :action build my_prog object version_obj = `src2obj("version.c")` :do compile {target = $version_obj} version.c #:do build {target = $target {filetype = program}} $source $version_obj link_sed = $BDIR/link.sed @if os.path.exists(link_sed): :move {force} $link_sed auto/link.sed @else: :del {force} auto/link.sed :update link2.sh :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \ -o $target $source $version_obj $LIBS" \ MAKE="aap" sh ./link2.sh :copy {force} auto/link.sed $BDIR/link.sed # "link.sh" must be modified for A-A-Plink2.sh : link.sh :print Adjusting $-source for A-A-P. :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin) >! $target xxd/xxd$EXESUF: xxd/xxd.c :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \ $MAKE -f Makefile # Build the language specific files if they were unpacked.# Generate the converted .mo files separately, it's no problem if this fails.languages {virtual}: @if _no.MAKEMO: :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix @try: :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted @except: :print Generated converted language files failed, continuing # Update the *.po files for changes in the sources. Only run manually.update-po {virtual}: cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po auto/if_perl.c: if_perl.xs :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \ $PERLLIB/ExtUtils/typemap if_perl.xs >> $target auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF auto/pathdef.c: auto/config.aap :print Creating $target :print >! $target /* pathdef.c */ :print >> $target /* This file is automatically created by main.aap */ :print >> $target /* DO NOT EDIT! Change main.aap only. */ :print >> $target $#include "vim.h" :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC"; :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR"; v = $CC -c -I$srcdir $CFLAGS @v = string.replace(v, '"', '\\"') :print >> $target char_u *all_cflags = (char_u *)"$v"; linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS link_sed = $BDIR/link.sed @if os.path.exists(link_sed): # filter $linkcmd through $BDIR/link.sed :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd @linkcmd = string.replace(linkcmd, '"', '\\"') :print >> $target char_u *all_lflags = (char_u *)"$linkcmd"; @if _no.get("COMPILEDBY"): who = $COMPILEDBY where = '' @else: :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where :print >> $target char_u *compiled_user = (char_u *)"$who"; :print >> $target char_u *compiled_sys = (char_u *)"$where"; ### Names of the tools that are also madeTOOLS = xxd/xxd$EXESUF # Root of the installation tree. Empty for a normal install, set to an# existing path to install into a special place (for generating a package).DESTDIR ?= ### Location of man pages under $MANTOPDIRMAN1DIR = /man1 ### Location of Vim files (should not need to be changed, and### some things might not work when they are changed!)VIMDIR = /vim@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)VIMRTDIR = /`r.match(open("version.h").read()).group(1)`HELPSUBDIR = /docCOLSUBDIR = /colorsSYNSUBDIR = /syntaxINDSUBDIR = /indentAUTOSUBDIR = /autoloadPLUGSUBDIR = /pluginFTPLUGSUBDIR = /ftpluginLANGSUBDIR = /langCOMPSUBDIR = /compilerKMAPSUBDIR = /keymapMACROSUBDIR = /macrosTOOLSSUBDIR = /toolsTUTORSUBDIR = /tutorSPELLSUBDIR = /spellPRINTSUBDIR = /printPODIR = po ### VIMLOC common root of the Vim files (all versions)### VIMRTLOC common root of the runtime Vim files (this version)### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)### VIMRUNTIMEDIR compiled-in location for runtime files (optional)### HELPSUBLOC location for help files### COLSUBLOC location for colorscheme files### SYNSUBLOC location for syntax files### INDSUBLOC location for indent files### AUTOSUBLOC location for standard autoload files### PLUGSUBLOC location for standard plugin files### FTPLUGSUBLOC location for ftplugin files### LANGSUBLOC location for language files### COMPSUBLOC location for compiler files### KMAPSUBLOC location for keymap files### MACROSUBLOC location for macro files### TOOLSSUBLOC location for tools files### TUTORSUBLOC location for tutor files### PRINTSUBLOC location for print files### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)### You can override these if you want to install them somewhere else.### Edit feature.h for compile-time settings.VIMLOC = $DATADIR$VIMDIR@if not _no.get("VIMRTLOC"): VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIRLines 1–500 of 1215. Load more
# A-A-P recipe for building Vim # # There are no user choices in here! # Put configure arguments in the file config.arg. # Later there will be a config.txt file that contains examples and # explanations. # # Optional arguments: # PREFIX=dir Overrules the install directory. # Can be specified when installing only. # Example: aap install PREFIX=$HOME # @if os.name != "posix": :error Sorry, this recipe only works for Unix-like systems. # Skip the configure stuff when "link.sh" is executing this recipe recursively # to build pathdef.c or not building something and auto/config.aap does exist. @if ((_no.TARGETARG != "pathdef" and has_build_target()) @ or not os.path.exists("auto/config.aap")): # # A U T O C O N F # # Run autoconf when configure.in has been changed since it was last run. # This is skipped when the signatures in "mysign" are up-to-date. When # there is no autoconf program skip this (the signature is often the only # thing that's outdated) auto/configure {signfile = mysign} : configure.in @if not program_path("autoconf"): :print Can't find autoconf, using existing configure script. @else: # Move configure aside, autoconf would overwrite it :move {exist} configure configure.save :sys autoconf :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure :chmod 755 auto/configure :move configure.save configure :del {force} auto/config.cache auto/config.status # Change the configure script to produce config.aap instead of config.mk. auto/configure.aap : auto/configure :print Adjusting auto/configure for A-A-P. :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin) >! auto/configure.aap :chmod 755 auto/configure.aap # The configure script uses the directory where it's located, use a link. configure.aap: {buildcheck=} :symlink {f} auto/configure.aap configure.aap # Dependency: run configure.aap to update config.h and config.aap in the # "auto" directory. # NOTE: we can only build for one architecture, because -MM doesn't work # when building for both. config {virtual} auto/config.h auto/config.aap : auto/configure.aap configure.aap config.arg config.h.in config.aap.in :sys CONFIG_STATUS=auto/config.status ./configure.aap `file2string("config.arg")` --with-mac-arch=ppc --cache-file=auto/config.cache # Configure arguments: create an empty "config.arg" file when its missing config.arg: :touch {exist} config.arg # "auto/config.aap" contains a lot of settings, such as the name of the # executable "Target". # First update it, forcefully if the "reconfig" target was used. @if _no.TARGETARG != "comment" and _no.TARGETARG != "make": @if "reconfig" in var2list(_no.TARGETARG): :del {force} auto/config.cache auto/config.status :update {force} auto/config.aap @else: :update auto/config.aap # Include the recipe that autoconf generated. :include auto/config.aap # Unfortunately "-M" doesn't work when building for two architectures. Switch # back to PPC only. @if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0: CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")` # A "PREFIX=dir" argument overrules the value of $prefix # But don't use the default "/usr/local". @if _no.get("PREFIX") and _no.get("PREFIX") != '/usr/local': prefix = $PREFIX # Don't want "~/" in prefix. prefix = `os.path.expanduser(prefix)` # For Mac. APPDIR = $(VIMNAME).app ### Names of the programs and targets VIMTARGET = $VIMNAME$EXESUF EXTARGET = $EXNAME$LNKSUF VIEWTARGET = $VIEWNAME$LNKSUF GVIMNAME = g$VIMNAME GVIMTARGET = $GVIMNAME$LNKSUF GVIEWNAME = g$VIEWNAME GVIEWTARGET = $GVIEWNAME$LNKSUF RVIMNAME = r$VIMNAME RVIMTARGET = $RVIMNAME$LNKSUF RVIEWNAME = r$VIEWNAME RVIEWTARGET = $RVIEWNAME$LNKSUF RGVIMNAME = r$GVIMNAME RGVIMTARGET = $RGVIMNAME$LNKSUF RGVIEWNAME = r$GVIEWNAME RGVIEWTARGET = $RGVIEWNAME$LNKSUF VIMDIFFNAME = $(VIMNAME)diff GVIMDIFFNAME = g$VIMDIFFNAME VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF EVIMNAME = e$VIMNAME EVIMTARGET = $EVIMNAME$LNKSUF EVIEWNAME = e$VIEWNAME EVIEWTARGET = $EVIEWNAME$LNKSUF # # G U I variant # # The GUI is selected by configure, a lot of other things depend on it. # :variant GUI GTK GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c gui_gtk_f.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = GUI_LIBS2 = $GTK_LIBNAME GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = MOTIF GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c gui_xmdlg.c gui_xmebw.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = GUI_LIBS2 = $MOTIF_LIBNAME -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = ATHENA # XAW_LIB et al. can be overruled to use Xaw3d widgets XAW_LIB ?= -lXaw GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \ gui_at_sb.c gui_at_fs.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = $XAW_LIB GUI_LIBS2 = -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = NEXTAW # XAW_LIB et al. can be overruled to use Xaw3d widgets XAW_LIB ?= -lXaw GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c gui_at_fs.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = $NEXTAW_LIB GUI_LIBS2 = -lXt GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = CARBONGUI GUI_SRC = gui.c gui_mac.c pty.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_MAC -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas -mdynamic-no-pic -pipe GUI_IPATH = $GUI_INC_LOC GUI_LIBS_DIR = $GUI_LIB_LOC GUI_LIBS1 = -framework Carbon GUI_LIBS2 = GUI_INSTALL = install_macosx GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = gui_bundle GUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET) PHOTONGUI GUI_SRC = gui.c gui_photon.c pty.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_PHOTON GUI_IPATH = GUI_LIBS_DIR = GUI_LIBS1 = -lph -lphexlib GUI_LIBS2 = GUI_INSTALL = install_normal GUI_TARGETS = installglinks GUI_MAN_TARGETS = yes GUI_TESTTARGET = gui GUI_BUNDLE = GUI_TESTARG = * GUI_SRC = GUI_OBJ = GUI_DEFS = GUI_IPATH = GUI_LIBS_DIR = GUI_LIBS1 = GUI_LIBS2 = GUI_INSTALL = install_normal GUI_TARGETS = GUI_MAN_TARGETS = GUI_TESTTARGET = GUI_BUNDLE = GUI_TESTARG = PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS) POST_DEFS = $X_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS) CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS CPPFLAGS = ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS 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) Target = $VIMNAME # reconfig target also builds Vim (reconfiguration is handled above). reconfig {virtual}: $Target distclean: clean :del {force} auto/config.h auto/config.aap :del {force} auto/config.cache auto/config.status # Execute the test scripts. Run these after compiling Vim, before installing. # # This will produce a lot of garbage on your screen, including a few error # messages. Don't worry about that. # If there is a real error, there will be a difference between "test.out" and # a "test99.ok" file. # If everything is alright, the final message will be "ALL DONE". # test check: VimProg = ../$Target :execute testdir/main.aap $GUI_TESTTARGET $GUI_TESTARG testclean {virtual}: :del {force} testdir/*.out testdir/test.log # When no fetch target exists we are not a child of the ../main.aap recipe, # Use ../main.aap to do the fetching. # --- If you get an error here for wrong number of arguments, you need to # update to a newer version of A-A-P. @if not has_target("fetch"): fetch: :execute ../main.aap fetch # All the source files that need to be compiled. # Some are optional and depend on configure. # "version.c" is missing, it's always compiled (see below). Source = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c ex_docmd.c ex_eval.c ex_getln.c fileio.c fold.c getchar.c hardcopy.c hashtab.c if_cscope.c if_xcmdsrv.c main.c mark.c memfile.c memline.c menu.c message.c misc1.c misc2.c move.c mbyte.c normal.c ops.c option.c os_unix.c auto/pathdef.c popupmnu.c quickfix.c regexp.c screen.c search.c spell.c syntax.c tag.c term.c ui.c undo.c window.c $OS_EXTRA_SRC $GUI_SRC $HANGULIN_SRC $MZSCHEME_SRC $PERL_SRC $NETBEANS_SRC $PYTHON_SRC $TCL_SRC $RUBY_SRC $SNIFF_SRC $WORKSHOP_SRC Objects = $GUI_OBJ # TODO: make is still used for subdirectories, need to write a recipe. MAKE ?= make all: $Target $GUI_BUNDLE # This dependency is required to build auto/osdef.h before automatic # dependencies are generated. $Source version.c : auto/osdef.h # Need to mention that the target also depends on version.c, since it's not # included in $Source $Target : version.c # Some sources are to be found in the "auto" directory. SRCPATH += auto # When building Vim always compile version.c to get the timestamp. :filetype declare my_prog :attr {filetype = my_prog} $Target :program $Target : $Source $Objects :action build my_prog object version_obj = `src2obj("version.c")` :do compile {target = $version_obj} version.c #:do build {target = $target {filetype = program}} $source $version_obj link_sed = $BDIR/link.sed @if os.path.exists(link_sed): :move {force} $link_sed auto/link.sed @else: :del {force} auto/link.sed :update link2.sh :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \ -o $target $source $version_obj $LIBS" \ MAKE="aap" sh ./link2.sh :copy {force} auto/link.sed $BDIR/link.sed # "link.sh" must be modified for A-A-P link2.sh : link.sh :print Adjusting $-source for A-A-P. :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin) >! $target xxd/xxd$EXESUF: xxd/xxd.c :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \ $MAKE -f Makefile # Build the language specific files if they were unpacked. # Generate the converted .mo files separately, it's no problem if this fails. languages {virtual}: @if _no.MAKEMO: :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix @try: :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted @except: :print Generated converted language files failed, continuing # Update the *.po files for changes in the sources. Only run manually. update-po {virtual}: cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po auto/if_perl.c: if_perl.xs :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \ $PERLLIB/ExtUtils/typemap if_perl.xs >> $target auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF auto/pathdef.c: auto/config.aap :print Creating $target :print >! $target /* pathdef.c */ :print >> $target /* This file is automatically created by main.aap */ :print >> $target /* DO NOT EDIT! Change main.aap only. */ :print >> $target $#include "vim.h" :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC"; :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR"; v = $CC -c -I$srcdir $CFLAGS @v = string.replace(v, '"', '\\"') :print >> $target char_u *all_cflags = (char_u *)"$v"; linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS link_sed = $BDIR/link.sed @if os.path.exists(link_sed): # filter $linkcmd through $BDIR/link.sed :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd @linkcmd = string.replace(linkcmd, '"', '\\"') :print >> $target char_u *all_lflags = (char_u *)"$linkcmd"; @if _no.get("COMPILEDBY"): who = $COMPILEDBY where = '' @else: :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where :print >> $target char_u *compiled_user = (char_u *)"$who"; :print >> $target char_u *compiled_sys = (char_u *)"$where"; ### Names of the tools that are also made TOOLS = xxd/xxd$EXESUF # Root of the installation tree. Empty for a normal install, set to an # existing path to install into a special place (for generating a package). DESTDIR ?= ### Location of man pages under $MANTOPDIR MAN1DIR = /man1 ### Location of Vim files (should not need to be changed, and ### some things might not work when they are changed!) VIMDIR = /vim @r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S) VIMRTDIR = /`r.match(open("version.h").read()).group(1)` HELPSUBDIR = /doc COLSUBDIR = /colors SYNSUBDIR = /syntax INDSUBDIR = /indent AUTOSUBDIR = /autoload PLUGSUBDIR = /plugin FTPLUGSUBDIR = /ftplugin LANGSUBDIR = /lang COMPSUBDIR = /compiler KMAPSUBDIR = /keymap MACROSUBDIR = /macros TOOLSSUBDIR = /tools TUTORSUBDIR = /tutor SPELLSUBDIR = /spell PRINTSUBDIR = /print PODIR = po ### VIMLOC common root of the Vim files (all versions) ### VIMRTLOC common root of the runtime Vim files (this version) ### VIMRCLOC compiled-in location for global [g]vimrc files (all versions) ### VIMRUNTIMEDIR compiled-in location for runtime files (optional) ### HELPSUBLOC location for help files ### COLSUBLOC location for colorscheme files ### SYNSUBLOC location for syntax files ### INDSUBLOC location for indent files ### AUTOSUBLOC location for standard autoload files ### PLUGSUBLOC location for standard plugin files ### FTPLUGSUBLOC location for ftplugin files ### LANGSUBLOC location for language files ### COMPSUBLOC location for compiler files ### KMAPSUBLOC location for keymap files ### MACROSUBLOC location for macro files ### TOOLSSUBLOC location for tools files ### TUTORSUBLOC location for tutor files ### PRINTSUBLOC location for print files ### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..) ### You can override these if you want to install them somewhere else. ### Edit feature.h for compile-time settings. VIMLOC = $DATADIR$VIMDIR @if not _no.get("VIMRTLOC"): VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR