Consistently use "superuser" instead of "super user"
[pgsql.git] / src / makefiles / Makefile.win32
blobe72cb2db0e5c1725854fae59ebc8dab246ee7048
1 # src/makefiles/Makefile.win32
3 ifdef PGXS
4 BE_DLLLIBS= -L$(libdir) -lpostgres
5 override CPPFLAGS+= -I$(includedir_server)/port/win32
6 else
7 BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres
8 override CPPFLAGS+="-I$(top_srcdir)/src/include/port/win32"
9 endif
11 override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
13 AROPT = crs
14 DLSUFFIX = .dll
16 ifneq (,$(findstring backend,$(subdir)))
17 ifeq (,$(findstring conversion_procs,$(subdir)))
18 ifeq (,$(findstring libpqwalreceiver,$(subdir)))
19 ifeq (,$(findstring replication/pgoutput,$(subdir)))
20 ifeq (,$(findstring snowball,$(subdir)))
21 override CPPFLAGS+= -DBUILDING_DLL
22 endif
23 endif
24 endif
25 endif
26 endif
28 ifneq (,$(findstring src/common,$(subdir)))
29 override CPPFLAGS+= -DBUILDING_DLL
30 endif
32 ifneq (,$(findstring src/port,$(subdir)))
33 override CPPFLAGS+= -DBUILDING_DLL
34 endif
36 ifneq (,$(findstring timezone,$(subdir)))
37 override CPPFLAGS+= -DBUILDING_DLL
38 endif
40 ifneq (,$(findstring ecpg/ecpglib,$(subdir)))
41 override CPPFLAGS+= -DBUILDING_DLL
42 endif
44 # required by Python headers
45 ifneq (,$(findstring src/pl/plpython,$(subdir)))
46 override CPPFLAGS+= -DUSE_DL_IMPORT
47 endif
49 # it is better to install shared-libraries anyway?
50 # may be overridden with make MAKE_DLL=false install
51 ifndef MAKE_DLL
52 MAKE_DLL        = true
53 endif
56 # Build rules to add versioninfo resources to win32 binaries
58 WIN32RES += win32ver.o
59 PGFTYPE = $(if $(shlib),VFT_DLL,VFT_APP)
60 ifneq (,$(PGAPPICON))
61 PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
62 endif
64 # We do not install src/port/win32ver.rc, its content being specific to
65 # PostgreSQL Global Development Group software.  Any module can ship a
66 # win32ver.rc or furnish a rule for generating one.  Set $(PGFILEDESC) to
67 # signal win32ver.rc availability to the dll build rule below.
68 ifndef PGXS
69 win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
70         sed -e 's;FILEDESC;$(PGFILEDESC);' \
71             -e 's;VFT_APP;$(PGFTYPE);' \
72             -e 's;_ICO_;$(PGICOSTR);' \
73             -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' \
74             -e '/_INTERNAL_NAME_/$(if $(shlib),s;_INTERNAL_NAME_;"$(basename $(shlib))";,d)' \
75             -e '/_ORIGINAL_NAME_/$(if $(shlib),s;_ORIGINAL_NAME_;"$(shlib)";,d)' \
76           $< >$@
78 # Depend on Makefile.global to force rebuild on re-run of configure.
79 win32ver.rc: $(top_builddir)/src/Makefile.global
80 endif
82 win32ver.o: win32ver.rc
83         $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
85 # Rule for building a shared library from a single .o file
86 %.dll: %.o $(if $(PGFILEDESC),$(WIN32RES))
87         $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)