2010-09-20 22:08:53 +02:00
|
|
|
# src/makefiles/Makefile.win32
|
2003-05-15 18:35:30 +02:00
|
|
|
|
2004-12-17 04:52:49 +01:00
|
|
|
ifdef PGXS
|
2006-01-19 21:45:29 +01:00
|
|
|
BE_DLLLIBS= -L$(libdir) -lpostgres
|
2015-07-31 02:48:46 +02:00
|
|
|
override CPPFLAGS+= -I$(includedir_server)/port/win32
|
2004-12-17 04:52:49 +01:00
|
|
|
else
|
2001-04-04 23:15:56 +02:00
|
|
|
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
|
2015-07-31 02:48:46 +02:00
|
|
|
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
|
2004-12-17 04:52:49 +01:00
|
|
|
endif
|
2002-09-05 20:28:46 +02:00
|
|
|
|
2000-10-22 00:36:14 +02:00
|
|
|
AROPT = crs
|
|
|
|
DLSUFFIX = .dll
|
|
|
|
CFLAGS_SL =
|
|
|
|
|
2002-09-05 20:28:46 +02:00
|
|
|
ifneq (,$(findstring backend,$(subdir)))
|
|
|
|
ifeq (,$(findstring conversion_procs,$(subdir)))
|
2007-08-21 15:32:33 +02:00
|
|
|
ifeq (,$(findstring snowball,$(subdir)))
|
2010-01-20 10:30:07 +01:00
|
|
|
ifeq (,$(findstring libpqwalreceiver,$(subdir)))
|
2002-09-05 20:28:46 +02:00
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
1999-03-09 14:39:15 +01:00
|
|
|
endif
|
2001-05-03 18:07:52 +02:00
|
|
|
endif
|
2007-08-21 15:32:33 +02:00
|
|
|
endif
|
2010-01-15 22:43:21 +01:00
|
|
|
endif
|
2001-05-25 16:28:58 +02:00
|
|
|
|
2013-02-22 15:51:15 +01:00
|
|
|
ifneq (,$(findstring src/common,$(subdir)))
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
endif
|
|
|
|
|
2014-06-12 01:50:41 +02:00
|
|
|
ifneq (,$(findstring src/port,$(subdir)))
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
endif
|
|
|
|
|
2004-10-23 00:33:58 +02:00
|
|
|
ifneq (,$(findstring timezone,$(subdir)))
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
endif
|
|
|
|
|
2004-10-27 21:14:07 +02:00
|
|
|
ifneq (,$(findstring ecpg/ecpglib,$(subdir)))
|
2002-09-05 20:28:46 +02:00
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
2001-09-06 04:58:33 +02:00
|
|
|
endif
|
|
|
|
|
2002-09-05 20:28:46 +02:00
|
|
|
# required by Python headers
|
|
|
|
ifneq (,$(findstring src/pl/plpython,$(subdir)))
|
2001-05-25 17:48:33 +02:00
|
|
|
override CPPFLAGS+= -DUSE_DL_IMPORT
|
|
|
|
endif
|
2004-11-17 18:16:17 +01:00
|
|
|
|
|
|
|
# it is better to install shared-libraries anyway?
|
|
|
|
# may be overriden with make MAKE_DLL=false install
|
|
|
|
ifndef MAKE_DLL
|
|
|
|
MAKE_DLL = true
|
|
|
|
endif
|
2008-12-07 09:36:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Build rules to add versioninfo resources to win32 binaries
|
|
|
|
|
|
|
|
WIN32RES += win32ver.o
|
|
|
|
ifeq ($(PGFILESHLIB),1)
|
|
|
|
PGFTYPE = VFT_DLL
|
|
|
|
else
|
|
|
|
PGFTYPE = VFT_APP
|
|
|
|
endif
|
|
|
|
ifneq (,$(PGAPPICON))
|
|
|
|
PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
|
|
|
|
endif
|
|
|
|
|
|
|
|
win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
|
|
|
|
sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $< >$@
|
|
|
|
|
|
|
|
win32ver.o: win32ver.rc
|
2009-01-05 10:27:20 +01:00
|
|
|
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
|
2010-07-05 20:54:38 +02:00
|
|
|
|
|
|
|
# Rule for building a shared library from a single .o file
|
2014-07-14 20:07:52 +02:00
|
|
|
%.dll: %.o $(WIN32RES)
|
2014-10-22 04:55:47 +02:00
|
|
|
$(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)
|