3 # Author: hermanator12002@yahoo.com
5 # Description: Top Makefile for win32 (mingw) port of Pidgin and libpurple
9 include $(PIDGIN_TREE_TOP)/libpurple/win32/global.mak
11 # Generate a X.X.X.X version for the installer file versioning header
12 # The last digit will be 99 for a final release, 0 for dev or unknown, or the beta number
13 PIDGIN_PRODUCT_VERSION = $(shell \
14 awk 'BEGIN {FS="."} { \
15 if (int($$3) == $$3) { \
19 sub(int($$3), "", $$5); \
23 if (sub("beta", "", $$5) > 0) { \
30 printf("%s.%s.%s.%s", $$1, $$2, int($$3), $$4); \
34 GTK_INSTALL_VERSION = 2.16.6.0
36 STRIPPED_RELEASE_DIR = $(PIDGIN_TREE_TOP)/pidgin-$(PIDGIN_VERSION)-win32bin
37 DEBUG_SYMBOLS_DIR = $(PIDGIN_TREE_TOP)/pidgin-$(PIDGIN_VERSION)-dbgsym
40 # Any *.dll or *.exe files included in win32-install-dir that we don't compile
41 # should be included in this list so they don't get stripped
50 libenchant_ispell.dll \
51 libenchant_myspell.dll \
69 libsilcclient-1-1-2.dll \
75 #build an expression for `find` to use to ignore the above files
76 EXTERNAL_DLLS_FIND_EXP = $(patsubst %,-o -name %,$(EXTERNAL_DLLS))
78 .PHONY: all docs install installer installer_offline installer_zip debug_symbols_zip installers clean uninstall create_release_install_dir generate_installer_includes $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT)
80 all: $(PIDGIN_CONFIG_H) $(PIDGIN_REVISION_H)
81 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE)
82 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE)
84 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE)
87 install: all $(PIDGIN_INSTALL_DIR)
88 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) install
89 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE) install
91 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE) install
93 $(MAKE) -C share/ca-certs -f $(MINGW_MAKEFILE) install
94 $(MAKE) -C share/sounds -f $(MINGW_MAKEFILE) install
95 mkdir -p $(PIDGIN_INSTALL_DIR)/spellcheck
96 cp $(GTKSPELL_TOP)/bin/libgtkspell-0.dll $(PIDGIN_INSTALL_DIR)/spellcheck
97 cp $(ENCHANT_TOP)/bin/libenchant.dll $(PIDGIN_INSTALL_DIR)/spellcheck
98 cp -R $(ENCHANT_TOP)/lib $(PIDGIN_INSTALL_DIR)/spellcheck
99 cp $(WIN32_DEV_TOP)/pidgin-inst-deps-20100315/exchndl.dll $(PIDGIN_INSTALL_DIR)
101 pidgin/win32/nsis/gtk-runtime-$(GTK_BUNDLE_VERSION).zip:
102 pidgin/win32/nsis/generate_gtk_zip.sh `pwd`
104 generate_installer_includes: create_release_install_dir pidgin/win32/nsis/gtk-runtime-$(GTK_BUNDLE_VERSION).zip debug_symbols_zip
105 rm -f pidgin/win32/nsis/pidgin-translations.nsh pidgin/win32/nsis/pidgin-spellcheck.nsh pidgin/win32/nsis/pidgin-spellcheck-preselect.nsh
106 find $(STRIPPED_RELEASE_DIR)/locale -maxdepth 1 -mindepth 1 \
107 -exec basename {} ';' \
108 | sed -e s/^/\!insertmacro\ LANG_SECTION\ \"/ -e s/$$/\"/ \
109 > pidgin/win32/nsis/pidgin-translations.nsh
110 #Convert the available.lst lines to "!insertmacro SPELLCHECK_SECTION lang lang_name lang_file"
111 sed -e "/^#/d" -e "s/^[^,]\{1,\},[^,]\{1,\},/\"/" \
112 -e "s/,/\"\ \"/" -e "s/,/\"\ \"/" -e "s/[\ \t]*$$/\"/" \
113 -e "s/^/\!insertmacro\ SPELLCHECK_SECTION\ /" \
114 pidgin/win32/nsis/available.lst \
115 > pidgin/win32/nsis/pidgin-spellcheck.nsh
116 #Convert the lines to "!insertmacro CHECK_SPELLCHECK_SECTION lang"
117 iconv -f latin1 -t utf-8 pidgin/win32/nsis/pidgin-spellcheck.nsh | \
118 sed -e "s/SPELLCHECK_SECTION/CHECK_SPELLCHECK_SECTION/" \
119 -e "s/ \"[^\"]*\"\ \"[^\"]*\"[\t\ ]*$$//" | \
120 iconv -f utf-8 -t latin1 \
121 > pidgin/win32/nsis/pidgin-spellcheck-preselect.nsh
123 create_release_install_dir: install
124 rm -rf $(STRIPPED_RELEASE_DIR)
125 mkdir $(STRIPPED_RELEASE_DIR)
126 tar -cf - $(PIDGIN_INSTALL_DIR) --exclude=Gtk --exclude=spellcheck/share \
127 | tar --strip 2 -xC $(STRIPPED_RELEASE_DIR) -f -
128 find $(STRIPPED_RELEASE_DIR) \( -name '*.dll' -o -name '*.exe' \) \
129 -not \( -false $(EXTERNAL_DLLS_FIND_EXP) \) \
130 -exec $(STRIP) --strip-unneeded {} ';'
132 installer: generate_installer_includes
133 $(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(STRIPPED_RELEASE_DIR)" $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
134 mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION).exe ./
136 installer_offline: generate_installer_includes
137 $(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DOFFLINE_INSTALLER $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(STRIPPED_RELEASE_DIR)" $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
138 mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION)-offline.exe ./
140 installer_zip: create_release_install_dir
141 rm -f pidgin-$(PIDGIN_VERSION)-win32-bin.zip
142 zip -9 -r pidgin-$(PIDGIN_VERSION)-win32-bin.zip $(STRIPPED_RELEASE_DIR)
144 debug_symbols_zip: install
145 rm -rf $(DEBUG_SYMBOLS_DIR) $(DEBUG_SYMBOLS_DIR).zip
146 mkdir $(DEBUG_SYMBOLS_DIR)
147 tar -cf - `find $(PIDGIN_INSTALL_DIR) \( -name '*.dll' -o -name '*.exe' \) \
148 -not \( -false $(EXTERNAL_DLLS_FIND_EXP) \) -print` \
149 | tar --strip 2 --xform s/$$/.dbgsym/ -xC $(DEBUG_SYMBOLS_DIR) -f -
150 zip -9 -r $(DEBUG_SYMBOLS_DIR).zip $(DEBUG_SYMBOLS_DIR)
152 installers: installer installer_offline debug_symbols_zip installer_zip
154 Doxyfile.mingw: Doxyfile.in
155 sed -e "s/@PACKAGE@/pidgin/" -e "s/@VERSION@/$(PIDGIN_VERSION)/" -e "s/@top_srcdir@/$(PIDGIN_TREE_TOP)/g" -e "s/@enable_dot@/NO/" $< > $@
158 @echo "Running doxygen..."
159 @doxygen Doxyfile.mingw
162 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE) clean
163 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE) clean
164 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) clean
165 $(MAKE) -C share/ca-certs -f $(MINGW_MAKEFILE) clean
166 rm -f $(PIDGIN_CONFIG_H) $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT) ./VERSION pidgin-$(PIDGIN_VERSION)*.exe pidgin-$(PIDGIN_VERSION)-win32-bin.zip $(DEBUG_SYMBOLS_DIR).zip
167 rm -rf doc/html Doxyfile.mingw
170 rm -rf $(PURPLE_INSTALL_PERL_DIR) $(PIDGIN_INSTALL_PLUGINS_DIR) $(PURPLE_INSTALL_PO_DIR) $(PIDGIN_INSTALL_DIR) $(STRIPPED_RELEASE_DIR) $(DEBUG_SYMBOLS_DIR)
173 include $(PIDGIN_COMMON_TARGETS)