[m-dev.] Installing and using private libraries

Ralph Becket rbeck at microsoft.com
Thu Feb 22 04:52:55 AEDT 2001


I've been trying to work out how one should use the mmake support
for private libraries and I haven't had much luck.

The makefile for my private library, call it `foo', looks something
like this:

MAIN_TARGET = libfoo
depend: foo.depend
install: $(MAIN_TARGET).install

and do `mmake depend && mmake && mmake install' then I expect all
the relevant files to be place in the same locations as the standard
compiler installed stuff (because I haven't set INSTALL_PREFIX; the
target directory is rooted at $HOME/local/mercury in my case).

So far so good.

Now I have a program bar.m that wants to use foo.  If I have the
following in bar's Mmakefile:

FOO_DIR = <wherever I compiled foo>

VPATH = $(FOO_DIR):$(MMAKE_VPATH)
MCFLAGS = -I$(FOO_DIR) $(EXTRA_MCFLAGS)
MLFLAGS = -R$(FOO_DIR) $(EXTRA_MLFLAGS) \
          -L$(FOO_DIR)
MLLIBS = -lfoo $(EXTRA_MLLIBS)
C2INITARGS = $(FOO_DIR)/foo.init

MAIN_TARGET = bar
depend: $(MAIN_TARGET).depend

then all works well.  However, if my makefile just looks like this
(which is what the section "Supporting multiple grades and architectures"
in the Users' Guide suggests to me should work)

EXTRA_LIB_DIRS = $(HOME)/local/mercury     # Is this necessary?
EXTRA_LIBRARIES = foo

MAIN_TARGET = bar
depend: $(MAIN_TARGET).depend

I get no joy at all:
...
gmake: *** No rule to make target `foo.init', needed by
`Mercury/cs/bar_init.c'.

Can someone explain what it is that I'm doing wrong?  I think this is
one for the FAQ or a case for more explanation in the Users' Guide.

Cheers,

Ralph

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list