Linking shared library


I have conventional directory structure for a pass taken from project examples.
I want to build a tool which makes usage of a shared library which is included in the project.

This means that I have library here:
# lib/foo/*.cc
and after compilation the library is placed here
# Debug/lib/

My tool is located here:
# tool/test_foo

# cat tool/Makefile
LEVEL = ../
LIBS += -lfoo

When I build the tool:
# (cd tool && make)
llvm[0]: Compiling for Debug build
llvm[0]: Linking Debug executable test_foo
... undefined reference ...
collect2: ld returned 1 exit status

Which means that the is not picked up from the Debug/lib directory.
In other words linker does not look into Debug/lib folder.

I can fix this with LDFLAGS but I believe the intention is different?

Greetings, Mariusz.

Actually that's not true.
# make VERBOSE=1
shows that there is -L flag to the Debug/lib but the library (in this case -lfoo) is missing.
In other words LIBS does not place the library when linking.

Greetings, Mariusz.