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 = $(shell \
35 source ../gtk_installer/version.sh; \
39 STRIPPED_RELEASE_DIR = $(PIDGIN_TREE_TOP)/pidgin-$(PIDGIN_VERSION)-win32bin
42 # Any *.dll or *.exe files included in win32-install-dir that we don't compile
43 # should be included in this list so they don't get stripped
66 libsilcclient-1-1-2.dll \
71 #build an expression for `find` to use to ignore the above files
72 EXTERNAL_DLLS_FIND_EXP = $(patsubst %,-o -name %,$(EXTERNAL_DLLS))
74 .PHONY: all docs install installer installer_nogtk installer_debug installers clean uninstall create_release_install_dir
76 all: $(PIDGIN_CONFIG_H) $(PIDGIN_REVISION_H)
77 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE)
78 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE)
80 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE)
83 install: all $(PIDGIN_INSTALL_DIR)
84 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) install
85 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE) install
87 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE) install
89 $(MAKE) -C share/ca-certs -f $(MINGW_MAKEFILE) install
90 $(MAKE) -C share/sounds -f $(MINGW_MAKEFILE) install
92 create_release_install_dir: install
93 rm -rf $(STRIPPED_RELEASE_DIR)
94 cp -R $(PIDGIN_INSTALL_DIR) $(STRIPPED_RELEASE_DIR)
95 find $(STRIPPED_RELEASE_DIR) \( -name '*.dll' -o -name '*.exe' \) \
96 -not \( -false $(EXTERNAL_DLLS_FIND_EXP) \) -exec $(STRIP) --strip-unneeded {} ';'
98 installer: create_release_install_dir
99 $(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DWITH_GTK $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(STRIPPED_RELEASE_DIR)" $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
100 mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION).exe ./
102 installer_nogtk: create_release_install_dir
103 $(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
104 mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION)-no-gtk.exe ./
106 installer_debug: install
107 $(MAKENSIS) $(MAKENSISOPT)V3 $(MAKENSISOPT)DPIDGIN_VERSION="$(PIDGIN_VERSION)" $(MAKENSISOPT)DPIDGIN_PRODUCT_VERSION="$(PIDGIN_PRODUCT_VERSION)" $(MAKENSISOPT)DPIDGIN_INSTALL_DIR="$(PIDGIN_INSTALL_DIR)" $(MAKENSISOPT)DDEBUG $(MAKENSISOPT)DGTK_INSTALL_VERSION="$(GTK_INSTALL_VERSION)" pidgin/win32/nsis/pidgin-installer.nsi
108 mv pidgin/win32/nsis/pidgin-$(PIDGIN_VERSION)-debug.exe ./
110 installer_zip: create_release_install_dir
111 rm -f pidgin-$(PIDGIN_VERSION)-win32-bin.zip
112 zip -9 -r pidgin-$(PIDGIN_VERSION)-win32-bin.zip $(STRIPPED_RELEASE_DIR)
114 installers: installer installer_nogtk installer_debug installer_zip
116 Doxyfile.mingw: Doxyfile.in
117 sed -e "s/@PACKAGE@/pidgin/" -e "s/@VERSION@/$(PIDGIN_VERSION)/" -e "s/@top_srcdir@/$(PIDGIN_TREE_TOP)/g" -e "s/@enable_dot@/NO/" Doxyfile.in > Doxyfile.mingw
120 @echo "Running doxygen..."
121 @doxygen Doxyfile.mingw
124 $(MAKE) -C $(PURPLE_PO_TOP) -f $(MINGW_MAKEFILE) clean
125 $(MAKE) -C $(PIDGIN_TOP) -f $(MINGW_MAKEFILE) clean
126 $(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) clean
127 $(MAKE) -C share/ca-certs -f $(MINGW_MAKEFILE) clean
128 rm -f $(PIDGIN_CONFIG_H) $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT) ./VERSION pidgin-$(PIDGIN_VERSION)*.exe pidgin-$(PIDGIN_VERSION)-win32-bin.zip
129 rm -rf doc/html Doxyfile.mingw
132 rm -rf $(PURPLE_INSTALL_PERL_DIR) $(PIDGIN_INSTALL_PLUGINS_DIR) $(PURPLE_INSTALL_PO_DIR) $(PIDGIN_INSTALL_DIR) $(STRIPPED_RELEASE_DIR)
135 include $(PIDGIN_COMMON_TARGETS)
137 .PHONY: $(PIDGIN_REVISION_H) $(PIDGIN_REVISION_RAW_TXT)