[Mono-dev] Referring to libraries on the command line

Tom Spink tspink at gmail.com
Wed Jul 14 08:13:39 EDT 2010

Hi Russel,

Did you say you were using make?

If so, you can be clever in make like this:

LIBS := $(wildcard *.dll)
REFS := $(foreach LIB,$(LIBS),-r:$(LIB))

Then, you can use $(REFS) on the gmcs command-line, like this:

gmcs ... $(REFS) ...

(where the ellipses is your already existing command-line)

This will populate all the DLLs in the current directory into LIBS,
then generate the references command-line in REFS.

Hope this helps,

On 14 July 2010 07:16, Russell Wallace <russell.wallace at gmail.com> wrote:
> I'm trying to compile a program with gmcs, which wants references to
> all libraries in the current directory. Normally one would specify
> this with *.dll, but because gmcs wants a prefix of -r: in each case,
> this breaks. Is there any way to obtain this effect, e.g. some way to
> expand a wild card and then prepend a prefix to each expanded name?
> (Ubuntu Linux, make under bash, if it matters.)
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

Tom Spink

More information about the Mono-devel-list mailing list