55# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
66# Portions Copyright (c) 1994, Regents of the University of California
77#
8- # $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.161 2008/02/2606:41:24 petere Exp $
8+ # $PostgreSQL: pgsql/src/interfaces/libpq/Makefile,v 1.162 2008/02/2613:31:40 petere Exp $
99#
1010# -------------------------------------------------------------------------
1111
@@ -44,7 +44,7 @@ ifeq ($(PORTNAME), win32)
4444OBJS += win32.o pgsleep.o libpqrc.o
4545
4646libpqrc.o : libpq.rc
47- windres -ilibpq.rc -olibpqrc.o
47+ windres -i$< -o$@
4848
4949ifeq ($(enable_thread_safety ) , yes)
5050OBJS += pthread-win32.o
6666
6767SHLIB_EXPORTS = exports.txt
6868
69- all :$(srcdir ) /libpq.rc all-lib
69+ all :$(srcdir ) /libpq-dist .rc all-lib
7070
7171# Shared library stuff
7272include $(top_srcdir ) /src/Makefile.shlib
@@ -90,11 +90,15 @@ encnames.c wchar.c : % : $(backend_src)/utils/mb/%
9090rm -f$@ && $(LN_S ) $< .
9191
9292
93- distprep :$(srcdir ) /libpq.rc
93+ distprep :$(srcdir ) /libpq-dist .rc
9494
95- # depend on Makefile.global to force rebuild on re-run of configure
96- $(srcdir ) /libpq.rc : libpq.rc.in$(top_builddir ) /src/Makefile.global
97- sed -e' s/\(VERSION.*\),0 *$$/\1,' ` date' +%y%j' | sed' s/^0*//' ` ' /' < $< > $@
95+ libpq.rc $(srcdir ) /libpq-dist.rc : libpq.rc.in
96+ sed -e' s/\(VERSION.*\),0 *$$/\1,' ` date' +%y%j' | sed' s/^0*//' ` ' /' $< > $@
97+
98+ # Depend on Makefile.global to force rebuild on re-run of configure.
99+ # (But libpq-dist.rc is shipped in the distribution for shell-less
100+ # installations and is only updated by distprep.)
101+ libpq.rc :$(top_builddir ) /src/Makefile.global
98102
99103fe-connect.o : fe-connect.c$(top_builddir ) /src/port/pg_config_paths.h
100104
@@ -114,9 +118,9 @@ uninstall: uninstall-lib
114118rm -f' $(DESTDIR)$(includedir)/libpq-fe.h' ' $(DESTDIR)$(includedir_internal)/libpq-int.h' ' $(DESTDIR)$(includedir_internal)/pqexpbuffer.h' ' $(DESTDIR)$(datadir)/pg_service.conf.sample'
115119
116120clean distclean : clean-lib
117- rm -f$(OBJS ) pg_config_paths.h crypt.c getaddrinfo.c inet_aton.c noblock.c open.c pgstrcasecmp.c snprintf.c strerror.c strlcpy.c thread.c md5.c ip.c encnames.c wchar.c win32error.c pgsleep.c pthread.h
121+ rm -f$(OBJS ) pg_config_paths.h crypt.c getaddrinfo.c inet_aton.c noblock.c open.c pgstrcasecmp.c snprintf.c strerror.c strlcpy.c thread.c md5.c ip.c encnames.c wchar.c win32error.c pgsleep.c pthread.h libpq.rc
118122# Might be left over from a Win32 client-only build
119123rm -f pg_config_paths.h
120124
121125maintainer-clean : distclean maintainer-clean-lib
122- rm -f$(srcdir ) /libpq.rc
126+ rm -f$(srcdir ) /libpq-dist .rc