tests: added some more, rearrenged
[siplcs.git] / src / core / Makefile.mingw
blob32e9dca08219966519a95148a6cdd090b1f8e168
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$(GTK_TOP)/include \
35                         -I$(GTK_TOP)/include/glib-2.0 \
36                         -I$(GTK_TOP)/lib/glib-2.0/include \
37                         -I$(PURPLE_TOP) \
38                         -I$(PURPLE_TOP)/win32 \
39                         -I$(PIDGIN_TREE_TOP)
41 LIB_PATHS +=            -L$(GTK_TOP)/lib \
42                         -L$(PURPLE_TOP)
45 ##  SOURCES, OBJECTS
47 C_SRC =                 sipe.c \
48                         sipe-chat.c \
49                         sipe-conf.c \
50                         sipe-dialog.c \
51                         sipe-session.c \
52                         sipe-utils.c \
53                         sipe-cal.c \
54                         http-conn.c \
55                         sipe-ews.c \
56                         sipmsg.c \
57                         sipe-sign.c \
58                         sip-sec.c \
59                         sip-sec-ntlm.c \
60                         sip-sec-sspi.c \
61                         sip-csta.c \
62                         sipe-ft.c \
63                         uuid.c
65 OBJECTS =               $(C_SRC:%.c=%.o)
68 ## LIBRARIES
70 LIBS =  \
71                         -lglib-2.0 \
72                         -lws2_32 \
73                         -lintl \
74                         -lSecur32 \
75                         -lpurple
76         
77 # These flags are used in mingw build   
78 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
79 #TESTS_WARN += -Wdeclaration-after-statement
81 include $(PIDGIN_COMMON_RULES)
84 ## TARGET DEFINITIONS
86 .PHONY: all clean install
88 all: $(TARGET).dll
90 $(OBJECTS): $(PURPLE_CONFIG_H)
92 $(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
93         $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
96 ## CLEAN RULES
98 clean: tests-clean
99         rm -f $(OBJECTS)
100         rm -f $(TARGET).dll
101   
102 rmbak:
103         rm -f *~
104         
105 install:
106         test -z "$(DLL_INSTALL_DIR)" || mkdir -p "$(DLL_INSTALL_DIR)"
107         /usr/bin/install -c $(TARGET).dll '$(DLL_INSTALL_DIR)'
108         
109 tests: tests-clean
110         $(CC) $(TESTS_WARN) -pipe -mno-cygwin -mms-bitfields -ggdb $(INCLUDE_PATHS) -o tests.o -c tests.c
111         $(CC) sipe-sign.o sip-sec.o sipmsg.o sipe-utils.o uuid.o tests.o  -L. $(LIB_PATHS) $(LIBS) -lsipe -o tests.exe
112         
113 tests-clean:
114         rm -f tests.o
115         rm -f tests.exe
117 include $(PIDGIN_COMMON_TARGETS)