[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with relative path in rule
From: |
Paul D. Smith |
Subject: |
Re: Problem with relative path in rule |
Date: |
Wed, 7 Sep 2005 08:42:20 -0400 |
%% Torleif Sandnes <address@hidden> writes:
ts> I have a problem with using relative pathnames in make rules.
ts> This is the rule:
ts> util.o: ../../utilities/util.c
ts> This is the output from make
ts> c:\programs\WinAVR\utils\bin\make.exe: *** No rule to make target
ts> `../utilities/util.c', needed by `util.o'. Stop.
ts> It seems make removes ../ from my prerequisite.
ts> Is this a known problem, or am I doing something wrong?
You didn't provide a complete example, so I can't tell for sure. Also,
please remember to specify which version of GNU make you're using.
However, the debug output you provided gives a clue.
The rule you give above isn't a complete rule: it's just a prerequisite
declaration. Make still needs to find an actual rule. After make finds
the ../../utilities/util.c file, it looks for ../utilities/util.c. So,
there is another prerequisite declaration in your makefile somewhere
that has util.o depending on ../utilities/util.c, or maybe a complete
rule. It might be a pattern rule but I don't think so given the debug
output.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist