Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
update Makefile and readme for new pfff_db_heavy
Browse files Browse the repository at this point in the history
  • Loading branch information
pad committed Dec 2, 2010
1 parent e22e3c1 commit a5fa1c6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
18 changes: 9 additions & 9 deletions Makefile
Expand Up @@ -24,14 +24,14 @@ PROGS+=spatch
PROGS+=stags
PROGS+=ppp

# note that without bdb, pfff_db_light will be incomplete regarding PHP
PROGS+=pfff_db_light
# note that without bdb, pfff_db will be incomplete regarding PHP
PROGS+=pfff_db
PROGS+=scheck

PROGS+=pfff_test

ifeq ($(FEATURE_BDB), 1)
PROGS+=pfff_db
PROGS+=pfff_db_heavy
endif

ifeq ($(FEATURE_VISUAL), 1)
Expand Down Expand Up @@ -59,7 +59,7 @@ OPTPROGS= $(PROGS:=.opt)
# endif


# cf also below for target pfff_db
# cf also below for target pfff_db_heavy
ifeq ($(FEATURE_BDB), 1)
BDBDIR=external/ocamlbdb
BDBCMD= $(MAKE) all -C $(BDBDIR) && $(MAKE) bdb -C commons
Expand Down Expand Up @@ -426,17 +426,17 @@ clean::
rm -f pfff_db

#------------------------------------------------------------------------------
# pfff_db_light targets
# pfff_db_heavy targets
#------------------------------------------------------------------------------

pfff_db_light: $(LIBS) main_db_light.cmo
pfff_db_heavy: $(LIBS) main_db_heavy.cmo
$(OCAMLC) $(CUSTOM) -o $@ $(SYSLIBS) $^

pfff_db_light.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_db_light.cmx
pfff_db_heavy.opt: $(LIBS:.cma=.cmxa) $(LIBS2:.cma=.cmxa) $(OBJS2:.cmo=.cmx) main_db_heavy.cmx
$(OCAMLOPT) $(STATIC) -o $@ $(SYSLIBS:.cma=.cmxa) $^

clean::
rm -f pfff_db_light
rm -f pfff_db_heavy

#------------------------------------------------------------------------------
# OBSOLETE: pfff_browser target
Expand Down Expand Up @@ -581,7 +581,7 @@ website:
tags:
./stags -verbose -lang ml .
db:
./pfff_db_light -verbose -lang ml -o DB_LIGHT .
./pfff_db -verbose -lang ml -o DB_LIGHT .
visual:
./codemap -profile -ss 2 \
-with_info DB_LIGHT -ocaml_filter .
Expand Down
32 changes: 17 additions & 15 deletions readme.txt
Expand Up @@ -18,17 +18,19 @@ more documentation on how to use or extend pfff.

pfff is also made of few tools:
- pfff, which allows to test the different parsers on a single file
- pfff_db_light, which does some global analysis on a set of source files and
store the data in a marshalled form in a file somewhere (e.g. /tmp/light_db)
- pfff_db, which does some heavy language specific global analysis on a set
of source files and store the data in a database somewhere
(e.g. /tmp/pfff_db)
- pfff_db, which does some global analysis on a set of source files and
store the data in a marshalled form in a file somewhere (e.g. /tmp/db.json)
- pfff_db_heavy, which does some heavy language specific global analysis
on a set of source files and store the data in a database somewhere
(e.g. /tmp/pfff_db/)
- codemap, which is a gtk and cairo based source code
visualizer/navigator/searcher leveraging
the information computed previously by pfff_db_light
the information computed previously by pfff_db
- sgrep, a syntactical grep
- spatch, a syntacitcal patch
- scheck, a bug finder
- scheck_heavy, a bug finder leveraging the information computed previously
by pfff_db_heavy
- pfff_tags, an Emacs tag generator

For more information, look at the pfff wiki here:
Expand All @@ -46,34 +48,34 @@ or

You can also look at ./pfff --help

Usage for pfff_db_light:
Usage for pfff_db:
-------------------

$ ./pfff_db_light -lang ml -o /tmp/light_db.db ~/pfff
$ ./pfff_db -lang ml -o /tmp/pfff.db ~/pfff

to analyze all the .ml and .mli files under ~/pfff and store metadata
information (the database) in /tmp/light_db.db
information (the database) in /tmp/pfff.db

Usage for codemap:
------------------------

$ ./codemap -with_info /tmp/light_db.db ~/pfff
$ ./codemap -with_info /tmp/pfff.db ~/pfff

This should launch a gtk-based GUI that allows you to visualize
source code and perform some code search.



Usage for pfff_db:
Usage for pfff_db_heavy:
-------------------

$ ./pfff_db -lang php -metapath /tmp/pfff_db ~/www/
$ ./pfff_db_heavy -lang php -metapath /tmp/pfff_db/ ~/www/

to analyze all the .php and .phpt files under ~/www and store metadata
information (the database) in /tmp/pfff_db. It may takes some time,
information (the database) in /tmp/pfff_db/. It may takes some time,
for instance 20 minutes for a really big PHP codebase.

Once this is done you can use some of the flags of pfff_db to
Once this is done you can use some of the flags of pfff_db_heavy to
do some analysis as in:

$ ./pfff_db -deadcode_analysis /tmp/pfff_db
$ ./pfff_db_heavy -deadcode_analysis /tmp/pfff_db/

0 comments on commit a5fa1c6

Please sign in to comment.