# Aap recipe for Exuberant Ctags 5.5. # # Maintainer: Bram Moolenaar # Last change: 2003 Sep 09 # # See http://www.a-a-p.org for information on Aap. # See http://ctags.sf.net for information about Exuberant Ctags. # # For Unix: # Autoconf is used for automatic configuration for your system. # If you want to set specific configuration options, put configure arguments in # the "config.arg" file. Use "./configure --help" to see the possible # arguments. Also see the "INSTALL" file. # Do not run ./configure directly, the results will be overwritten when # executing this recipe. # These are the names of the programs, in case you wish to change them. CtagsProg = ctags$EXESUF # the actual ctags program DCtagsProg = dctags$EXESUF # debugging version EtagsProg = etags$EXESUF # actually a link to ctags ReadtagsProg = readtags$EXESUF # standalone tags file reader EtyperefProg = etyperef$EXESUF # eiffel type referencer # Source files for building ctags, used on all systems. Sources = args.c asm.c asp.c awk.c beta.c c.c cobol.c eiffel.c entry.c erlang.c fortran.c get.c html.c jscript.c keyword.c lisp.c lregex.c lua.c main.c make.c options.c parse.c pascal.c perl.c php.c python.c read.c rexx.c routines.c ruby.c scheme.c sh.c slang.c sml.c sort.c sql.c strlist.c tcl.c verilog.c vim.c yacc.c vstring.c # Files for readtags. ReadtagsSource = readtags.c ReadtagsHeader = readtags.h # Manual page to be installed. This is handled automatigally by the default # install target. INSTALL_MAN = ctags.1 # # On Unix we run configure to generate config.h and config.aap. # This is skipped if there is no building to be done (e.g., for "clean"). # @if osname() == "posix" and has_build_target(): # "config.h" and "config.aap" are generated in $BDIR, because the are # different for each system. # Tell the compiler to find config.h in $BDIR. INCLUDE += -I$BDIR DEFINE += -DHAVE_CONFIG_H # Run autoconf when needed, but avoid doing this always, not everybody has # autoconf installed. Include "mysign" in the distribution, it stores the # signature of the distributed configure script. configure {signfile = mysign} : configure.in @if not program_path("autoconf"): :print Can't find autoconf, using existing configure script. @else: :sys autoconf # Filter the configure script created by autoconf to generate config.aap # instead of Makefile. This means we can use the unmodified configure.in # distributed with ctags. configure_aap : configure :cat configure | :eval re.sub("Makefile", "config.aap", stdin) >! configure_aap :chmod 755 configure_aap # Dependency to create config.aap by running the configure script. # The "config.arg" file is used for configure arguments. :attr config {virtual} {comment = Do configuration only} config $BDIR/config.h $BDIR/config.aap : configure_aap config.arg config.h.in config.aap.in :sys ./configure_aap `file2string("config.arg")` # Move the results into $BDIR. This also means the cache isn't used # the next time, it is unreliable. :move {force} config.h config.aap config.log config.cache config.status $BDIR # Create an empty config.arg when it's missing. config.arg: :touch {exist} config.arg # Update config.aap before including it. Forcefully when the "reconfig" # target is used. @if "reconfig" in var2list(_no.TARGETARG): :del {force} config.cache config.status :update {force} $BDIR/config.aap @else: :update $BDIR/config.aap :include $BDIR/config.aap # A "PREFIX=dir" argument overrules the value of $prefix from configure. @if _no.get("PREFIX"): prefix = $PREFIX # Copy the old $BDIR before it is changed by ":variant", needed for # "distclean" below. conf_BDIR = $BDIR # # Variants: Use "aap DEBUG=yes" to produce the debug version "dctags". # You can also install the debug version, if you really want. # :variant DEBUG no ProgName = $CtagsProg OPTIMIZE ?= 2 DEBUG = no UNINSTALL_EXEC += $DCtagsProg # also uninstall dctags CLEANFILES += $DCtagsProg yes ProgName = $DCtagsProg Sources += debug.c DEFINE += -DDEBUG CPPFLAGS = -g OPTIMIZE ?= 0 UNINSTALL_EXEC += $CtagsProg # also uninstall ctags CLEANFILES += $CtagsProg # # The default things to be build: ctags, readtags and etyperef. # all: $ProgName $ReadtagsProg $EtyperefProg :attr all {comment = build programs "$ProgName", "$ReadtagsProg" and "$EtyperefProg"} # The "clean" target also deletes the files configure generated. CLEANFILES += $conf_BDIR/config.aap $conf_BDIR/config.h $conf_BDIR/config.cache $conf_BDIR/config.status $conf_BDIR/config.log configure_aap # The "cleanmore" target deletes the distributed-generated files. CLEANMOREFILES = configure config.h.in # # Define how to build and install the ctags program. # :program $ProgName : $Sources # # Also build and install the readtags program. # :program $ReadtagsProg : $ReadtagsSource {add_DEFINE = -DREADTAGS_MAIN} {var_BDIR = $BDIR-main} # # Also build and install the etyperef program. # A trick is used here: The eiffel.c file is compiled with an extra flag to # produce the object file $EtyperefObj. This means the dependencies also # must be stored elsewhere, the {depdir} attribute does that. # For the other files we can use the same object files as for ctags, they are # compiled with the same arguments. # EtyperefObj = `src2obj("etyperef.c")` :program $EtyperefProg : keyword.c routines.c strlist.c vstring.c $EtyperefObj {nodist} $EtyperefObj : eiffel.c {add_DEFINE = -DTYPE_REFERENCE_TOOL} {depdir = $BDIR-etr} :do compile $source # When installing on Unix also create a link to "etags". install-local: @if osname() == "posix": :cd $DESTDIR $PREFIX $EXECDIR :symlink {force} $ProgName $EtagsProg uninstall-local: @if osname() == "posix": :cd $DESTDIR $PREFIX $EXECDIR :del {force} $EtagsProg # # Extra: install readtags library (well, really an object file), only when # explicitly asked for. # ReadtagsObj = `src2obj(ReadtagsSource)` install-readtags: $ReadtagsObj :do installlib $ReadtagsObj :do installinclude $ReadtagsHeader uninstall-readtags: :do uninstalllib $ReadtagsObj :do uninstallinclude $ReadtagsHeader # # The stuff only used by the maintainer is in a separate recipe. # This is also useful of you want to submit patches to the maintainer. # This is at the end, so that $DISTFILES has been set by ":program". # Only include this when one of the targets in it is used. # @if has_targetarg("tags TAGS tar tarclean revise cvstag"): :fetch maintainer.aap {fetch = http://www.a-a-p.org/packages/ctags_maintainer.aap} :include maintainer.aap # vim: set sw=4 sts=4 :