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, soinitis always out-of-date. Therefore everything that depends on it is always out-of-date.