1 ################################### tell Emacs this is a -*- makefile-gmake -*-
3 # Copyright (C) 2011-2013 SIPE Project <http://sipe.sourceforge.net/>
7 # Author: zup@sbox.tugraz.at
9 # Description: Makefile for win32 (mingw) version of libsipe
11 ###############################################################################
13 # Configuration option:
14 # - USE_SSPI defined: NTLM, Kerberos, TLS-DSK & Single Sign-On supported
15 # - USE_SSPI not defined: NTLM & TLS-DSK but without Single Sign-On support
16 # [eg.: make -f Makefile.mingw USE_SSPI= ]
18 # @TODO: HAVE_LIBKRB5 support for USE_SSPI=. Where to find the libraries?
19 # Those would need to be packaged alongside the plugin.
24 # standalone MinGW build
25 OLD_PIDGIN_TREE_TOP := $(PIDGIN_TREE_TOP)
26 PIDGIN_TREE_TOP := ../$(OLD_PIDGIN_TREE_TOP)
28 # MinGW cross-compile build (see contrib/mingw-cross-compile/README.txt)
29 PIDGIN_TREE_TOP := ../../..
30 VERSION := $(shell cat ../../VERSION)
33 include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
37 DLL_INSTALL_DIR = $(PURPLE_INSTALL_PLUGINS_DIR)
39 # dump higher level defines
41 DEFINES += -DENABLE_NLS=1
42 DEFINES += -DPACKAGE_BUGREPORT=\"https://sourceforge.net/p/sipe/bugs/\"
43 DEFINES += -DPACKAGE_NAME=\"pidgin-sipe\"
44 DEFINES += -DPACKAGE_URL=\"http://sipe.sourceforge.net/\"
45 DEFINES += -DPACKAGE_VERSION=\"$(VERSION)\"
46 DEFINES += -DSIPE_TRANSLATIONS_URL=\"https://www.transifex.net/projects/p/pidgin-sipe/r/mob/\"
47 #DEFINES += -DENABLE_OCS2005_MESSAGE_HACK=1
50 DEFINES += -DHAVE_SSPI=1
56 INCLUDE_PATHS += -I. \
59 -I$(GTK_TOP)/include \
60 -I$(GTK_TOP)/include/glib-2.0 \
61 -I$(GTK_TOP)/lib/glib-2.0/include \
62 -I$(LIBXML2_TOP)/include/libxml2 \
63 -I$(NSPR_TOP)/include \
66 PURPLE_INCLUDE_PATHS += -I$(PURPLE_TOP) \
67 -I$(PURPLE_TOP)/win32 \
73 CLEAN_C_SRC = sip-soap.c \
81 sipe-cert-crypto-nss.c \
92 sipe-http-transport.c \
101 sipe-subscriptions.c \
117 PURPLE_C_SRC = ../purple/purple-buddy.c \
118 ../purple/purple-chat.c \
119 ../purple/purple-connection.c \
120 ../purple/purple-debug.c \
121 ../purple/purple-dnsquery.c \
122 ../purple/purple-ft.c \
123 ../purple/purple-groupchat.c \
124 ../purple/purple-im.c \
125 ../purple/purple-markup.c \
126 ../purple/purple-mime.c \
127 ../purple/purple-network.c \
128 ../purple/purple-notify.c \
129 ../purple/purple-plugin.c \
130 ../purple/purple-schedule.c \
131 ../purple/purple-search.c \
132 ../purple/purple-setting.c \
133 ../purple/purple-status.c \
134 ../purple/purple-transport.c \
135 ../purple/purple-user.c
137 C_TEST_SRC = sipe-xml-tests.c
140 CLEAN_C_SRC += sip-sec-sspi.c
142 CLEAN_C_SRC += md4.c \
145 C_TEST_SRC += sip-sec-ntlm-tests.c \
149 C_SRC = $(CLEAN_C_SRC) $(PURPLE_C_SRC)
151 CLEAN_OBJECTS = $(CLEAN_C_SRC:%.c=%.o)
152 PURPLE_OBJECTS = $(PURPLE_C_SRC:%.c=%.o)
153 OBJECTS = $(CLEAN_OBJECTS) $(PURPLE_OBJECTS)
155 # Only these modules need the purple headers
156 $(PURPLE_OBJECTS): INCLUDE_PATHS += $(PURPLE_INCLUDE_PATHS)
158 TEST_OBJECTS = $(C_TEST_SRC:%.c=%.o)
163 LIB_PATHS = -L$(GTK_TOP)/lib \
164 -L$(LIBXML2_TOP)/lib \
182 # These flags are used in mingw build
183 TESTS_WARN = -Werror -Wall -Wextra -Waggregate-return -Wcast-align -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef
185 include $(PIDGIN_COMMON_RULES)
188 ## TARGET DEFINITIONS
190 .PHONY: all clean install
194 $(OBJECTS): $(PURPLE_CONFIG_H)
196 $(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
197 $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
210 test -z "$(DLL_INSTALL_DIR)" || mkdir -p "$(DLL_INSTALL_DIR)"
211 /usr/bin/install -c $(TARGET).dll '$(DLL_INSTALL_DIR)'
215 tests: tests-clean $(TEST_OBJECTS)
216 $(CC) sipe-utils.o uuid.o sipe-xml.o sipe-xml-tests.o -L. $(LIB_PATHS) $(LIBS) -lsipe -o sipe-xml-tests.exe
221 $(CC) ../purple/purple-debug.o ../purple/purple-markup.o ../purple/purple-network.o md4.o sipe-digest.o sipe-crypt.o sipe-mime.o sipe-sign.o sipmsg.o sipe-utils.o uuid.o sip-sec-ntlm-tests.o ../purple/tests.o -L. $(LIB_PATHS) $(LIBS) -lsipe -o ../purple/tests.exe
226 rm -f $(TEST_OBJECTS)
227 rm -f sipe-xml-tests.exe ../purple/tests.exe
229 include $(PIDGIN_COMMON_TARGETS)