[m-dev.] diff: changes for user-defined libraries

Tyson Richard DOWD trd at cs.mu.oz.au
Tue Jul 15 18:35:44 AEST 1997


> +
> +Generally Mmake will do most of the work of building
> +libraries automatically.  Here's a sample @code{Mmakefile} for
> +creating a library.
> +
> + at example
> +MAIN_TARGET = libmypackage
> + at c XXX
> + at c MCFLAGS = --intermodule-optimization $(EXTRA_MCFLAGS)
> 

What is the XXX reminding you to do?

> +execute some startup code to initialize the library; the
> + at samp{mypackage.init} file contains information about initialization
> +code for the library.
> +
> + at c XXX and why the @samp{MCFLAGS} contains @samp{--intermodule-optimization}.
> +

And here?

> +
> +To use a library, you need to set the Mmake variables @samp{VPATH},
> + at samp{MCFLAGS}, @samp{MLFLAGS}, and @samp{MLLIBS} to specify the
> +name and location of the library or libraries that you wish to use.
> +For example, if you want to link in the libraries @samp{mypackage} and
> + at samp{myotherlib}, which were built in the directories
> + at samp{/some/directory/mypackage} and @samp{/some/directory/myotherlib}
> +respectively, you could use the following settings:
> +
> + at example
> +# Specify the location of the `mypackage' and `myotherlib' directories
> +MYPACKAGE_DIR = /some/directory/mypackage
> +MYOTHERLIB_DIR = /some/directory/myotherlib
> +
> +# The following stuff tells Mmake to use the two libraries
> +VPATH = $(MYPACKAGE_DIR):$(MYOTHERLIB_DIR):$(MMAKE_VPATH)
> +MCFLAGS = -I$(MYPACKAGE_DIR) -I$(MYOTHERLIB_DIR) $(EXTRA_MCFLAGS)
> +MLFLAGS = -R$(MYPACKAGE_DIR) -R$(MYOTHERLIB_DIR) $(EXTRA_MLFLAGS) \
> +          -L$(MYPACKAGE_DIR) -L$(MYOTHERLIB_DIR)
> +MLLIBS = -lmypackage -lmyotherlib $(EXTRA_MLLIBS)
> +C2INITFLAGS = $(MYPACKAGE_DIR)/mypackage.init \
> +              $(MYOTHERLIB_DIR)/myotherlib.init
> + at end example

It was all so simple and clean until this bit... ;-)

Other than those mysterious XXXs, it seems fine.

-- 
       Tyson Dowd           # 4.4: People keep saying the behavior is undefined,
                            # but I just tried it on an ANSI-conforming compiler
     trd at cs.mu.oz.au        # and got the results I expected.
http://www.cs.mu.oz.au/~trd # A: They were wrong. Flame them mercilessly. C-IAQ



More information about the developers mailing list