I may miss something very obvious with this Makefile:
convert: devel/bar
touch convert
init: devel/foo
echo 'init'
devel/foo:
mkdir -p devel
touch devel/foo
devel/bar: init
touch devel/bar
When I run it, the devel/bar
target always gets called. I'd expect it to call convert
, check the file devel/bar
, and call that target only if that file is not found. If I remove its dependency on init
, everything works as I would expect. What am I doing wrong?
You're not creating a file called init
, so init
is always out-of-date. Therefore everything that depends on it is always out-of-date.
There probably is no file named init
? So it tries to update devel/bar
(since it depends on init
).
Consider using .PHONY
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With