>
hello : -lhello hello.o
        gcc -o $@ $^

>However, this complains that it can't find "-lhello".

The GNU make manual in the Chapter "Introduction to Makefiles", section "How 
Make Works", explains that to process the target of a rule, make first 
recursively processes the prerequisites.  In your case "-lhello" is a 
prerequisite.  make tried to process it - since such a file did not exist and 
there was no rule with such a file as a target, make could not process it and 
bombed.  Rewrite your rules so that they use only real files (or possibly phony 
files, after you study them in the manual), that either exist or make knows how 
to make them recursively.  


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to