Q:

Setting path to shared library inside a makefile for execution

I want to run a program from inside my makefile which is linked against some shared libraries which are of my own creation. But I don't want them to be permanently added to the library pool of my system.
How can I accomplish this?
I already figured that I somehow have to use/set the LD_LIBRARY_PATH but how as this doesn't seem to work for me:
run:
    export LD_LIBRARY_PATH=$(TESTLIB):$(DEPENDENCIES)
    ./testit

Also trying to run an extra export task wasn't successfull:
export:
    ldconfig -n $(DEPENDENCIES)
    ldconfig -n $(TESTLIB)

A:

Each line in a recipe is run in its own shell, so change it to:
run:
    export LD_LIBRARY_PATH=$(TESTLIB):$(DEPENDENCIES); \
    ./testit

or
run:
    LD_LIBRARY_PATH=$(TESTLIB):$(DEPENDENCIES) ./testit

