2010-09-20 16:08:53 -04:00
|
|
|
# src/makefiles/Makefile.win32
|
2003-05-15 12:35:30 -04:00
|
|
|
|
2004-12-16 22:52:49 -05:00
|
|
|
ifdef PGXS
|
2006-01-19 15:45:29 -05:00
|
|
|
BE_DLLLIBS= -L$(libdir) -lpostgres
|
2015-07-30 20:48:46 -04:00
|
|
|
override CPPFLAGS+= -I$(includedir_server)/port/win32
|
2004-12-16 22:52:49 -05:00
|
|
|
else
|
2001-04-04 17:15:56 -04:00
|
|
|
BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
|
2015-07-30 20:48:46 -04:00
|
|
|
override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
|
2004-12-16 22:52:49 -05:00
|
|
|
endif
|
2002-09-05 14:28:46 -04:00
|
|
|
|
2019-04-09 11:25:39 -04:00
|
|
|
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
|
|
|
|
|
|
2000-10-21 18:36:14 -04:00
|
|
|
AROPT = crs
|
|
|
|
|
DLSUFFIX = .dll
|
|
|
|
|
|
2002-09-05 14:28:46 -04:00
|
|
|
ifneq (,$(findstring backend,$(subdir)))
|
|
|
|
|
ifeq (,$(findstring conversion_procs,$(subdir)))
|
2010-01-20 04:30:07 -05:00
|
|
|
ifeq (,$(findstring libpqwalreceiver,$(subdir)))
|
2017-01-20 12:51:31 -05:00
|
|
|
ifeq (,$(findstring replication/pgoutput,$(subdir)))
|
|
|
|
|
ifeq (,$(findstring snowball,$(subdir)))
|
2002-09-05 14:28:46 -04:00
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
1999-03-09 08:39:15 -05:00
|
|
|
endif
|
2001-05-03 12:07:52 -04:00
|
|
|
endif
|
2007-08-21 09:32:33 -04:00
|
|
|
endif
|
2010-01-15 16:43:21 -05:00
|
|
|
endif
|
2017-01-20 12:51:31 -05:00
|
|
|
endif
|
2001-05-25 10:28:58 -04:00
|
|
|
|
2013-02-22 09:51:15 -05:00
|
|
|
ifneq (,$(findstring src/common,$(subdir)))
|
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
|
endif
|
|
|
|
|
|
2014-06-11 19:50:41 -04:00
|
|
|
ifneq (,$(findstring src/port,$(subdir)))
|
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
|
endif
|
|
|
|
|
|
2004-10-22 18:33:58 -04:00
|
|
|
ifneq (,$(findstring timezone,$(subdir)))
|
|
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
|
|
|
|
endif
|
|
|
|
|
|
2004-10-27 15:14:07 -04:00
|
|
|
ifneq (,$(findstring ecpg/ecpglib,$(subdir)))
|
2002-09-05 14:28:46 -04:00
|
|
|
override CPPFLAGS+= -DBUILDING_DLL
|
2001-09-05 22:58:33 -04:00
|
|
|
endif
|
|
|
|
|
|
2002-09-05 14:28:46 -04:00
|
|
|
# required by Python headers
|
|
|
|
|
ifneq (,$(findstring src/pl/plpython,$(subdir)))
|
2001-05-25 11:48:33 -04:00
|
|
|
override CPPFLAGS+= -DUSE_DL_IMPORT
|
|
|
|
|
endif
|
2004-11-17 12:16:17 -05:00
|
|
|
|
|
|
|
|
# it is better to install shared-libraries anyway?
|
2016-01-28 02:47:36 -05:00
|
|
|
# may be overridden with make MAKE_DLL=false install
|
2004-11-17 12:16:17 -05:00
|
|
|
ifndef MAKE_DLL
|
|
|
|
|
MAKE_DLL = true
|
|
|
|
|
endif
|
2008-12-07 03:36:22 -05: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
|
|
|
|
|
|
2015-08-05 20:43:07 -04:00
|
|
|
# We do not install src/port/win32ver.rc, its content being specific to
|
|
|
|
|
# PostgreSQL Global Development Group software. Any module can ship a
|
|
|
|
|
# win32ver.rc or furnish a rule for generating one. Set $(PGFILEDESC) to
|
|
|
|
|
# signal win32ver.rc availability to the dll build rule below.
|
|
|
|
|
ifndef PGXS
|
2008-12-07 03:36:22 -05:00
|
|
|
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*//'`';' $< >$@
|
2015-08-05 20:43:07 -04:00
|
|
|
endif
|
2008-12-07 03:36:22 -05:00
|
|
|
|
|
|
|
|
win32ver.o: win32ver.rc
|
2009-01-05 04:27:20 -05:00
|
|
|
$(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
|
2010-07-05 14:54:38 -04:00
|
|
|
|
|
|
|
|
# Rule for building a shared library from a single .o file
|
2015-08-05 20:43:07 -04:00
|
|
|
%.dll: %.o $(if $(PGFILEDESC),$(WIN32RES))
|
2014-10-21 22:55:47 -04:00
|
|
|
$(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)
|