Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] OcamlConf 0.8 - Compiling Sources in Sub-directories
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: chris.danx <chris.danx@n...>
Subject: [Caml-list] OcamlConf 0.8 - Compiling Sources in Sub-directories

Does anyone else here use OCamlConf?  Is this an appropriate place to 
post a problem involving OCamlConf?

I'm in the process of developing a simple file for a game. 
  However I ran into a problem with OcamlConf ( at bottom of 
email).  It does not compile sources in sub directories unless they are 
included using the optional 'include' parameter in the Automake.package 

For example, it fails to find fbaCell.cmi necessary for 
src/logic/  When compiled fbaCell.cmi is compiled into 
src/logic, but src/logic is not supplied to the compiler.

danx@trunk$ ocamlconf && ./configure

------------ Configuration Summary ------------
         prefix: /usr/local

danx@trunk$ make
ocamlfind ocamlc  -c  -o src/logic/fbaCells.cmo src/logic/
File "src/logic/", line 1, characters -1--1:
Could not find the .cmi file for interface src/logic/fbaCells.mli.
make: *** [src/logic/fbaCells.cmo] Error 2

Providing ~includes: ["src/logic"] to AutoMake.package works.

ocamlconf && ./configure

------------ Configuration Summary ------------
         prefix: /usr/local

danx@trunk$ make
ocamlfind ocamlc  -c -I src/logic -o src/logic/fbaCells.cmi 
ocamlfind ocamlc  -c -I src/logic -o src/logic/fbaCells.cmo 
ocamlfind ocamlc  -linkpkg -a -I src/logic     -o fbaglogic.cma 

Is this the intended behaviour?

My expectation would be that it would provide src/logic only when 
necessary.  Perhaps I'm being dense and missing something?


p.s. if anyone can suggest a better name than "Falling Block Addict" for 
a tetris clone, don't hold back! :)

  * An ocamlconf configuration program for 'Falling Block Addict'.
  * by Christopher Campbell (c) 2004

open Conf
open Util

let game_logic_files =

let game_logic_library_name =

let game_logic_library src_dir =
   AutoMake.library ~sources: (prefix src_dir (split game_logic_files))
                    ~dest:    `lib
                    ~shared:  true

let conf_spec =


let configuration = configure conf_spec

let _ =
   print_newline ();
   print_endline "------------ Configuration Summary ------------";
   print_string (configuration#summarize);
   print_newline ()

open AutoMake
let _ =
   output_makefile ~configuration:(configuration :> AutoMake.configuration)
        ~package:         "sg-fbaddict"
        ~findlib_package: "fbaddict"
        ~version:         "0.1"
        ~includes:        ["src/logic"]
        ~flags: [
	 [`compile; `native], [];	

        (* *)
	 game_logic_library "src/logic"

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: