mingw: fixed Windows build
[siplcs.git] / src / core / Makefile.mingw
blobe6430e2f4941eea43cd1ad100b7bf349d4bf61fa
2 # Makefile.mingw
4 # Author: zup@sbox.tugraz.at
5 # Date 8/28/07
6 # Description: Makefile for win32 (mingw) version of libsipe
9 OLD_PIDGIN_TREE_TOP := $(PIDGIN_TREE_TOP)
10 PIDGIN_TREE_TOP := ../$(OLD_PIDGIN_TREE_TOP)
12 include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
14 TARGET = libsipe
15 TYPE = PLUGIN
17 # Static or Plugin...
18 ifeq ($(TYPE),STATIC)
19   DEFINES += -DSTATIC
20   DLL_INSTALL_DIR =     $(PURPLE_INSTALL_DIR)
21 else
22 ifeq ($(TYPE),PLUGIN)
23   DLL_INSTALL_DIR =     $(PURPLE_INSTALL_PLUGINS_DIR)
24 endif
25 endif
27 DEFINES += -DSIPE_VERSION=\"$(VERSION)\"
28 DEFINES += -DGETTEXT_PACKAGE=\"pidgin-sipe\"
29 DEFINES += -DUSE_KERBEROS=1
31 ## INCLUDE PATHS
33 INCLUDE_PATHS +=        -I. \
34                         -I../api \
35                         -I../purple \
36                         -I$(GTK_TOP)/include \
37                         -I$(GTK_TOP)/include/glib-2.0 \
38                         -I$(GTK_TOP)/lib/glib-2.0/include \
39                         -I$(PURPLE_TOP) \
40                         -I$(PURPLE_TOP)/win32 \
41                         -I$(PIDGIN_TREE_TOP)
43 LIB_PATHS +=            -L$(GTK_TOP)/lib \
44                         -L$(PURPLE_TOP)
47 ##  SOURCES, OBJECTS
49 C_SRC =                 ../purple/purple-plugin.c \
50                         sipe.c \
51                         sipe-chat.c \
52                         sipe-conf.c \
53                         sipe-dialog.c \
54                         sipe-session.c \
55                         sipe-utils.c \
56                         sipe-cal.c \
57                         http-conn.c \
58                         sipe-ews.c \
59                         sipmsg.c \
60                         sipe-sign.c \
61                         sip-sec.c \
62                         sip-sec-ntlm.c \
63                         sip-sec-sspi.c \
64                         sip-csta.c \
65                         sipe-ft.c \
66                         uuid.c
68 OBJECTS =               $(C_SRC:%.c=%.o)
71 ## LIBRARIES
73 LIBS =  \
74                         -lglib-2.0 \
75                         -lws2_32 \
76                         -lintl \
77                         -lSecur32 \
78                         -lpurple
79         
80 # These flags are used in mingw build   
81 TESTS_WARN = -Werror -Wall -Waggregate-return -Wcast-align -Werror-implicit-function-declaration -Wextra -Wno-sign-compare -Wno-unused-parameter -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef
82 #TESTS_WARN += -Wdeclaration-after-statement
84 include $(PIDGIN_COMMON_RULES)
87 ## TARGET DEFINITIONS
89 .PHONY: all clean install
91 all: $(TARGET).dll
93 $(OBJECTS): $(PURPLE_CONFIG_H)
95 $(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
96         $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
99 ## CLEAN RULES
101 clean: tests-clean
102         rm -f $(OBJECTS)
103         rm -f $(TARGET).dll
104   
105 rmbak:
106         rm -f *~
107         
108 install:
109         test -z "$(DLL_INSTALL_DIR)" || mkdir -p "$(DLL_INSTALL_DIR)"
110         /usr/bin/install -c $(TARGET).dll '$(DLL_INSTALL_DIR)'
111         
112 tests: tests-clean
113         $(CC) $(TESTS_WARN) -pipe -mno-cygwin -mms-bitfields -ggdb $(INCLUDE_PATHS) -o tests.o -c tests.c
114         $(CC) sipe-sign.o sip-sec.o sipmsg.o sipe-utils.o uuid.o tests.o  -L. $(LIB_PATHS) $(LIBS) -lsipe -o tests.exe
115         
116 tests-clean:
117         rm -f tests.o
118         rm -f tests.exe
120 include $(PIDGIN_COMMON_TARGETS)