summaryrefslogtreecommitdiff
path: root/pidgin/Makefile.mingw
blob: 6f8fbd9d6e83b6d35566a31e5d57ec4ce398ee47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#
# Makefile.mingw
#
# Description: Makefile for win32 (mingw) version of Pidgin
#

PIDGIN_TREE_TOP := ..
include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak

NEEDED_DLLS = $(GTKSPELL_TOP)/gtkspell/libgtkspell.dll

##
## VARIABLE DEFINITIONS
##
EXE_TARGET := pidgin
PIDGIN_TARGET := pidgin
EXE_NAME := $(EXE_TARGET).exe

WINAPP := -mwindows

LDFLAGS := $(WINAPP)

##
## INCLUDE PATHS
##
PURPLE_INCLUDE_PATHS =	\
			-I$(PURPLE_TOP) \
			-I$(PURPLE_TOP)/win32 \
			-I$(PIDGIN_TREE_TOP) \
			-I$(GTK_TOP)/include \
			-I$(GTK_TOP)/include/glib-2.0 \
			-I$(GTK_TOP)/lib/glib-2.0/include

INCLUDE_PATHS +=	\
			$(PURPLE_INCLUDE_PATHS) \
			-I$(PIDGIN_IDLETRACK_TOP) \
			-I$(PIDGIN_TOP) \
			-I$(PIDGIN_TOP)/win32 \
			-I$(GTK_TOP)/include/gtk-2.0 \
			-I$(GTK_TOP)/include/pango-1.0 \
			-I$(GTK_TOP)/include/atk-1.0 \
			-I$(GTK_TOP)/include/cairo \
			-I$(GTK_TOP)/lib/gtk-2.0/include \
			-I$(GTKSPELL_TOP) \
			-I$(ASPELL_TOP)/include

LIB_PATHS +=		-L$(GTK_TOP)/lib \
			-L$(PURPLE_TOP) \
			-L$(PIDGIN_TOP) \
			-L$(PIDGIN_IDLETRACK_TOP) \
			-L$(ASPELL_TOP)/lib

##
##  SOURCES, OBJECTS
##
PIDGIN_C_SRC =	\
			gtkaccount.c \
			gtkblist.c \
			gtkconn.c \
			gtkconv.c \
			gtkcellrendererexpander.c \
			gtkcellrendererprogress.c \
			gtkdebug.c \
			gtkdialogs.c \
			gtkdnd-hints.c \
			gtkdocklet.c \
			gtkeventloop.c \
			gtkexpander.c \
			gtkft.c \
			gtkidle.c \
			gtkimhtml.c \
			gtkimhtmltoolbar.c \
			gtklog.c \
			gtkmain.c \
			gtkmenutray.c \
			gtknotify.c \
			gtkplugin.c \
			gtkpluginpref.c \
			gtkpounce.c \
			gtkprefs.c \
			gtkprivacy.c \
			gtkrequest.c \
			gtkroomlist.c \
			gtksavedstatuses.c \
			gtkscrollbook.c \
			gtksound.c \
			gtksourceiter.c \
			gtkstatusbox.c \
			gtkthemes.c \
			gtkutils.c \
			gtkwhiteboard.c \
			pidginstock.c \
			win32/MinimizeToTray.c \
			win32/gtkdocklet-win32.c \
			win32/gtkwin32dep.c \
			win32/untar.c \
			win32/wspell.c

PIDGIN_RC_SRC = win32/pidgin_dll_rc.rc
PIDGIN_OBJECTS = $(PIDGIN_C_SRC:%.c=%.o) $(PIDGIN_RC_SRC:%.rc=%.o)

EXE_RC_SRC = win32/pidgin_exe_rc.rc
EXE_C_SRC = win32/winpidgin.c
EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(EXE_RC_SRC:%.rc=%.o)

##
## LIBRARIES
##
LIBPURPLES =	\
		-lpurple \
		-lglib-2.0 \
		-lgthread-2.0 \
		-lgobject-2.0 \
		-lgmodule-2.0 \
		-lintl \
		-lws2_32 \
		-lwinmm \
		-lz

GTKPURPLES =	\
		$(LIBPURPLES) \
		-lidletrack \
		-lgtk-win32-2.0 \
		-latk-1.0 \
		-lpango-1.0 \
		-lgdk-win32-2.0 \
		-lgdk_pixbuf-2.0 \
		-lgdi32

include $(PIDGIN_COMMON_RULES)

##
## TARGET DEFINITIONS
##
.PHONY: all install install_shallow clean clean_exe

all: $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
	$(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE)

win32/pidgin_exe_rc.rc: win32/pidgin_exe_rc.rc.in $(PIDGIN_TREE_TOP)/VERSION
	sed -e 's/@PIDGIN_VERSION@/$(PIDGIN_VERSION)/g' \
	    -e 's/@ORIGINAL_FILENAME@/$(EXE_NAME)/' \
	    $@.in > $@

install_shallow: $(PIDGIN_INSTALL_DIR) $(EXE_TARGET).exe $(PIDGIN_TARGET).dll
	cp $(EXE_TARGET).exe $(PIDGIN_TARGET).dll $(PIDGIN_INSTALL_DIR)
	cp $(NEEDED_DLLS) $(PIDGIN_INSTALL_DIR)

install: install_shallow all
	$(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE) install
	$(MAKE) -C $(PIDGIN_PIXMAPS_TOP) -f $(MINGW_MAKEFILE) install
	$(MAKE) -C $(PIDGIN_SOUNDS_TOP) -f $(MINGW_MAKEFILE) install
	$(MAKE) -C $(PIDGIN_IDLETRACK_TOP) -f $(MINGW_MAKEFILE) install

win32/pidgin_dll_rc.rc: win32/pidgin_dll_rc.rc.in $(PIDGIN_TREE_TOP)/VERSION
	sed -e 's/@PIDGIN_VERSION@/$(PIDGIN_VERSION)/g' \
	    $@.in > $@

$(EXE_OBJECTS) $(PIDGIN_OBJECTS): $(PIDGIN_CONFIG_H)

$(PIDGIN_TARGET).dll $(PIDGIN_TARGET).dll.a: $(PURPLE_DLL).a $(PIDGIN_IDLETRACK_DLL).a $(PIDGIN_OBJECTS)
	$(CC) -shared $(PIDGIN_OBJECTS) $(LIB_PATHS) $(GTKPURPLES) $(DLL_LD_FLAGS) -Wl,--out-implib,$(PIDGIN_TARGET).dll.a -o $(PIDGIN_TARGET).dll

$(EXE_TARGET).exe: $(PIDGIN_CONFIG_H) $(PIDGIN_DLL).a $(PIDGIN_IDLETRACK_DLL).a $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET).exe

$(EXE_TARGET)-portable.exe: DEFINES += -DPORTABLE
$(EXE_TARGET)-portable.exe: EXE_NAME := $(EXE_TARGET)-portable.exe
$(EXE_TARGET)-portable.exe: clean_exe $(PIDGIN_CONFIG_H) $(PIDGIN_DLL).a $(PIDGIN_IDLETRACK_DLL).a $(EXE_OBJECTS)
	$(CC) $(LDFLAGS) $(EXE_OBJECTS) -o $(EXE_TARGET)-portable.exe
	$(MAKE) -f $(MINGW_MAKEFILE) clean_exe

##
## CLEAN RULES
##
clean:
	$(MAKE) -C $(PIDGIN_IDLETRACK_TOP) -f $(MINGW_MAKEFILE) clean
	$(MAKE) -C $(PIDGIN_PLUGINS_TOP) -f $(MINGW_MAKEFILE) clean
	rm -f $(PIDGIN_OBJECTS) $(PIDGIN_RC_SRC) $(EXE_OBJECTS) $(EXE_RC_SRC)
	rm -f $(PIDGIN_TARGET).dll $(PIDGIN_TARGET).dll.a
	rm -f $(EXE_TARGET).exe $(EXE_TARGET)-portable.exe

clean_exe:
	rm -f $(EXE_OBJECTS) $(EXE_RC_SRC)

include $(PIDGIN_COMMON_TARGETS)