Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f04c394

Browse files
committed
Attached is a makefile I hacked up to build pg_config under MSVC - the
reason is that it's required (more or less) in order to build the latest DBD::Pg code and I was testing that out under MSVC. Andrew Dunstan
1 parent 954f6bc commit f04c394

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed

src/bin/pg_config/win32.mak

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Makefile for Microsoft Visual C++ 5.0 (or compat)
2+
3+
!IF "$(OS)" == "Windows_NT"
4+
NULL=
5+
!ELSE
6+
NULL=nul
7+
!ENDIF
8+
9+
CPP=cl.exe
10+
11+
!IFDEF DEBUG
12+
OPT=/Od /Zi /MDd
13+
LOPT=/DEBUG
14+
DEBUGDEF=/D _DEBUG
15+
OUTDIR=.\Debug
16+
INTDIR=.\Debug
17+
!ELSE
18+
OPT=/O2 /MD
19+
LOPT=
20+
DEBUGDEF=/D NDEBUG
21+
OUTDIR=.\Release
22+
INTDIR=.\Release
23+
!ENDIF
24+
25+
ALL : "..\..\port\pg_config_paths.h" "$(OUTDIR)\pg_config.exe"
26+
27+
CLEAN :
28+
-@erase "$(INTDIR)\pg_config.obj"
29+
-@erase "$(OUTDIR)\pg_config.exe"
30+
-@erase "$(INTDIR)\..\..\port\pg_config_paths.h"
31+
32+
"..\..\port\pg_config_paths.h": win32.mak
33+
echo #define PGBINDIR "" >$@
34+
echo #define PGSHAREDIR "" >>$@
35+
echo #define SYSCONFDIR "" >>$@
36+
echo #define INCLUDEDIR "" >>$@
37+
echo #define PKGINCLUDEDIR "" >>$@
38+
echo #define INCLUDEDIRSERVER "" >>$@
39+
echo #define LIBDIR "" >>$@
40+
echo #define PKGLIBDIR "" >>$@
41+
echo #define LOCALEDIR "" >>$@
42+
43+
"$(OUTDIR)" :
44+
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
45+
46+
CPP_PROJ=/nologo $(OPT) /W3 /GX /D "WIN32" $(DEBUGDEF) /D "_CONSOLE" /D\
47+
"_MBCS" /Fp"$(INTDIR)\pg_config.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
48+
/I ..\..\include /I ..\..\interfaces\libpq /I ..\..\include\port\win32 \
49+
/D "HAVE_STRDUP" /D "FRONTEND" /D VAL_CONFIGURE="\"\""
50+
51+
CPP_OBJS=$(INTDIR)/
52+
CPP_SBRS=.
53+
54+
LINK32=link.exe
55+
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
56+
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
57+
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no\
58+
/pdb:"$(OUTDIR)\pg_config.pdb" /machine:I386 $(LOPT) /out:"$(OUTDIR)\pg_config.exe"
59+
LINK32_OBJS= \
60+
"$(INTDIR)\pg_config.obj" \
61+
"$(INTDIR)\pgstrcasecmp.obj" \
62+
"$(OUTDIR)\path.obj" \
63+
"$(INTDIR)\exec.obj" \
64+
!IFDEF DEBUG
65+
"..\..\interfaces\libpq\Debug\libpqddll.lib"
66+
!ELSE
67+
"..\..\interfaces\libpq\Release\libpqdll.lib"
68+
!ENDIF
69+
70+
"$(OUTDIR)\pg_config.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
71+
$(LINK32) @<<
72+
$(LINK32_FLAGS) $(LINK32_OBJS)
73+
<<
74+
75+
"$(OUTDIR)\path.obj" : "$(OUTDIR)" ..\..\port\path.c
76+
$(CPP) @<<
77+
$(CPP_PROJ) ..\..\port\path.c
78+
<<
79+
80+
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
81+
$(CPP) @<<
82+
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
83+
<<
84+
85+
"$(INTDIR)\exec.obj" : ..\..\port\exec.c
86+
$(CPP) @<<
87+
$(CPP_PROJ) ..\..\port\exec.c
88+
<<
89+
90+
.c{$(CPP_OBJS)}.obj::
91+
$(CPP) @<<
92+
$(CPP_PROJ) $<
93+
<<
94+
95+
.cpp{$(CPP_OBJS)}.obj::
96+
$(CPP) @<<
97+
$(CPP_PROJ) $<
98+
<<
99+

src/win32.mak

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/win32.mak,v 1.9 2003/11/29 19:51:39 pgsql Exp $
1+
# $PostgreSQL: pgsql/src/win32.mak,v 1.10 2005/06/14 17:50:37 momjian Exp $
22

33
# Makefile for Microsoft Visual C++ 5.0 (or compat)
44
# Top-file makefile for Win32 parts of postgresql.
@@ -18,6 +18,8 @@ ALL:
1818
nmake /f win32.mak $(MAKEMACRO)
1919
cd ..\..\bin\psql
2020
nmake /f win32.mak $(MAKEMACRO)
21+
cd ..\..\bin\pg_config
22+
nmake /f win32.mak $(MAKEMACRO)
2123
cd ..\..
2224
echo All Win32 parts have been built!
2325

@@ -26,6 +28,8 @@ CLEAN:
2628
nmake /f win32.mak CLEAN
2729
cd ..\..\bin\psql
2830
nmake /f win32.mak CLEAN
31+
cd ..\..\bin\pg_config
32+
nmake /f win32.mak CLEAN
2933
cd ..\..
3034
echo All Win32 parts have been cleaned!
3135

0 commit comments

Comments
 (0)