Hacker symbol

September 8, 2019 ~ 1 min read

Makefile VPATH


Makefile relies on files being built. The VPATH ensures that make checks for files at a certain path.

VPATH flags=.makeFlags
VPATH=$(flags)
$(shell mkdir -p $(flags))
test: touch
    $(flags)/$@

Running the above twice will result in:

$ make test touch .makeFlags/test
$ make test make: '.makeFlags/test' is up to date.

Sebastian BolaƱos

Hi, I'm Sebastian. I'm a software developer from Costa Rica. You can follow me on Twitter. I enjoy working on trustless systems.