contiki-os/contiki — pull request #272 by pabigot (2013-06-18 09:58:36+00:00)
Title: Makefile.include: support make clean all

(Feature requested in discussion of #254)

Historically $(OBJECTDIR) was created when Makefile.include is read. A consequence is that combining "clean" with "all" (or any other build target) results in an error because the clean removes the object directory that is required to exist when building dependencies. Creating $(OBJECTDIR) on-demand ensures it is present when needed.

Removed creation of $(OBJECTDIR) on initial read, and added creation of destination directory to all Makefile* rules that include $(OBJECTDIR) in the target but do not clearly require $(OBJECTDIR) to exist in the dependencies. Note that some of these occur when the target is a make variable that defaults to a value that includes $(OBJECTDIR).