I have a problem of chicken-and-egg type. Makefile:
---
BUILDDIR=build
$(BUILDDIR):
mkdir -p $(BUILDDIR)
$(objs):%.o:%.c $(BUILDDIR)
$(CC) -c $< -o $(BUILDDIR)/$@
---
In this situation BUILDDIR is created before sources are compiled.
But when everything is compiled and I re-run make it tries to recompile
some source files because make claims that BUILDDIR is newer then
some object files. It is like that because BUILDDIR had been changing when
new object file were generated and put into it.
How to solve this problem i.e. avoid recompiling files during subsequent
make run?