port _srv.o makefile rules don't observe dependency tracking

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема port _srv.o makefile rules don't observe dependency tracking
Дата
Msg-id 1335900625.16054.6.camel@vanquo.pezone.net
обсуждение исходный текст
Ответы Re: port _srv.o makefile rules don't observe dependency tracking  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
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?




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: extending relations more efficiently
Следующее
От: Robert Haas
Дата:
Сообщение: Re: extending relations more efficiently