34
34
#
35
35
#
36
36
# IDENTIFICATION
37
- # $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.34 1998/11/27 19:51:27 vadim Exp $
37
+ # $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.35 1999/01/17 06:18:11 momjian Exp $
38
38
#
39
39
# -------------------------------------------------------------------------
40
40
@@ -58,20 +58,45 @@ CFLAGS+= $(KRBFLAGS)
58
58
LDFLAGS+ = $(KRBLIBS )
59
59
endif
60
60
61
+ ifeq ($(MAKE_DLL ) , true)
62
+ DLLOBJS =$(OBJS )
63
+ DLLOBJS+ = ../utils/version.o
64
+ DLLLIBS = -L/usr/local/lib -lcygipc -lcrypt -lcygwin -lkernel32
65
+
66
+ postgres.def : $(DLLOBJS )
67
+ $(DLLTOOL ) --export-all --output-def $@ $(DLLOBJS )
68
+
69
+ libpostgres.a : $(DLLOBJS ) ../utils/dllinit.o postgres.def
70
+ $(DLLTOOL ) --dllname postgres.exe --def postgres.def --output-lib $@
71
+ endif
61
72
62
73
all : postgres $(POSTGRES_IMP ) global1.bki.source local1_template1.bki.source \
63
74
global1.description local1_template1.description
64
75
76
+ ifneq ($(PORTNAME ) , win)
65
77
postgres : fmgr.h $(OBJS ) ../utils/version.o
66
78
$(CC ) -o postgres $(OBJS ) ../utils/version.o $(LDFLAGS )
79
+ else
80
+ postgres : $(DLLOBJS ) ../utils/dllinit.o postgres.def libpostgres.a
81
+ dlltool --dllname $@ $(X ) --output-exp $@ .exp --def postgres.def
82
+ gcc -g -o $@ $(X ) -Wl,--base-file,$@ .base $@ .exp $(DLLOBJS ) $(DLLLIBS )
83
+ dlltool --dllname $@ $(X ) --base-file $@ .base --output-exp $@ .exp --def postgres.def
84
+ gcc -g -o $@ $(X ) $@ .exp $(DLLOBJS ) $(DLLLIBS )
85
+ rm $@ .exp $@ .base
86
+ endif
87
+
88
+ # .PHONY: postgres
67
89
68
90
$(OBJS ) : $(DIRS:%=%.dir )
69
91
70
92
$(DIRS:% =%.dir):
71
93
$(MAKE) -C $(subst .dir,,$@) all
72
94
73
95
../utils/version.o :
74
- $(MAKE ) -C ../utils version.o
96
+ $(MAKE ) -C ../utils version.o
97
+
98
+ ../utils/dllinit.c :
99
+ $(MAKE ) -C ../utils dllinit.o
75
100
76
101
global1.bki.source local1_template1.bki.source \
77
102
global1.description local1_template1.description : catalog/$@
@@ -89,7 +114,6 @@ postgres.o: $(OBJS)
89
114
fast :
90
115
$(CC ) -r -o postgres.o $(OBJS ) $(LDFLAGS )
91
116
92
-
93
117
# ###########################################################################
94
118
# The following targets are specified in make commands that appear in the
95
119
# make files in our subdirectories.
@@ -104,9 +128,14 @@ fmgr.h:
104
128
105
129
# ############################################################################
106
130
clean :
107
- rm -f postgres $(POSTGRES_IMP ) fmgr.h parse.h \
131
+ rm -f postgres$( X ) $(POSTGRES_IMP ) fmgr.h parse.h \
108
132
global1.bki.source local1_template1.bki.source \
109
133
global1.description local1_template1.description
134
+ ifeq ($(PORTNAME ) , win)
135
+ ifeq ($(MAKE_DLL ) , true)
136
+ rm -f postgres.dll postgres.def libpostgres.a
137
+ endif
138
+ endif
110
139
for i in $(DIRS); do $(MAKE) -C $$i clean; done
111
140
112
141
.DEFAULT :
@@ -132,12 +161,18 @@ install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) fmgr.h\
132
161
global1.bki.source local1_template1.bki.source \
133
162
global1.description local1_template1.description \
134
163
libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample
135
- $(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres
164
+ $(INSTALL) $(INSTL_EXE_OPTS) postgres$(X) $(BINDIR)/postgres$(X)
136
165
ifeq ($(MAKE_EXPORTS ) , true)
137
166
$(INSTALL) $(INSTLOPTS) $(POSTGRES_IMP) $(LIBDIR)/$(POSTGRES_IMP)
138
167
endif
139
168
@rm -f $(BINDIR)/postmaster
140
- ln -s postgres $(BINDIR)/postmaster
169
+ ln -s postgres$(X) $(BINDIR)/postmaster
170
+ ifeq ($(PORTNAME ) , win)
171
+ ifeq ($(MAKE_DLL ) , true)
172
+ # $(INSTALL) $(INSTLOPTS) postgres.dll $(BINDIR)/postgres.dll
173
+ $(INSTALL) $(INSTLOPTS) libpostgres.a $(LIBDIR)/libpostgres.a
174
+ endif
175
+ endif
141
176
$(INSTALL) $(INSTLOPTS) fmgr.h $(HEADERDIR)/fmgr.h
142
177
$(INSTALL) $(INSTLOPTS) global1.bki.source \
143
178
$(LIBDIR)/global1.bki.source
@@ -152,7 +187,13 @@ endif
152
187
$(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \
153
188
$(LIBDIR)/pg_geqo.sample
154
189
155
- $(BINDIR ) $(LIBDIR ) $(HEADERDIR ) :
190
+ # $(BINDIR) $(LIBDIR) $(HEADERDIR):
191
+ # mkdir $@
192
+ $(BINDIR ) :
193
+ mkdir $@
194
+ $(LIBDIR ) :
195
+ mkdir $@
196
+ $(HEADERDIR ) :
156
197
mkdir $@
157
198
158
199
# ############################################################################
0 commit comments