Fix Borland makefile for libpq and improve it for psql.

Reorder MSC makefile to be more consistent and easier to maintain.
This commit is contained in:
Bruce Momjian 2005-04-29 04:21:39 +00:00
parent 115119e179
commit 95cb42b968
3 changed files with 97 additions and 61 deletions

View File

@ -1,4 +1,5 @@
# Makefile for Borland C++ 5.5
# Borland C++ base install directory goes here
# BCB=d:\Borland\Bcc55
@ -147,22 +148,50 @@ LINK32_OBJS= \
path.obj \
pgstrcasecmp.obj \
sprompt.obj \
!IFDEF DEBUG
"..\..\interfaces\libpq\Debug\libpqddll.lib"
!ELSE
"..\..\interfaces\libpq\Release\libpqdll.lib"
!ENDIF
"$(OUTDIR)\psql.exe" : "$(OUTDIR)" $(LINK32_OBJS)
$(LINK32) @&&!
$(LINK32_FLAGS) +
c0x32.obj $(LINK32_OBJS), +
$@,, +
import32.lib $(LIBRARIES),,
import32.lib $(LIBRARIES)
!
exec.obj : "$(OUTDIR)" ..\..\port\exec.c
getopt.obj : "$(OUTDIR)" ..\..\port\getopt.c
getopt_long.obj : "$(OUTDIR)" ..\..\port\getopt_long.c
path.obj : "$(OUTDIR)" ..\..\port\path.c
pgstrcasecmp.obj : "$(OUTDIR)" ..\..\port\pgstrcasecmp.c
sprompt.obj : "$(OUTDIR)" ..\..\port\sprompt.c
"$(INTDIR)\exec.obj" : ..\..\port\exec.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\exec.c
<<
"$(OUTDIR)\getopt.obj" : "$(OUTDIR)" ..\..\port\getopt.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\getopt.c
<<
"$(OUTDIR)\getopt_long.obj" : "$(OUTDIR)" ..\..\port\getopt_long.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\getopt_long.c
<<
"$(OUTDIR)\path.obj" : "$(OUTDIR)" ..\..\port\path.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\path.c
<<
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
<<
"$(OUTDIR)\sprompt.obj" : "$(OUTDIR)" ..\..\port\sprompt.c
$(CPP) @<<
$(CPP_PROJ) ..\..\port\sprompt.c
<<
"sql_help.h": create_help.pl
$(PERL) create_help.pl $(REFDOCDIR) $@

View File

@ -146,18 +146,15 @@ LINK32_OBJS= \
$(CPP_PROJ) ..\..\port\sprompt.c
<<
.c{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
sql_help.h : create_help.pl
$(PERL) create_help.pl $(REFDOCDIR) $@
psqlscan.c: psqlscan.l
$(FLEX) -Cfe -opsqlscan.c psqlscan.l
.c{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<

View File

@ -4,7 +4,17 @@
# and a Win32 dynamic library libpq.dll with import library libpqdll.lib
# Borland C++ base install directory goes here
# BCB=d:\Borland\Bcc55
# BCB=c:\Borland\Bcc55
!IF "$(BCB)" == ""
!MESSAGE You must edit bcc32.mak and define BCB at the top
!ERROR misssing BCB
!ENDIF
!IF "$(__NMAKE__)" == ""
!MESSAGE You must use the -N compatibility flag, e.g. make -N -f bcc32.make
!ERROR missing -N
!ENDIF
!MESSAGE Building the Win32 DLL and Static Library...
!MESSAGE
@ -22,7 +32,7 @@ CFG=Release
!MESSAGE You can specify a configuration when running MAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE make -DCFG=[Release | Debug] /f bcc32.mak
!MESSAGE make -N -DCFG=[Release | Debug] -f bcc32.mak
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
@ -52,7 +62,7 @@ OUTFILENAME=blibpq
USERDEFINES=FRONTEND;NDEBUG;WIN32;_WINDOWS;HAVE_VSNPRINTF;HAVE_STRDUP;
CPP=bcc32.exe
CPP_PROJ = -I$(BCB)\include;..\..\include -WD -c -D$(USERDEFINES) -tWM \
CPP_PROJ = -I$(BCB)\include;..\..\include -n"$(INTDIR)" -WD -c -D$(USERDEFINES) -tWM \
-a8 -X -w-use -w-par -w-pia -w-csu -w-aus -w-ccc
!IFDEF DEBUG
@ -61,6 +71,8 @@ CPP_PROJ = $(CPP_PROJ) -Od -r- -k -v -y -vi- -D_DEBUG
CPP_PROJ = $(CPP_PROJ) -O -Oi -OS -DNDEBUG
!endif
ALL : config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib"
CLEAN :
-@erase "$(INTDIR)\getaddrinfo.obj"
-@erase "$(INTDIR)\pgstrcasecmp.obj"
@ -93,6 +105,7 @@ CLEAN :
-@erase "$(OUTDIR)\$(OUTFILENAME).tds"
-@erase "$(INTDIR)\pg_config_paths.h"
LIB32=tlib.exe
LIB32_FLAGS=
LIB32_OBJS= \
@ -121,15 +134,6 @@ LIB32_OBJS= \
"$(INTDIR)\pthread-win32.obj"
RSC=brcc32.exe
RSC_PROJ=-l 0x409 -i$(BCB)\include -fo"$(INTDIR)\libpq.res"
LINK32=ilink32.exe
LINK32_FLAGS = -Gn -L$(BCB)\lib;$(INTDIR); -x -Tpd -v
LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
ALL: config "$(OUTDIR)" "$(OUTDIR)\blibpq.dll" "$(OUTDIR)\blibpq.lib"
config: ..\..\include\pg_config.h pthread.h pg_config_paths.h
..\..\include\pg_config.h: ..\..\include\pg_config.h.win32
@ -138,85 +142,91 @@ config: ..\..\include\pg_config.h pthread.h pg_config_paths.h
pthread.h: pthread.h.win32
copy pthread.h.win32 pthread.h
pg_config_paths.h: win32.mak
echo #define SYSCONFDIR "" > pg_config_paths.h
pg_config_paths.h: bcc32.mak
echo \#define SYSCONFDIR "" > pg_config_paths.h
"$(OUTDIR)" :
@if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
/* @&&! is a Response file, http://users.deltacomm.com/edmulroy/howto8.htm */
RSC=brcc32.exe
RSC_PROJ=-l 0x409 -i$(BCB)\include -fo"$(INTDIR)\libpq.res"
LINK32=ilink32.exe
LINK32_FLAGS = -Gn -L$(BCB)\lib;$(INTDIR); -x -Tpd -v
LINK32_OBJS= "$(INTDIR)\libpqdll.obj"
# @<< is a Response file, http://www.opussoftware.com/tutorial/TutMakefile.htm
"$(OUTDIR)\blibpq.dll": "$(OUTDIR)\blibpq.lib" $(LINK32_OBJS) "$(INTDIR)\libpq.res" blibpqdll.def
$(LINK32) @&&!
$(LINK32) @<<
$(LINK32_FLAGS) +
c0d32.obj $(LINK32_OBJS), +
$@,, +
"$(OUTDIR)\blibpq.lib" import32.lib cw32mti.lib, +
blibpqdll.def,"$(INTDIR)\libpq.res"
!
<<
implib -w "$(OUTDIR)\blibpqdll.lib" blibpqdll.def $@
"$(INTDIR)\libpq.res" : "$(INTDIR)" libpq.rc
$(RSC) $(RSC_PROJ) libpq.rc
"$(OUTDIR)\blibpq.lib": $(LIB32_OBJS)
$(LIB32) $@ @&&!
$(LIB32) $@ @<<
+-"$(**: =" &^
+-")"
!
<<
"$(INTDIR)\getaddrinfo.obj" : ..\..\port\getaddrinfo.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\getaddrinfo.c
!
<<
"$(INTDIR)\pgstrcasecmp.obj" : ..\..\port\pgstrcasecmp.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\pgstrcasecmp.c
!
<<
"$(INTDIR)\thread.obj" : ..\..\port\thread.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\thread.c
!
<<
"$(INTDIR)\inet_aton.obj" : ..\..\port\inet_aton.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\inet_aton.c
!
<<
"$(INTDIR)\crypt.obj" : ..\..\port\crypt.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\crypt.c
!
<<
"$(INTDIR)\noblock.obj" : ..\..\port\noblock.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\port\noblock.c
!
<<
"$(INTDIR)\md5.obj" : ..\..\backend\libpq\md5.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\md5.c
!
<<
"$(INTDIR)\ip.obj" : ..\..\backend\libpq\ip.c
$(CPP) @&&!
$(CPP) @<<
$(CPP_PROJ) ..\..\backend\libpq\ip.c
!
<<
"$(INTDIR)\wchar.obj" : ..\..\backend\utils\mb\wchar.c
$(CPP) @&&!
$(CPP_PROJ) /I "." ..\..\backend\utils\mb\wchar.c
!
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\wchar.c
<<
"$(INTDIR)\encnames.obj" : ..\..\backend\utils\mb\encnames.c
$(CPP) @&&!
$(CPP_PROJ) /I "." ..\..\backend\utils\mb\encnames.c
!
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
<<
.c.obj:
$(CPP) -o"$(INTDIR)\$&" $(CPP_PROJ) $<
$(CPP) $(CPP_PROJ) $<