]> granicus.if.org Git - postgresql/blobdiff - src/port/Makefile
Remove redundant code for getnameinfo() replacement
[postgresql] / src / port / Makefile
index c005140f83f78336833217dcb4f136de67f44912..bace576d80356da0a1077b5c82303ff36cc530b1 100644 (file)
@@ -30,13 +30,9 @@ include $(top_builddir)/src/Makefile.global
 override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
 LIBS += $(PTHREAD_LIBS)
 
-OBJS = $(LIBOBJS) chklocale.o dirmod.o exec.o inet_net_ntop.o noblock.o \
-       path.o pgcheckdir.o pgmkdirp.o pgsleep.o pgstrcasecmp.o \
-       qsort.o qsort_arg.o sprompt.o thread.o
-
-ifneq (,$(filter $(PORTNAME),cygwin win32))
-OBJS += pipe.o
-endif
+OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o exec.o fls.o inet_net_ntop.o \
+       noblock.o path.o pgcheckdir.o pg_crc.o pgmkdirp.o pgsleep.o \
+       pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
 
 # foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND
 OBJS_SRV = $(OBJS:%.o=%_srv.o)
@@ -57,8 +53,7 @@ libpgport.a: $(OBJS)
        $(AR) $(AROPT) $@ $^
 
 # thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
-thread.o: thread.c
-       $(CC) $(CFLAGS) $(CPPFLAGS) $(PTHREAD_CFLAGS) -c $<
+thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
 
 #
 # Server versions of object files
@@ -67,7 +62,14 @@ thread.o: thread.c
 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