Fix some problems in the oscar code that deals with channel 2 icbms.
[pidgin-git.git] / Makefile.mingw
blob115119215f60026ea74c9e30c4f72943c0e70165
1 # Makefile.mingw
3 # Author: hermanator12002@yahoo.com
4 # Date 9/11/02
5 # Description: Top Makefile for win32 (mingw) port of Pidgin and libpurple
8 PIDGIN_TREE_TOP := .
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) { \
16         $$4 = "99"; \
17     } else { \
18         $$5 = $$3; \
19         sub(int($$3), "", $$5); \
20         if ($$5 == "dev") { \
21             $$4 = "0"; \
22         } else { \
23             if (sub("beta", "", $$5) > 0) { \
24                 $$4 = $$5; \
25             } else { \
26                 $$4 = "0"; \
27             } \
28         } \
29     } \
30     printf("%s.%s.%s.%s", $$1, $$2, int($$3), $$4); \
31     exit; \
32 }' VERSION)
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
42 EXTERNAL_DLLS = \
43         comerr32.dll \
44         exchndl.dll \
45         freebl3.dll \
46         gssapi32.dll \
47         k5sprt32.dll \
48         krb5_32.dll \
49         libenchant.dll \
50         libenchant_ispell.dll \
51         libenchant_myspell.dll \
52         libgtkspell-0.dll \
53         libmeanwhile-1.dll \
54         libnspr4.dll \
55         libplc4.dll \
56         libplds4.dll \
57         libsasl.dll \
58         libxml2-2.dll \
59         nss3.dll \
60         nssckbi.dll \
61         nssutil3.dll \
62         saslANONYMOUS.dll \
63         saslCRAMMD5.dll \
64         saslDIGESTMD5.dll \
65         saslGSSAPI.dll \
66         saslLOGIN.dll \
67         saslPLAIN.dll \
68         libsilc-1-1-2.dll \
69         libsilcclient-1-1-2.dll \
70         smime3.dll \
71         softokn3.dll \
72         sqlite3.dll \
73         ssl3.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)
83 ifndef DISABLE_NLS
84         $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE)
85 endif
87 install: all $(PIDGIN_INSTALL_DIR)
88         $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) install
89         $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE) install
90 ifndef DISABLE_NLS
91         $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE) install
92 endif
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/" $< > $@
157 docs: Doxyfile.mingw
158         @echo "Running doxygen..."
159         @doxygen Doxyfile.mingw
161 clean:
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
169 uninstall:
170         rm -rf $(PURPLE_INSTALL_PERL_DIR) $(PIDGIN_INSTALL_PLUGINS_DIR) $(PURPLE_INSTALL_PO_DIR) $(PIDGIN_INSTALL_DIR) $(STRIPPED_RELEASE_DIR) $(DEBUG_SYMBOLS_DIR)
171         rm -f ./VERSION
173 include $(PIDGIN_COMMON_TARGETS)