[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cannot use -lname in prereq list?
From: |
Robert Mecklenburg |
Subject: |
Cannot use -lname in prereq list? |
Date: |
Fri, 22 Aug 2003 21:01:56 +0000 (GMT) |
I was attempting to use the -l link flag feature in a prerequisite and
discovered a surprising feature. make will not match a -lxx
prerequisite with a libxx.a target. The obvious makefile works:
count_words: count_words.o libcounter.a
libcounter.a: libcounter.a(lexer.o)
But when the libcounter.a prereq is changed to the -l form it fails:
count_words: count_words.o -lcounter
libcounter.a: libcounter.a(lexer.o)
When run yields:
$ make
gcc -c -o count_words.o count_words.c
make: *** No rule to make target `-lcounter', needed by `count_words'. Stop.
$ make --version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
Is this expected behavior?
Thanks,
Robert
- Cannot use -lname in prereq list?,
Robert Mecklenburg <=