3434#
3535#
3636# IDENTIFICATION
37- # $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.42 1999/12/16 01:25:00 momjian Exp $
37+ # $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.43 2000/02/27 01:26:12 tgl Exp $
3838#
3939# -------------------------------------------------------------------------
4040
4141SRCDIR = ..
42- include .. /Makefile.global
42+ include $( SRCDIR ) /Makefile.global
4343
4444DIRS = access bootstrap catalog commands executor lib libpq\
4545main parser nodes optimizer port postmaster regex rewrite\
@@ -55,6 +55,8 @@ ifeq ($(PORTNAME), qnx4)
5555OBJS1 = bootstrap/bootstrap.o
5656endif
5757
58+ VERSIONOBJ =$(SRCDIR ) /utils/version.o
59+
5860# kerberos flags
5961
6062ifdef KRBVERS
@@ -63,25 +65,24 @@ LDFLAGS+= $(KRBLIBS)
6365endif
6466
6567ifeq ($(MAKE_DLL ) , true)
66- DLLOBJS =$(OBJS )
67- DLLOBJS+ = ../utils/version.o
68+ DLLOBJS =$(OBJS ) $(VERSIONOBJ )
6869DLLLIBS = -L/usr/local/lib -lcygipc -lcrypt -lcygwin -lkernel32
6970
7071postgres.def :$(DLLOBJS )
7172$(DLLTOOL ) --export-all --output-def$@ $(DLLOBJS )
7273
73- libpostgres.a :$(DLLOBJS ) .. /utils/dllinit.o postgres.def
74+ libpostgres.a :$(DLLOBJS ) $( SRCDIR ) /utils/dllinit.o postgres.def
7475$(DLLTOOL ) --dllname postgres.exe --def postgres.def --output-lib$@
7576endif
7677
7778all : postgres$(POSTGRES_IMP ) global1.bki.source local1_template1.bki.source\
7879global1.description local1_template1.description
7980
8081ifneq ($(PORTNAME ) , win)
81- postgres : fmgr.h$(OBJS ) ../utils/version.o
82- $(CC ) -o postgres$(OBJS ) $(OBJS1 ) ../utils/version.o $(LDFLAGS )
82+ postgres : fmgr.h$(OBJS ) $( VERSIONOBJ )
83+ $(CC ) -o postgres$(OBJS ) $(OBJS1 ) $( VERSIONOBJ ) $(LDFLAGS )
8384else
84- postgres :$(DLLOBJS ) .. /utils/dllinit.o postgres.def libpostgres.a
85+ postgres :$(DLLOBJS ) $( SRCDIR ) /utils/dllinit.o postgres.def libpostgres.a
8586dlltool --dllname$@ $(X ) --output-exp$@ .exp --def postgres.def
8687gcc -g -o$@ $(X ) -Wl,--base-file,$@ .base$@ .exp$(DLLOBJS ) $(DLLLIBS )
8788dlltool --dllname$@ $(X ) --base-file$@ .base --output-exp$@ .exp --def postgres.def
@@ -96,11 +97,11 @@ $(OBJS): $(DIRS:%=%.dir)
9697$(DIRS:% =%.dir):
9798$(MAKE) -C $(subst .dir,,$@) all
9899
99- .. /utils/version.o :
100- $(MAKE ) -C.. /utils version.o
100+ $( VERSIONOBJ ) : $( SRCDIR ) /utils/version.c $( SRCDIR ) /include/version.h
101+ $(MAKE ) -C$( SRCDIR ) /utils version.o
101102
102- .. /utils/dllinit.c:
103- $(MAKE ) -C.. /utils dllinit.o
103+ $( SRCDIR ) /utils/dllinit.o : $( SRCDIR ) /utils/dllinit.c
104+ $(MAKE ) -C$( SRCDIR ) /utils dllinit.o
104105
105106global1.bki.source local1_template1.bki.source \
106107global1.description local1_template1.description : catalog/$@