hadley/devtools — pull request #624 by luckyrandom (2014-10-21 08:32:28+00:00)
Title: add NO_AUTO_CLEAN to needs_clean

Since the default Makefile in R doesn't handle dependencies of header
files, devtools run a clean compiling when a header or Makevars is newer
than the dll.

Based on (http://bruno.defraine.net/techtips/makefile-auto-dependencies-with-gcc/),
I use the following Makevars to handle dependencies in development
environment. It may improve compiling speed significantly when a header
file is modified.

```make
# DEVTOOLS_NO_AUTO_CLEAN
PKG_CXXFLAGS=-MMD -MP

all: $(SHLIB)

SRC=$(wildcard *.cpp)
DEP=$(SRC:.cpp=.d)
-include $(DEP)
```

To work with the above or similar Makevars, we need a method to suppress
the auto cleaning mechanism of devtools. With this commit, needs_clean
will not trigger cleaning and let the Makevars handle dependencies of
header files, when it see a commented line `# DEVTOOLS_NO_AUTO_CLEAN` in
Makevars.