caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OcamlConf 0.8 - Compiling Sources in Sub-directories
@ 2004-09-14 23:47 chris.danx
  0 siblings, 0 replies; only message in thread
From: chris.danx @ 2004-09-14 23:47 UTC (permalink / raw)
  To: Caml Mailing List

Hi,

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 configure.ml file for a game. 
  However I ran into a problem with OcamlConf (configure.ml 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 
function.

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

danx@trunk$ ocamlconf configure.ml && ./configure

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


danx@trunk$ make
ocamlfind ocamlc  -c  -o src/logic/fbaCells.cmo src/logic/fbaCells.ml
File "src/logic/fbaCells.ml", 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.ml && ./configure

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


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


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?


Cheers,
Chris

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


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

open Conf
open Util

let game_logic_files =
   "fbaCells.mli fbaCells.ml"

let game_logic_library_name =
   "fbaglogic"


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




(*
  *)
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
        ~package:         "sg-fbaddict"
        ~findlib_package: "fbaddict"
        ~version:         "0.1"
        ~includes:        ["src/logic"]
        ~flags: [
	 [`compile; `native], [];	
        ]

        (* *)
        [
	 game_logic_library "src/logic"
        ]
     )

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-14 23:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-14 23:47 [Caml-list] OcamlConf 0.8 - Compiling Sources in Sub-directories chris.danx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).