Skip site navigation (1) Skip section navigation (2)

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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: port _srv.o makefile rules don't observe dependency tracking
Date: 2012-05-01 19:30:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 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 by date

Next:From: Robert HaasDate: 2012-05-01 19:35:04
Subject: Re: extending relations more efficiently
Previous:From: Peter EisentrautDate: 2012-05-01 19:17:08
Subject: pgsql: Remove dead ports

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group