caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Building O'Caml projects properly.
@ 2001-10-01 11:46 Jeremy Fincher
  2001-10-01 12:57 ` Markus Mottl
  0 siblings, 1 reply; 11+ messages in thread
From: Jeremy Fincher @ 2001-10-01 11:46 UTC (permalink / raw)
  To: caml-list

>Remove .mli-files? The libinstall target doesn't remove any files
>at all. It just copies them to the right directory. Or did you mean
>anything else?

When I do a simple "gmake", it compiles all the files, and the directory
becomes filled with ".cmo" and ".cmx" files and so on.  After doing a
"make libinstall" and answering 'y' to the question it asks about
installation, the only things that remain in the directory are the .ml
files and the Makefile itself.  Somehow, given that Makefile, it's
removing all the files it installs.

>This is not surprising, because it obviously doesn't link against
>"py_string.cmo". You can specify this using the "LIBS" variable. Just add
>"py_string" and everything should be fine.

I added py_string to the LIBS line in that Makefile, but it complained about
not being able to find "py_string.cma".

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Caml-list] Building O'Caml projects properly.
@ 2001-10-01 14:02 Jeremy Fincher
  0 siblings, 0 replies; 11+ messages in thread
From: Jeremy Fincher @ 2001-10-01 14:02 UTC (permalink / raw)
  To: caml-list

> > Actually, it might be the difference in default behavior of the
> > `install' command. On my MacOS X, it moves the files by default,
> > where on my Linux box, they get copied.
>
>Ah, ok, I didn't expect that there are versions of the install command
>that actually move files by default (what a horrible idea!).
>
> > Adding `-c' option to the install command in OcamlMakefile would do
> > the trick I think.
>
>Since I don't have access to any MacOS-box, I can only trust you here.
>I have added this flag now and hope that this fixes this problem with
>exotic "install"-implementations.

I just checked the manpage for install on my box, and it's true -- -c
copies the file, instead of the default behavior which is to remove the
original file after creating the target.

This is a FreeBSD 4.3 box.  I think it's a peculiarity of the BSD
"install", since it's not localized to MacOS X.

Are there any known workarounds with the current OcamlMakefile, or will
there be a new version released shortly that compensates for this?

Also, you mentioned in your other email that I need to make a "real
library" out of my py_string.ml{,i} files.  Here's the exact Makefile
I'm using for that set of modules:

------------------
OCAMLMAKEFILE = ../../OcamlMakefile

SOURCES = py_string.ml py_os.ml py_fnmatch.ml py_glob.ml py_time.ml 
py_socket.ml py_asyncore.ml py_asynchat.ml
RESULT = a.out
LIBS = unix pcre
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)
------------------

What do I need to add to make it compile a real library?

Thanks,
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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Caml-list] Building O'Caml projects properly.
@ 2001-10-01  7:04 Jeremy Fincher
  2001-10-01  8:07 ` Markus Mottl
  0 siblings, 1 reply; 11+ messages in thread
From: Jeremy Fincher @ 2001-10-01  7:04 UTC (permalink / raw)
  To: caml-list

>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


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Caml-list] Building O'Caml projects properly.
@ 2001-09-29 20:31 Jeremy Fincher
  2001-09-29 21:48 ` Julian Assange
  2001-09-29 22:08 ` Markus Mottl
  0 siblings, 2 replies; 11+ messages in thread
From: Jeremy Fincher @ 2001-09-29 20:31 UTC (permalink / raw)
  To: caml-list

I'm not very experienced with make, so I've been using Markus Mottl's 
OcamlMakefile in my projects so far.  In one of my projects, I use source 
files from two other small libraries I've written; at present, I just have a 
whole lot of files in my SOURCES and a bunch of symlinks to the proper files 
in the proper directories.  However, I'd really like to be able to improve 
my build process, and I think a good way to do that is to isolate in 
directories the other libraries I've written.

The only catch is that I have no idea how to do so :)  If anyone has any 
examples of multi-directory projects, or projects that come with separate 
libraries they depend on, I would really like to find out how to clean up my 
build process.

Thanks,
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-10-01 15:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-01 11:46 [Caml-list] Building O'Caml projects properly Jeremy Fincher
2001-10-01 12:57 ` Markus Mottl
2001-10-01 13:08   ` Hideo Bannai
2001-10-01 13:47     ` Markus Mottl
2001-10-01 15:17       ` Julian Assange
  -- strict thread matches above, loose matches on Subject: below --
2001-10-01 14:02 Jeremy Fincher
2001-10-01  7:04 Jeremy Fincher
2001-10-01  8:07 ` Markus Mottl
2001-09-29 20:31 Jeremy Fincher
2001-09-29 21:48 ` Julian Assange
2001-09-29 22:08 ` Markus Mottl

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).