[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / README
1 This directory contains the source for Glorious Glasgow Haskell
2 compiler proper, normally a binary called "hsc".  The source is
3 organized into _one_ level of directories, and the literate Haskell
4 source files sit in those directories (i.e., */*.lhs).
5
6 The only "real" subdirectory is the tests/ directory [NB: not
7 distributed normally, but available to gluttons for punishment], which
8 includes some tests that we use to make sure we're not going
9 backwards.  The subdirs of the test directory "match" the subdirs of
10 the main source directory; e.g., the desugarer is in subdir deSugar/,
11 and the tests for the desugarer are in tests/deSugar/.
12
13 The main information about how the compiler goes together is in
14 ./Jmakefile.  The list of modules under "FRONTSRCS_LHS =", 
15 "TCSRCS_LHS =", etc., should show the basic organization of the (many)
16 modules.
17
18 TO ADD A MODULE TO THE COMPILER:
19
20 0. Be familiar with "How to add an optimisation pass..." (in
21    ghc/docs/add_to_compiler).
22
23 1. Create an appropriately-named module in an appropriate subdirectory.
24
25 2. Edit the Jmakefile:
26
27    * If you created a new subdirectory for the module, add that
28      directory to the SUBDIR_LIST and DASH_I_SUBDIR_LIST lists.
29
30    * Add your module to one of the lists of modules in the compiler;
31      e.g., TCSRCS_LHS.
32
33 3. Re-make the Makefile: "make Makefile"
34
35 4. Re-make the automatically-generated dependencies: "make depend".
36
37 Your new module is now "wired in" and you may proceed normally...
38
39     % make
40
41 (see also: day-to-day make-worlding section of developer's guide, near
42 the end)
43
44 5.  If you want to set up automagically (re-)runnable tests, follow
45     the suggests in the file tests/README.