[README] specify minimum version of gcc required
[ohcount] / README
1 == Ohcount
2
3 NOTE: THE PRIMARY DOCUMENTATION FOR OHCOUNT IS EXTRACTED FROM SOURCE CODE
4 BY DOXYGEN. FOR THE MOST UP-TO-DATE DOCS, PLEASE SEE BELOW FOR INFO
5 ON BUILDING AND REFERING TO THE DOXYGEN DOCS.
6
7 Ohloh/SourceForge's source code line counter.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License Version 2 as
11 published by the Free Software Foundation.
12
13 Ohcount is specifically licensed under GPL v2.0, and no later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 == Overview
24
25 Ohcount is a library for counting lines of source code.
26 It was originally developed at Ohloh, and is used to generate
27 the reports at www.ohloh.net.
28
29 Ohcount supports multiple languages within a single file: for example,
30 a complex HTML document might include regions of both CSS and JavaScript.
31
32 Ohcount has two main components: a detector which determines the primary
33 language family used by a particular source file, and a parser which
34 provides a line-by-line breakdown of the contents of a source file.
35
36 Ohcount includes a command line tool that allows you to count individual
37 files or whole directory trees. It also allows you to find source code
38 files by language family, or to create a detailed annotation of an
39 individual source file.
40
41 Ohcount includes a Ruby binding which allows you to directly access its
42 language detection features from a Ruby application.
43
44 == System Requirements
45
46 Ohcount is supported on Mac OS X 10.4 and 10.5 and Ubuntu 8.04 LTS. Other Linux
47 environments should also work, but your mileage may vary.
48
49 Ohcount does not support Windows.
50
51 Ohcount targets Ruby 1.8.6. The build script requires a bash shell. You
52 also need a C compiler to build the native extensions.
53
54 == Source Code ==
55
56 Ohcount source code is available as a Git repository:
57
58   git clone git://github.com/andyverprauskus/ohcount.git
59
60 == Doc files ==
61
62 To build the more extensive Doxygen docs, do
63         > cd doc
64         > Doxygen Doxyfile
65
66 After building the docs, view them with a browser by opening doc/html/index.html.
67 On a mac, you can install Doxygen with "sudo port install Doxygen".
68 On Debian/Ubuntu, install with "sudo apt-get instal doxygen".
69
70 == Building Ohcount ==
71
72 You will need ragel 6.3 or higher, bash, pcre, gcc (version 4.1.2 or greater) and SWIG to build ohcount. Once you have them, go to the top directory of ohcount and type:
73
74         > bash build
75 or > ./build
76
77 == Using Ohcount ==
78
79 Once you've building ohcount, the executable program will be at bin/ohcount. The most basic use is to count lines of code in a directory tree, run:
80         "ohcount" to count the current directory and source code in any child directories
81
82 == For additional docs, including how to add a new language, see the Doxygen docs ==
83
84 Particularly, for instructions on adding a new language, follow the instructions at doc/html/detector_doc.html
85 Read http://labs.ohloh.net/ohcount/wiki/HowToSubmitPatches for information about having your patch accepted.
86
87
88 DEPENDENCIES
89 ============
90 SWIG, pcre, ragel, bash