Hi,

This mail is focused to Emacs users on *NIX platforms who are browsing the
Fossil source code.

I have recently started using rtags, a powerful source code indexer for C
and C++, and just wanted to share my positive experiences.
Read more at

https://github.com/Andersbakken/rtags

I attach an "interactive help" Makefile which shows the setup steps for
using rtags with the Fossil source code in a simplified way.
If you consider this should be included in a developer's Wiki, please let
me know.

Best Regards,
Johan


------------------------------------------------------------


# Helper Makefile for setting up rtags with fossil

SHELL := /bin/sh
THIS_DIR      := `pwd`
THIS_MAKEFILE := `if [ -n "$(MAKEFILE_LIST)" ];then echo
"$(MAKEFILE_LIST)";else if [ -n "$(.PARSEFILE)" ];then echo
"$(.PARSEFILE)";else echo Makefile; fi; fi`

.PHONY: help setup

# Help
help:
    @echo
    @echo "1. To use rtags, you need:"
    @echo
    @echo "    BSD|Linux|Mac OS + Emacs"
    @echo "    At the time of writing this, MS Windows is not supported.
:-("
    @echo
    @echo "2. Read the 'rtags' docs and get the source code:"
    @echo
    @echo "    https://github.com/Andersbakken/rtags";
    @echo
    @echo "3. rtags dependencies basically are (read the docs for details):"
    @echo
    @echo "    llvm"
    @echo "    cmake"
    @echo "    bear"
    @echo
    @echo "4. For details about how to setup rtags to work with Fossil,
type:"
    @echo
    @echo "    make setup -f $(THIS_MAKEFILE)"
    @echo

setup:
    @echo
    @echo "1. If not done already, create a 'rtags' cache directory in your
home directory '$$HOME':"
    @echo
    @echo "    mkdir -p ~/.rtags"
    @echo "    echo '--data-dir=~/.rtags' > ~/.rdmrc"
    @echo
    @echo "2. In the root directory of a Fossil checkout, create a JSON
Compilation Database for this project, based on a clean build."
    @echo "   Note that some files are not compiled by default (for example
src/json*.c), so they will not be indexed by 'rtags' unless configured"
    @echo
    @echo "    make clean"
    @echo "    ./configure --json --with-th1-hooks --with-your-options-here
(optional)"
    @echo "    bear make"
    @echo
    @echo "3. Tweek the database for Fossil:"
    @echo
    @echo '    sed  -i"" -e
"s,$(THIS_DIR)/bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g" -e
"s,bld/\([A-Za-z]*\)_\.c,$(THIS_DIR)/src/\1.c,g" compile_commands.json'
    @echo
    @echo "4. If not done already, start the rtags daemon, 'rdm' (this can
also be done inside Emacs):"
    @echo
    @echo "    rdm --daemon"
    @echo
    @echo "5. Start the rtags client in this directory (this can also be
done inside Emacs):"
    @echo
    @echo "    rc -J ."
    @echo
    @echo "6. Start Emacs and configure 'rtags.el' to browse the 'src/'
directory."
    @echo


------------------------------------------------------------

Attachment: Makefile.rtags
Description: Binary data

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to