The Trouble with Hidden Targets

  1. to build foo.o

    You'd hope that typing make foo.o would result in Make building foo.o from foo.c and if necessary building foo.c. But Make doesn't know how to build foo.c, it just happens by accident when building foo. So, if foo.c is missing make foo.o results in an error:

    		No rule to make target `foo.c', needed by `foo.o'.

Hopefully you're convinced now that hidden targets are a bad idea and can lead to all sorts of odd build problems.


About the author

AgileConnection is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.