]> granicus.if.org Git - postgresql/blob - src/makefiles/Makefile.win32
Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock().
[postgresql] / src / makefiles / Makefile.win32
1 # src/makefiles/Makefile.win32
2
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
10
11 AROPT = crs
12 DLSUFFIX = .dll
13 CFLAGS_SL =
14
15 ifneq (,$(findstring backend,$(subdir)))
16 ifeq (,$(findstring conversion_procs,$(subdir)))
17 ifeq (,$(findstring snowball,$(subdir)))
18 ifeq (,$(findstring libpqwalreceiver,$(subdir)))
19 override CPPFLAGS+= -DBUILDING_DLL
20 endif
21 endif
22 endif
23 endif
24
25 ifneq (,$(findstring src/common,$(subdir)))
26 override CPPFLAGS+= -DBUILDING_DLL
27 endif
28
29 ifneq (,$(findstring src/port,$(subdir)))
30 override CPPFLAGS+= -DBUILDING_DLL
31 endif
32
33 ifneq (,$(findstring timezone,$(subdir)))
34 override CPPFLAGS+= -DBUILDING_DLL
35 endif
36
37 ifneq (,$(findstring ecpg/ecpglib,$(subdir)))
38 override CPPFLAGS+= -DBUILDING_DLL
39 endif
40
41 # required by Python headers
42 ifneq (,$(findstring src/pl/plpython,$(subdir)))
43 override CPPFLAGS+= -DUSE_DL_IMPORT
44 endif
45
46 # it is better to install shared-libraries anyway?
47 # may be overriden with make MAKE_DLL=false install
48 ifndef MAKE_DLL
49 MAKE_DLL        = true
50 endif
51
52
53 # Build rules to add versioninfo resources to win32 binaries
54
55 WIN32RES += win32ver.o
56 ifeq ($(PGFILESHLIB),1)
57 PGFTYPE = VFT_DLL
58 else
59 PGFTYPE = VFT_APP
60 endif
61 ifneq (,$(PGAPPICON))
62 PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\")
63 endif
64
65 # We do not install src/port/win32ver.rc, its content being specific to
66 # PostgreSQL Global Development Group software.  Any module can ship a
67 # win32ver.rc or furnish a rule for generating one.  Set $(PGFILEDESC) to
68 # signal win32ver.rc availability to the dll build rule below.
69 ifndef PGXS
70 win32ver.rc: $(top_srcdir)/src/port/win32ver.rc
71         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*//'`';' $< >$@
72 endif
73
74 win32ver.o: win32ver.rc
75         $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir)
76
77 # Rule for building a shared library from a single .o file
78 %.dll: %.o $(if $(PGFILEDESC),$(WIN32RES))
79         $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS)