]> granicus.if.org Git - postgresql/commitdiff
Fix dependency tracking for src/port/%_srv.o files
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 8 May 2012 17:08:53 +0000 (20:08 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 8 May 2012 17:10:50 +0000 (20:10 +0300)
Because they use their own compilation rule, they don't use the
dependency tracking logic from Makefile.global.  To make sure that
dependency tracking works anyway for the *_srv.o files, depend on
their *.o siblings as well, which do have proper dependencies.  It's a
hack that might fail someday if there is a *_srv.o without a
corresponding *.o, but it works for now (and those would probably go
into src/backend/port/ anyway).

src/port/Makefile

index 0225b397a3080cae4d2c8ad4cb6babdadeebf147..bace576d80356da0a1077b5c82303ff36cc530b1 100644 (file)
@@ -62,7 +62,14 @@ thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
 libpgport_srv.a: $(OBJS_SRV)
        $(AR) $(AROPT) $@ $^
 
-%_srv.o: %.c
+# Because this uses its own compilation rule, it doesn't use the
+# dependency tracking logic from Makefile.global.  To make sure that
+# dependency tracking works anyway for the *_srv.o files, depend on
+# their *.o siblings as well, which do have proper dependencies.  It's
+# a hack that might fail someday if there is a *_srv.o without a
+# corresponding *.o, but it works for now (and those would probably go
+# into src/backend/port/ anyway).
+%_srv.o: %.c %.o
        $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
 
 $(OBJS_SRV): | submake-errcodes