I have this makefile in a directory with a set of .cpp, each one representing a single program with some header-only dependences. All files are in the same directory.
To compile for example the program a, I do make a. The make's implicit rules will compile successfully a from a.cpp, but make must also remake the target when their header-only dependencies change.
However, once a program compiles, the following makefile doesn't rebuild anything if I do, for example, touch utils.hpp and then retry compilation. What's going on?
src := $(shell find . -maxdepth 1 -name "*.cpp")
exe := $(src:.cpp=)
# In case I want to build every program, w/o a cmd-line target.
all: $(exe)
%: utils.hpp test.hpp
My make version is GNU Make 4.1.