There is this rule in src/port/Makefile:
%_srv.o: %.c $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
But this rule doesn't observe dependency tracking, so if you change a
header file, these files won't get build as necessary. This is the only
case in the source tree where this happens, because (after a few more
trivial fixups I have made recently) everything else uses the default
%.c -> %.o rule.
I have thought for a long time about how to refactor the dependency
tracking logic from Makefile.global so that it can support this outlier,
but all solutions ended up more complex than I would have liked.
(Something like bundling up the entire logic into make functions and
calling it from various places.)
Instead, I thought this could easily be fixed by writing this:
%_srv.o: %.c %.o $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
A bit hacky, but should get quite robust results.
Comments, other ideas?