6.1) Introduction
Camlprog is a complete camlwin development tool. It includes
Camlicon and Camldsgn, a project manager, and text editor. A project is
the specification of the files that composed it, the way to compile them
(this is alredy done for caml, html, c files, but can be changed
and increased), the aim (library or binary) and the option for the linker,
the automatic tasks to accomplish on the help.
6.2) The text editor
The text editor is a classic one. At the top of the window there is the
menu bar. The File
menu is:
- New : edit a new file.
- Load... : load a file.
- Save : save a file with its current name, if the
edited text is not associated with a file, ask for a name.
- Save as... : save a file with a new name.
- Exit : Ask for saved project and the edited file
if necessary, and quit Camlprog.
You can do a find and replace or find in the edited text with the
search
menu:
- Find... : find a string in the text, from the cursor,
or in the selected area.
- Replace... : find all the occurences of a string in
the text and replace them with another string. The search can be done
on the selected area or in all the text.
- Go to line... : go to a line number.
You can edit the text with the associated key or with the Edit
menu:
- Copy : copy the selected area in the clipboard.
- Past : copy the clipboard in the text.
- Cut : copy the selected area in the clipboard and
remove the area from the text.
- Clear : remove the selected area.
When a project is opened, in order to swap to another file, select
the new file in the project. The current file is saved if needed, then new
selected is loaded.
6.3) Create a project
You can load, save, or create a new project with the menu Project. Once a
project is opened, the window shown in figure bellow is added.

Figure 6.1
This is the project window.
It lists all the files of your project. You can add a new
file with the button Add
and delete a file with the button
Del
. The order is important, because Camlprog compiles the
file in the order of the project. The selected file is the one displayed in
the text editor.
A compiler and some options are associated with each file extension. You can
configure or add file type by pressing the Config Compilers
button.

Figure 6.2
The window that allow to configure all the compilers is shown in figure 6.2.
There is a list of all the file extensions currently supported by Camlprog,
and the configuration of the selected one.
A configuration is the specification of a source file extension, target
file extention and a compiler and some flags. For example, if you want to
compile a caml file
with the debug flag, add -g flag to .ml
file
extension. The changes made in a configuration are effective only if you pressed Change
button.
You can add or remove a configuration with the buttons Add
and
Del
.
The aim of the project and the option of the linker can be configured with
the Config Linker
button.

Figure 6.3
You can choose between a binary and a library project. A binary project use
camlc. A library project use camllibr. In order to make a library, you can
specify a temporary file name, which is used to move the last file of
the project once it's compiled. With this method, you can make one mli file
for your library (see camllibr in caml reference manual).
If you have help files ("html" or "htm" under PC), Camlprog can make an
HTML
file which is the
index of all the anchors of all the help files.
It can also renumber all the
titles, using title levels (H1,...,H6
) or make an other
HTML
file which stores the "Table of content".
The names of these files are to be specified when you select these options.
6.4) Compile and link.
The menu Run
allows to compile a file, make a project, clean a project, run a program. This menu is:
- To toplevel : Send the selected area of the text editor
to caml light top level. The answer is displayed in a window.
- Compile : Compile the current file.
- Link : Link the project, or if no project is opened,
the current file.
- Make : Re-compile the files that need to (the target
file is older than the source file) and link them.
- Build all : Re-compile all the files, without testing
date of target and source files, and link them.
- Clean : Remove all the taget files, and the program.
- Run : Do a
Make
and then execute
the program.
6.5) Call Camldsgn and camlicon.
The menu Exec
is useful to open the Camldsgn or the Camlicon
window. The 3 items of this menu are :
- Caml Icon : Open Camlicon.
- Caml Design : Open Camldsgn.
- Shell : Open the shell window.
4.6) Project file and config file formats.
The project are saved in two files. The first (project file:
.prj
) is the list of all the files
included in the project, the other (config file: .cfg
) is the
configuration of the project. The format of these files is describe bellow.
- Project file: ".prj"
- line 1: Format identifier = "Camlprog Project V0.8"
- line 2: first file name
- ...
- line n: (n-1) file name
- Configuration file: ".cfg"
- line 1: Format identifier = Camlprog Project V0.8"
- line 2: input suffix, output suffix, compiler = ".mli .zi
camlc -c"
- line 2: ...
- line p: input suffix, output suffix, compiler = ".c .o gcc -c"
- line p+1: empty line
- line p+2: Library / Binary
- line p+3: linker flags
- line p+4: temporary file name = "tmp.ml"
- line p+5: Index File Name / NoIndex
- line p+6: Title File Name / NoTitle
- line p+7: UpdateTitle / NoUpdate