caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
To: Caml Mailing List <caml-list@inria.fr>
Subject: [Caml-list] OcamlConf 0.8 - Compiling Sources in Sub-directories
Date: Wed, 15 Sep 2004 00:47:01 +0100	[thread overview]
Message-ID: <414782F5.4060708@ntlworld.com> (raw)

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


                 reply	other threads:[~2004-09-14 23:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=414782F5.4060708@ntlworld.com \
    --to=chris.danx@ntlworld.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).