diff --git a/src/bin/psql/bcc32.mak b/src/bin/psql/bcc32.mak
index 46b07452a6a1aa7b80bd4e7c5b4818ca47088210..18012a4773f38b30536a06db6ba36b193508391f 100644
--- a/src/bin/psql/bcc32.mak
+++ b/src/bin/psql/bcc32.mak
@@ -53,7 +53,7 @@ REFDOCDIR=../../../doc/src/sgml/ref
 .c.obj:
 	$(CPP) -o"$(INTDIR)\$&" $(CPP_PROJ) $<
 
-ALL : sql_help.h pg_config_paths.h "$(OUTDIR)\psql.exe"
+ALL : sql_help.h "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
 
 CLEAN :
 	-@erase "$(INTDIR)\command.obj"
@@ -81,9 +81,9 @@ CLEAN :
 	-@erase "$(INTDIR)\psql.ils"
 	-@erase "$(INTDIR)\psql.ilf"
 	-@erase "$(OUTDIR)\psql.exe"
-	-@erase "$(INTDIR)\pg_config_paths.h"
+	-@erase "$(INTDIR)\..\..\port\pg_config_paths.h"
 
-pg_config_paths.h: win32.mak
+"..\..\port\pg_config_paths.h": win32.mak
 	echo "#define PGBINDIR "">$@
 	echo "#define PGSHAREDIR "" >>$@
 	echo "#define SYSCONFDIR "" >>$@
diff --git a/src/bin/psql/win32.mak b/src/bin/psql/win32.mak
index 3498a11c5d7c968c6964c76c3cc03d26b18af8a9..f5091c020e09b083f2606fc26d700f42bb843a7a 100644
--- a/src/bin/psql/win32.mak
+++ b/src/bin/psql/win32.mak
@@ -16,7 +16,7 @@ REFDOCDIR= ../../../doc/src/sgml/ref
 OutDir=.\Release
 # End Custom Macros
 
-ALL : sql_help.h pg_config_paths.h "$(OUTDIR)\psql.exe"
+ALL : sql_help.h "..\..\port\pg_config_paths.h" "$(OUTDIR)\psql.exe"
 
 CLEAN :
 	-@erase "$(INTDIR)\command.obj"
@@ -41,9 +41,9 @@ CLEAN :
 	-@erase "$(INTDIR)\mbprint.obj"
 	-@erase "$(INTDIR)\*psql.pch"
 	-@erase "$(OUTDIR)\psql.exe"
-	-@erase "$(INTDIR)\pg_config_paths.h"
+	-@erase "$(INTDIR)\..\..\port\pg_config_paths.h"
 
-pg_config_paths.h: win32.mak
+"..\..\port\pg_config_paths.h": win32.mak
 	echo "#define PGBINDIR "">$@
 	echo "#define PGSHAREDIR "" >>$@
 	echo "#define SYSCONFDIR "" >>$@