Merged pidgin/main into default
[pidgin-git.git] / pidgin / Makefile.mingw
blob89369e5ef30ee3b70bd239fc627858329141249e
2 # Makefile.mingw
4 # Description: Makefile for win32 (mingw) version of Pidgin
7 PIDGIN_TREE_TOP := ..
8 include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
10 DEFINES := $(subst -DWIN32_LEAN_AND_MEAN,,$(DEFINES))
13 ## VARIABLE DEFINITIONS
15 EXE_TARGET := pidgin
16 PIDGIN_TARGET := pidgin
17 EXE_NAME := $(EXE_TARGET).exe
19 WINAPP := -mwindows
21 LDFLAGS := $(WINAPP) $(LD_HARDENING_OPTIONS) -Wl,--enable-auto-import -lssp
24 ## INCLUDE PATHS
26 PURPLE_INCLUDE_PATHS =  \
27                         -I$(PURPLE_TOP) \
28                         -I$(PURPLE_TOP)/win32 \
29                         -I$(PIDGIN_TREE_TOP) \
30                         -I$(GTK_TOP)/include \
31                         -I$(GTK_TOP)/include/glib-2.0 \
32                         -I$(GTK_TOP)/lib/glib-2.0/include
34 INCLUDE_PATHS +=        \
35                         $(PURPLE_INCLUDE_PATHS) \
36                         -I$(PIDGIN_TOP) \
37                         -I$(PIDGIN_TOP)/win32 \
38                         $(VV_INCLUDE_PATHS) \
39                         -I$(GTK_TOP)/include/gtk-2.0 \
40                         -I$(GTK_TOP)/include/pango-1.0 \
41                         -I$(GTK_TOP)/include/atk-1.0 \
42                         -I$(GTK_TOP)/include/cairo \
43                         -I$(GTK_TOP)/include/gdk-pixbuf-2.0 \
44                         -I$(GTK_TOP)/lib/gtk-2.0/include \
45                         -I$(LIBSOUP_TOP)/include/libsoup-2.4 \
46                         -I$(LIBGADU_TOP)/include \
47                         -I$(WEBKITGTK_TOP)/include/webkitgtk-1.0
49 LIB_PATHS +=            -L$(GTK_TOP)/lib \
50                         -L$(WEBKITGTK_TOP)/lib \
51                         -L$(LIBGADU_TOP)/lib \
52                         -L$(PURPLE_TOP) \
53                         -L$(PIDGIN_TOP) \
54                         $(VV_LIB_PATHS)
57 ##  SOURCES, OBJECTS
59 PIDGIN_C_SRC =  \
60                         gtkaccount.c \
61                         gtkblist-theme-loader.c \
62                         gtkblist-theme.c \
63                         gtkblist.c \
64                         gtkcellrendererexpander.c \
65                         gtkcertmgr.c \
66                         gtkconn.c \
67                         gtkconv.c \
68                         gtkconv-theme.c \
69                         gtkconv-theme-loader.c \
70                         gtkdebug.c \
71                         gtkdialogs.c \
72                         gtkdnd-hints.c \
73                         gtkdocklet.c \
74                         gtkicon-theme-loader.c \
75                         gtkicon-theme.c \
76                         gtkidle.c \
77                         gtklog.c \
78                         gtkmedia.c \
79                         gtkmenutray.c \
80                         gtknotify.c \
81                         gtkplugin.c \
82                         gtkpluginpref.c \
83                         gtkpounce.c \
84                         gtkprefs.c \
85                         gtkprivacy.c \
86                         gtkrequest.c \
87                         gtkroomlist.c \
88                         gtksavedstatuses.c \
89                         gtkscrollbook.c \
90                         gtksmiley-manager.c \
91                         gtksmiley-theme.c \
92                         gtksound.c \
93                         gtkstatus-icon-theme.c \
94                         gtkstatusbox.c \
95                         gtkutils.c \
96                         gtkwebview.c \
97                         gtkwebviewtoolbar.c \
98                         gtkwhiteboard.c \
99                         gtkxfer.c \
100                         libpidgin.c \
101                         minidialog.c \
102                         pidgin.c \
103                         pidginstock.c \
104                         pidgintooltip.c \
105                         win32/gtkwin32dep.c \
106                         win32/untar.c
108 PIDGIN_RC_SRC = win32/pidgin_dll_rc.rc
109 PIDGIN_OBJECTS = $(PIDGIN_C_SRC:%.c=%.o) $(PIDGIN_RC_SRC:%.rc=%.o)
111 EXE_RC_SRC = win32/pidgin_exe_rc.rc
112 EXE_C_SRC = win32/winpidgin.c
113 EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(EXE_RC_SRC:%.rc=%.o)
116 ## LIBRARIES
119 PIDGIN_LIBS =   \
120                 -lintl \
121                 -lglib-2.0 \
122                 -lgobject-2.0 \
123                 -lgthread-2.0 \
124                 -lpurple \
125                 -lz \
126                 -lgtk-win32-2.0 \
127                 -latk-1.0 \
128                 -lcairo \
129                 -lpango-1.0 \
130                 -lgdk-win32-2.0 \
131                 -lgdk_pixbuf-2.0 \
132                 -lgdi32 \
133                 -lgadu \
134                 -lwinmm \
135                 $(VV_LIBS) \
136                 -lwebkitgtk-1.0
138 include $(PIDGIN_COMMON_RULES)
141 ## TARGET DEFINITIONS
143 .PHONY: all install install_shallow clean
145 all: $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
146         $(MAKE_at) $(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE)
148 gtkdialogs.c: $(PIDGIN_REVISION_H)
150 win32/pidgin_exe_rc.rc: win32/pidgin_exe_rc.rc.in $(PIDGIN_TREE_TOP)/VERSION
151         @echo -e "  GEN\t$@"
152         @sed -e 's/@PURPLE_VERSION@/$(PIDGIN_VERSION)/g' \
153                 -e 's/@PURPLE_MAJOR_VERSION@/$(PURPLE_MAJOR_VERSION)/g' \
154                 -e 's/@PURPLE_MINOR_VERSION@/$(PURPLE_MINOR_VERSION)/g' \
155                 -e 's/@PURPLE_MICRO_VERSION@/$(PURPLE_MICRO_VERSION)/g' \
156                 -e 's/@PURPLE_API_VERSION@/$(PURPLE_API_VERSION)/g' \
157             $@.in > $@
159 install_shallow: $(PIDGIN_INSTALL_DIR) $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
160         cp $(EXE_TARGET).exe $(PIDGIN_TARGET).dll $(PIDGIN_INSTALL_DIR)
161         mkdir -p "$(PIDGIN_INSTALL_DIR)/theme"
162         cp -r themes/* "$(PIDGIN_INSTALL_DIR)/theme/"
163         chmod -R 777 "$(PIDGIN_INSTALL_DIR)/theme/"
165 install: install_shallow all
166         $(MAKE_at) $(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE) install
167         $(MAKE_at) $(MAKE) -C $(PIDGIN_PIXMAPS_TOP) -f $(MINGW_MAKEFILE) install
169 win32/pidgin_dll_rc.rc: win32/pidgin_dll_rc.rc.in $(PIDGIN_TREE_TOP)/VERSION
170         @echo -e "  GEN\t$@"
171         @sed -e 's/@PURPLE_VERSION@/$(PIDGIN_VERSION)/g' \
172                 -e 's/@PURPLE_MAJOR_VERSION@/$(PURPLE_MAJOR_VERSION)/g' \
173                 -e 's/@PURPLE_MINOR_VERSION@/$(PURPLE_MINOR_VERSION)/g' \
174                 -e 's/@PURPLE_MICRO_VERSION@/$(PURPLE_MICRO_VERSION)/g' \
175                 -e 's/@PURPLE_API_VERSION@/$(PURPLE_API_VERSION)/g' \
176             $@.in > $@
178 $(EXE_OBJECTS) $(PIDGIN_OBJECTS): $(PIDGIN_CONFIG_H)
180 gtkdebug.c: gtkdebug.html.h
182 $(PIDGIN_TARGET).dll $(PIDGIN_TARGET).dll.a: $(PURPLE_DLL).a $(PIDGIN_OBJECTS)
183         $(CC) -shared $(PIDGIN_OBJECTS) $(LIB_PATHS) $(PIDGIN_LIBS) $(DLL_LD_FLAGS) -Wl,--output-def,$(PIDGIN_TARGET).def,--out-implib,$(PIDGIN_TARGET).dll.a -o $(PIDGIN_TARGET).dll
185 $(EXE_TARGET).exe: $(PIDGIN_CONFIG_H) $(PIDGIN_DLL).a $(EXE_OBJECTS) $(PIDGIN_TARGET).dll
186         $(CC) $(EXE_OBJECTS) $(LDFLAGS) -o $(EXE_TARGET).exe
189 ## CLEAN RULES
191 clean:
192         $(MAKE_at) $(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE) clean
193         $(MAKE_at) $(MAKE) -C $(PIDGIN_PIXMAPS_TOP) -f $(MINGW_MAKEFILE) clean
194         rm -f $(PIDGIN_OBJECTS) $(PIDGIN_RC_SRC) $(EXE_OBJECTS) $(EXE_RC_SRC)
195         rm -f $(PIDGIN_TARGET).dll $(PIDGIN_TARGET).dll.a $(PIDGIN_TARGET).def
196         rm -f $(EXE_TARGET).exe
198 include $(PIDGIN_COMMON_TARGETS)