diff options
| author | Bruce Momjian <bruce@momjian.us> | 1999-01-17 06:20:06 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1999-01-17 06:20:06 +0000 |
| commit | 7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1 (patch) | |
| tree | 1e24049a7bedd03a13776dc131e808ae97eca197 /src/backend/Makefile | |
| parent | 298682d9e0b0ec55d5f72cec1f4d43c23f2a1ac6 (diff) | |
| download | postgresql-7a6b562fdf60f1d1ebe9e2bc154d0ffd56dab2d1.tar.gz | |
Apply Win32 patch from Horak Daniel.
Diffstat (limited to 'src/backend/Makefile')
| -rw-r--r-- | src/backend/Makefile | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile index 9410ab8ce3..87e4b75c1d 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -34,7 +34,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.34 1998/11/27 19:51:27 vadim Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.35 1999/01/17 06:18:11 momjian Exp $ # #------------------------------------------------------------------------- @@ -58,12 +58,34 @@ CFLAGS+= $(KRBFLAGS) LDFLAGS+= $(KRBLIBS) endif +ifeq ($(MAKE_DLL), true) +DLLOBJS=$(OBJS) +DLLOBJS+= ../utils/version.o +DLLLIBS= -L/usr/local/lib -lcygipc -lcrypt -lcygwin -lkernel32 + +postgres.def: $(DLLOBJS) + $(DLLTOOL) --export-all --output-def $@ $(DLLOBJS) + +libpostgres.a: $(DLLOBJS) ../utils/dllinit.o postgres.def + $(DLLTOOL) --dllname postgres.exe --def postgres.def --output-lib $@ +endif all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source \ global1.description local1_template1.description +ifneq ($(PORTNAME), win) postgres: fmgr.h $(OBJS) ../utils/version.o $(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS) +else +postgres: $(DLLOBJS) ../utils/dllinit.o postgres.def libpostgres.a + dlltool --dllname $@$(X) --output-exp $@.exp --def postgres.def + gcc -g -o $@$(X) -Wl,--base-file,$@.base $@.exp $(DLLOBJS) $(DLLLIBS) + dlltool --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def + gcc -g -o $@$(X) $@.exp $(DLLOBJS) $(DLLLIBS) + rm $@.exp $@.base +endif + +#.PHONY: postgres $(OBJS): $(DIRS:%=%.dir) @@ -71,7 +93,10 @@ $(DIRS:%=%.dir): $(MAKE) -C $(subst .dir,,$@) all ../utils/version.o: - $(MAKE) -C ../utils version.o + $(MAKE) -C ../utils version.o + +../utils/dllinit.c: + $(MAKE) -C ../utils dllinit.o global1.bki.source local1_template1.bki.source \ global1.description local1_template1.description: catalog/$@ @@ -89,7 +114,6 @@ postgres.o: $(OBJS) fast: $(CC) -r -o postgres.o $(OBJS) $(LDFLAGS) - ############################################################################ # The following targets are specified in make commands that appear in the # make files in our subdirectories. @@ -104,9 +128,14 @@ fmgr.h: ############################################################################# clean: - rm -f postgres $(POSTGRES_IMP) fmgr.h parse.h \ + rm -f postgres$(X) $(POSTGRES_IMP) fmgr.h parse.h \ global1.bki.source local1_template1.bki.source \ global1.description local1_template1.description +ifeq ($(PORTNAME), win) +ifeq ($(MAKE_DLL), true) + rm -f postgres.dll postgres.def libpostgres.a +endif +endif for i in $(DIRS); do $(MAKE) -C $$i clean; done .DEFAULT: @@ -132,12 +161,18 @@ install: $(LIBDIR) $(BINDIR) $(HEADERDIR) postgres $(POSTGRES_IMP) fmgr.h\ global1.bki.source local1_template1.bki.source \ global1.description local1_template1.description \ libpq/pg_hba.conf.sample optimizer/geqo/pg_geqo.sample - $(INSTALL) $(INSTL_EXE_OPTS) postgres $(BINDIR)/postgres + $(INSTALL) $(INSTL_EXE_OPTS) postgres$(X) $(BINDIR)/postgres$(X) ifeq ($(MAKE_EXPORTS), true) $(INSTALL) $(INSTLOPTS) $(POSTGRES_IMP) $(LIBDIR)/$(POSTGRES_IMP) endif @rm -f $(BINDIR)/postmaster - ln -s postgres $(BINDIR)/postmaster + ln -s postgres$(X) $(BINDIR)/postmaster +ifeq ($(PORTNAME), win) +ifeq ($(MAKE_DLL), true) +# $(INSTALL) $(INSTLOPTS) postgres.dll $(BINDIR)/postgres.dll + $(INSTALL) $(INSTLOPTS) libpostgres.a $(LIBDIR)/libpostgres.a +endif +endif $(INSTALL) $(INSTLOPTS) fmgr.h $(HEADERDIR)/fmgr.h $(INSTALL) $(INSTLOPTS) global1.bki.source \ $(LIBDIR)/global1.bki.source @@ -152,7 +187,13 @@ endif $(INSTALL) $(INSTLOPTS) optimizer/geqo/pg_geqo.sample \ $(LIBDIR)/pg_geqo.sample -$(BINDIR) $(LIBDIR) $(HEADERDIR): +#$(BINDIR) $(LIBDIR) $(HEADERDIR): +# mkdir $@ +$(BINDIR): + mkdir $@ +$(LIBDIR): + mkdir $@ +$(HEADERDIR): mkdir $@ ############################################################################# |
