mingw: tests compilation and run
[siplcs.git] / src / core / Makefile.mingw
blob47fa7c3549a45133ca25cc233c92202eaaa3b61e
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 # dump higher level defines
18 DEFINES =
20 # Static or Plugin...
21 ifeq ($(TYPE),STATIC)
22   DEFINES += -DSTATIC
23   DLL_INSTALL_DIR =     $(PURPLE_INSTALL_DIR)
24 else
25 ifeq ($(TYPE),PLUGIN)
26   DLL_INSTALL_DIR =     $(PURPLE_INSTALL_PLUGINS_DIR)
27 endif
28 endif
30 DEFINES += -DENABLE_NLS=1
31 DEFINES += -DPACKAGE_BUGREPORT=\"https://sourceforge.net/tracker/?atid=949931\&group_id=194563\"
32 DEFINES += -DPACKAGE_NAME=\"pidgin-sipe\"
33 DEFINES += -DPACKAGE_URL=\"http://sipe.sourceforge.net/\"
34 DEFINES += -DPACKAGE_VERSION=\"$(VERSION)\"
35 DEFINES += -DHAVE_KERBEROS=1
37 ## INCLUDE PATHS
39 INCLUDE_PATHS +=        -I. \
40                         -I../api \
41                         -I../purple \
42                         -I$(GTK_TOP)/include \
43                         -I$(GTK_TOP)/include/glib-2.0 \
44                         -I$(GTK_TOP)/lib/glib-2.0/include \
45                         -I$(LIBXML2_TOP)/include/libxml2 \
46                         -I$(PURPLE_TOP) \
47                         -I$(PURPLE_TOP)/win32 \
48                         -I$(PIDGIN_TREE_TOP)
50 LIB_PATHS +=            -L$(GTK_TOP)/lib \
51                         -L$(LIBXML2_TOP)/lib \
52                         -L$(PURPLE_TOP)
55 ##  SOURCES, OBJECTS
57 C_SRC =                 ../purple/purple-debug.c \
58                         ../purple/purple-plugin.c \
59                         sipe.c \
60                         sipe-chat.c \
61                         sipe-conf.c \
62                         sipe-dialog.c \
63                         sipe-session.c \
64                         sipe-utils.c \
65                         sipe-cal.c \
66                         http-conn.c \
67                         sipe-ews.c \
68                         sipe-mime.c \
69                         sipmsg.c \
70                         sipe-sign.c \
71                         sip-sec.c \
72                         sip-sec-ntlm.c \
73                         sip-sec-sspi.c \
74                         sip-csta.c \
75                         sipe-ft.c \
76                         sipe-xml.c \
77                         uuid.c
78                         
79 C_TEST_SRC =            sipe-xml-tests.c \
80                         ../purple/tests.c \
82 OBJECTS =               $(C_SRC:%.c=%.o)
84 TEST_OBJECTS =          $(C_TEST_SRC:%.c=%.o)
87 ## LIBRARIES
89 LIBS =  \
90                         -lglib-2.0 \
91                         -lxml2 \
92                         -lws2_32 \
93                         -lintl \
94                         -lSecur32 \
95                         -lpurple
96         
97 # These flags are used in mingw build   
98 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
99 #TESTS_WARN += -Wdeclaration-after-statement
101 include $(PIDGIN_COMMON_RULES)
104 ## TARGET DEFINITIONS
106 .PHONY: all clean install
108 all: $(TARGET).dll
110 $(OBJECTS): $(PURPLE_CONFIG_H)
112 $(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
113         $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
116 ## CLEAN RULES
118 clean: tests-clean
119         rm -f $(OBJECTS)
120         rm -f $(TARGET).dll
121   
122 rmbak:
123         rm -f *~
124         
125 install:
126         test -z "$(DLL_INSTALL_DIR)" || mkdir -p "$(DLL_INSTALL_DIR)"
127         /usr/bin/install -c $(TARGET).dll '$(DLL_INSTALL_DIR)'
128         
129 $(TEST_OBJECTS):
131 tests: tests-clean $(TEST_OBJECTS)
132         $(CC) sipe-utils.o uuid.o sipe-xml.o sipe-xml-tests.o -L. $(LIB_PATHS) $(LIBS) -lsipe -o sipe-xml-tests.exe
133         $(CC) ../purple/purple-debug.o sipe-sign.o sipe-mime.o sipmsg.o sipe-utils.o uuid.o ../purple/tests.o  -L. $(LIB_PATHS) $(LIBS) -lsipe -o ../purple/tests.exe
134         sipe-xml-tests.exe
135         ../purple/tests.exe
136         
137 tests-clean:
138         rm -f $(TEST_OBJECTS)
139         rm -f sipe-xml-tests.exe ../purple/tests.exe
141 include $(PIDGIN_COMMON_TARGETS)