1# src/makefiles/Makefile.cygwin 2 3ifdef PGXS 4BE_DLLLIBS= -L$(libdir) -lpostgres 5else 6BE_DLLLIBS= -L$(top_builddir)/src/backend -lpostgres 7endif 8 9# linking with -lm or -lc causes program to crash 10# (see http://sources.redhat.com/cygwin/faq/faq.html#SEC110) 11LIBS:=$(filter-out -lm -lc, $(LIBS)) 12 13AROPT = crs 14DLSUFFIX = .dll 15 16override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT) 17 18ifneq (,$(findstring backend,$(subdir))) 19ifeq (,$(findstring conversion_procs,$(subdir))) 20ifeq (,$(findstring libpqwalreceiver,$(subdir))) 21ifeq (,$(findstring replication/pgoutput,$(subdir))) 22ifeq (,$(findstring snowball,$(subdir))) 23override CPPFLAGS+= -DBUILDING_DLL 24endif 25endif 26endif 27endif 28endif 29 30ifneq (,$(findstring src/common,$(subdir))) 31override CPPFLAGS+= -DBUILDING_DLL 32endif 33 34ifneq (,$(findstring src/port,$(subdir))) 35override CPPFLAGS+= -DBUILDING_DLL 36endif 37 38ifneq (,$(findstring timezone,$(subdir))) 39override CPPFLAGS+= -DBUILDING_DLL 40endif 41 42ifneq (,$(findstring ecpg/ecpglib,$(subdir))) 43override CPPFLAGS+= -DBUILDING_DLL 44endif 45 46# required by Python headers 47ifneq (,$(findstring src/pl/plpython,$(subdir))) 48override CPPFLAGS+= -DUSE_DL_IMPORT 49endif 50 51# Rule for building a shared library from a single .o file 52%.dll: %.o 53 $(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS) 54