The LIBS line was apparently accidentally deleted from configure-mingw32.
[wvstreams.git] / wvrules-posix.mk
blob71113d55ebd3214f5b98a6657d96b5866f92e0db
1 ifdef _WIN32
2 LIBWVSTATIC=$(WVSTREAMS_LIB)/libwvstatic.a
3 LIBWVBASE=$(LIBWVSTATIC)
4 LIBWVUTILS=$(LIBWVSTATIC)
5 LIBWVSTREAMS=$(LIBWVSTATIC)
6 LIBUNICONF=$(LIBWVSTATIC)
7 LIBWVDBUS=$(LIBWVSTATIC) $(LIBS_DBUS)
8 LIBWVQT=$(LIBWVSTATIC)
9 LIBWVTEST=$(WVSTREAMS_LIB)/libwvtest.a $(LIBWVUTILS)
10 else
11 LIBWVSTATIC=$(WVSTREAMS_LIB)/libwvstatic.a
12 LIBWVBASE=$(WVSTREAMS_LIB)/libwvbase.so $(LIBXPLC)
13 LIBWVUTILS=$(WVSTREAMS_LIB)/libwvutils.so $(LIBWVBASE)
14 LIBWVSTREAMS=$(WVSTREAMS_LIB)/libwvstreams.so $(LIBWVUTILS)
15 LIBUNICONF=$(WVSTREAMS_LIB)/libuniconf.so $(LIBWVSTREAMS)
16 LIBWVDBUS=$(WVSTREAMS_LIB)/libwvdbus.so $(LIBWVSTREAMS)
17 LIBWVQT=$(WVSTREAMS_LIB)/libwvqt.so $(LIBWVSTREAMS)
18 LIBWVTEST=$(WVSTREAMS_LIB)/libwvtest.a $(LIBWVUTILS)
19 endif
22 # Initial C compilation flags
24 INCFLAGS=$(addprefix -I,$(WVSTREAMS_INC) $(XPATH))
26 CPPFLAGS += $(CPPOPTS)
27 CFLAGS += $(COPTS)
28 CXXFLAGS += $(CXXOPTS)
29 LDFLAGS += $(LDOPTS) -L$(WVSTREAMS_LIB)
31 # Default compiler we use for linking
32 WVLINK_CC = $(CXX)
34 ifneq ("$(enable_optimization)", "no")
35 CXXFLAGS+=-O2
36 CFLAGS+=-O2
37 endif
39 ifneq ("$(enable_warnings)", "no")
40 CXXFLAGS+=-Wall -Woverloaded-virtual
41 CFLAGS+=-Wall
42 endif
44 DEBUG:=$(filter-out no 0,$(enable_debug))
45 ifdef DEBUG
46 CPPFLAGS += -ggdb -DDEBUG=1 $(patsubst %,-DDEBUG_%,$(DEBUG))
47 LDFLAGS += -ggdb
48 else
49 CPPFLAGS += -DDEBUG=0
50 LDFLAGS +=
51 endif
53 define wvlink_ar
54 $(LINK_MSG)set -e; rm -f $1 $(patsubst %.a,%.libs,$1); \
55 echo $2 >$(patsubst %.a,%.libs,$1); \
56 $(AR) q $1 $(filter %.o,$2); \
57 for d in "" $(filter %.libs,$2); do \
58 if [ "$$d" != "" ]; then \
59 cd $$(dirname "$$d"); \
60 $(AR) q $(shell pwd)/$1 $$(cat $$(basename $$d)); \
61 cd $(shell pwd); \
62 fi; \
63 done; \
64 $(AR) s $1
65 endef
67 CC: FORCE
68 @CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
69 $(WVSTREAMS)/gen-cc CC c
71 CXX: FORCE
72 @CC="$(CXX)" CFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
73 $(WVSTREAMS)/gen-cc CXX cc
75 wvlink=$(LINK_MSG)$(WVLINK_CC) $(LDFLAGS) $($1-LDFLAGS) -o $1 $(filter %.o %.a %.so, $2) $($1-LIBS) $(XX_LIBS) $(LDLIBS) $(PRELIBS) $(LIBS)