tags:

views:

1651

answers:

2

I have a makefile with a target clean:

clean:
   $(MAKE) -f <other makefile location> clean

When I call make clean in this makefile, it tells me that in the other makefile there is no rule 'clean-linux'. Specifically here is the output.

make -f /root/ovaldi-5.5.25-src/project/linux/Makefile clean
make[1]: Entering directory '/root/ovaldi-5.5.25-src'
make[2]: Entering directory '/root/ovaldi-5.5.25-src'
make[2]: *** No rule to make target 'clean-linux'. Stop.
make[2]: Leaving directory '/root/ovaldi-5.5.25-src'
make[1]: Leaving directory '/root/ovaldi-5.5.25-src'

Why is it giving it the clean-linux target and not just clean like I specified?

+2  A: 

Just a guess but maybe the 'clean' target in the second makefile calls 'clean-linux'?

Can you post the clean target of the second makefile?

Edit:

In light of your posted clean target it seems you're just calling the clean-linux target incorrectly.

Beta has posted the correct way of dealing with your problem in their answer so I'm going to +1 that.

Glen
It does call it but it is specified. It seems as if target dependencies and calls to make in the second makefile call make on the first makefile.
Matt
+1  A: 
Beta