mingw: build change
[siplcs.git] / src / core / Makefile.mingw
blob98d0ffd76f5d67012b5f8feaf37c753cf40bd3b0
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$(PURPLE_TOP) \
46                         -I$(PURPLE_TOP)/win32 \
47                         -I$(PIDGIN_TREE_TOP)
49 LIB_PATHS +=            -L$(GTK_TOP)/lib \
50                         -L$(PURPLE_TOP)
53 ##  SOURCES, OBJECTS
55 C_SRC =                 ../purple/purple-debug.c \
56                         ../purple/purple-plugin.c \
57                         sipe.c \
58                         sipe-chat.c \
59                         sipe-conf.c \
60                         sipe-dialog.c \
61                         sipe-session.c \
62                         sipe-utils.c \
63                         sipe-cal.c \
64                         http-conn.c \
65                         sipe-ews.c \
66                         sipmsg.c \
67                         sipe-sign.c \
68                         sip-sec.c \
69                         sip-sec-ntlm.c \
70                         sip-sec-sspi.c \
71                         sip-csta.c \
72                         sipe-ft.c \
73                         sipe-xml.c \
74                         uuid.c
76 OBJECTS =               $(C_SRC:%.c=%.o)
79 ## LIBRARIES
81 LIBS =  \
82                         -lglib-2.0 \
83                         -lws2_32 \
84                         -lintl \
85                         -lSecur32 \
86                         -lpurple
87         
88 # These flags are used in mingw build   
89 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
90 #TESTS_WARN += -Wdeclaration-after-statement
92 include $(PIDGIN_COMMON_RULES)
95 ## TARGET DEFINITIONS
97 .PHONY: all clean install
99 all: $(TARGET).dll
101 $(OBJECTS): $(PURPLE_CONFIG_H)
103 $(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
104         $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll
107 ## CLEAN RULES
109 clean: tests-clean
110         rm -f $(OBJECTS)
111         rm -f $(TARGET).dll
112   
113 rmbak:
114         rm -f *~
115         
116 install:
117         test -z "$(DLL_INSTALL_DIR)" || mkdir -p "$(DLL_INSTALL_DIR)"
118         /usr/bin/install -c $(TARGET).dll '$(DLL_INSTALL_DIR)'
119         
120 tests: tests-clean
121         $(CC) $(TESTS_WARN) -pipe -mno-cygwin -mms-bitfields -ggdb $(INCLUDE_PATHS) -o tests.o -c tests.c
122         $(CC) sipe-sign.o sip-sec.o sipmsg.o sipe-utils.o uuid.o tests.o  -L. $(LIB_PATHS) $(LIBS) -lsipe -o tests.exe
123         
124 tests-clean:
125         rm -f tests.o
126         rm -f tests.exe
128 include $(PIDGIN_COMMON_TARGETS)