From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA23661; Mon, 1 Oct 2001 09:04:35 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA23013 for ; Mon, 1 Oct 2001 09:04:34 +0200 (MET DST) Received: from hotmail.com (f217.law15.hotmail.com [64.4.23.217]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f9174Xr19581 for ; Mon, 1 Oct 2001 09:04:33 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 1 Oct 2001 00:04:32 -0700 Received: from 164.107.3.52 by lw15fd.law15.hotmail.msn.com with HTTP; Mon, 01 Oct 2001 07:04:32 GMT X-Originating-IP: [164.107.3.52] From: "Jeremy Fincher" To: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Building O'Caml projects properly. Date: Mon, 01 Oct 2001 03:04:32 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 01 Oct 2001 07:04:32.0545 (UTC) FILETIME=[52356910:01C14A47] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >If you want to do what I usually do, your project tree should look >somewhat like this: > > ./ > Makefile > OcamlMakefile > lib/ > libsrc/ > lib1/... > lib2/... > lib3/... > src/ > Makefile > src1.ml > src2.ml > ... I have a similar directory structure to that one in my ~/src/ocaml/my directory. As far as lib/ and libsrc/ go, it's exactly the same. Rather than having a src/ directory, though, I'm not going to use a toplevel Makefile and instead have my projects in their own directories at the same level as lib/ and libsrc/. Of course, I only have one project at the moment, so it's not a huge deal, but when I get more it might matter :) All the lib/* directories compile and install correctly using the following Makefile: --------------------------------------------------------------------------- OCAMLMAKEFILE = ../../OcamlMakefile SOURCES = sformat.ml RESULT = a.out LIBDIRS = ../../lib INCDIRS = ../../lib LIBINSTALL_FILES = *.mli *.cmi *.cma *.cmo *.cmx *.cmxa *.a *.o OCAML_LIB_INSTALL = ../../lib all: byte-code-library native-code-library -include $(OCAMLMAKEFILE) --------------------------------------------------------------------------- Everything works correctly *except* that after I make libinstall, it removes the *.mli files from the directory, which I don't want it to do. I do get hung up, however, when trying to compile my project, using this Makefile: ---------------------------------------------------------------------------- OCAMLMAKEFILE = ../OcamlMakefile SOURCES = calc_parser.mly calc_lexer.mll ircmsg.ml irclib.ml ircutils.ml logger.ml flusher.ml ircusers.ml factoids.ml help.ml privmsg_callbacks.ml callbacks.ml irctester.ml RESULT = ircbot LIBS = unix pcre LIBDIRS = ../lib INCDIRS = ../lib all: byte-code native-code -include $(OCAMLMAKEFILE) ---------------------------------------------------------------------------- Everything compiles correctly, but when it gets to the linking stage, it tells me this: gmake[1]: Entering directory `/usr/home/jfincher/src/ocaml/my/ocamlbot' ocamlc -I ../lib -ccopt -L../lib unix.cma pcre.cma -o ircbot \ calc_parser.cmo calc_lexer.cmo ircmsg.cmo irclib.cmo ircutils.cmo logger.cmo flusher.cmo ircusers.cmo factoids.cmo help.cmo privmsg_callbacks.cmo callbacks.cmo irctester.cmo Error while linking ircmsg.cmo: Reference to undefined global `Py_string' gmake[1]: *** [ircbot] Error 2 gmake[1]: Leaving directory `/usr/home/jfincher/src/ocaml/my/ocamlbot' gmake: *** [byte-code] Error 2 And I have no idea what to do about it. All the proper py_string.cm* files are in the lib directory as they should be. Any comments on the above Makefiles, either related to my specific questions or not, are appreciated. Jeremy _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr