Hi,
I'm confused with -l prerequisites and library search feature. Let's
imagine I have a rule to build a library and a program that must be
linked with this library. The problem that is make doesn't build and
look for the library in the current directory. The example below
demonstrates the problem.
$ cat fail.mk
fail: -lbad
echo $@
libbad.so:
touch $@
$ make -f fail.mk
make: *** No rule to make target `-lbad', needed by `fail'. Stop.
I'm expecting such output:
$ make -f fail.mk
touch libbad.so
echo fail
fail
The behavior is different if I ask make to build the library in a
subdirectory instead of working directory:
$ cat well.mk
dummy := $(shell test -d dir || mkdir dir)
well: -lgood
echo $@
dir/libgood.so:
touch $@
vpath lib%.so dir
$ make -f well.mk
touch dir/libgood.so
echo well
well
I tried this test with make-3.80-9 debian/sarge package and with
3.81beta3 version. Although documentation states that make firstly
searches the current directory, I've tried to add ./ to vpath and change
rule in the first example to "./libbad.so:" but it didn't help.
Are there any reasons why make handles current directory and
subdirectory in different ways?
Thanks in advance
--
Maxim Nikulin
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make