2020-04-06 19:27:39 +02:00
|
|
|
SUBDIRS = dic game utils qt po extras
|
2005-02-06 23:18:11 +01:00
|
|
|
|
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
2008-01-12 21:42:25 +01:00
|
|
|
|
2013-01-17 16:21:27 +01:00
|
|
|
WIN32_ZIP_FILE = $(top_builddir)/eliot-$(VERSION)-win32.zip
|
|
|
|
WIN32_EXE_FILE = $(top_builddir)/eliot-$(VERSION)-win32.exe
|
2008-01-12 21:42:25 +01:00
|
|
|
WIN32_PACKAGE_DIR = $(top_builddir)/eliot-$(VERSION)
|
2013-01-17 16:21:27 +01:00
|
|
|
WIN32_INSTALLER_DIR = $(top_builddir)/eliot-installer-$(VERSION)
|
2010-02-07 22:37:24 +01:00
|
|
|
MACOSX_PACKAGE_DIR = $(top_builddir)/eliot-$(VERSION)/Eliot.app
|
|
|
|
|
|
|
|
DMG_FILE = $(top_builddir)/eliot-$(VERSION).dmg
|
2008-01-12 21:42:25 +01:00
|
|
|
|
2013-01-17 16:21:27 +01:00
|
|
|
.PHONY: package-win32-dir package-win32-zip package-win32-exe package-macosx
|
2008-01-12 21:42:25 +01:00
|
|
|
|
2010-05-22 12:26:46 +02:00
|
|
|
EXTRA_DIST = COPYING.arabica LGPL-2.0.txt
|
2009-11-30 22:54:48 +01:00
|
|
|
|
2013-01-17 16:21:27 +01:00
|
|
|
# Prepare the win32 package (directory only)
|
|
|
|
package-win32-dir:
|
2010-02-07 22:37:24 +01:00
|
|
|
# Remove previous stuff
|
|
|
|
rm -rf $(WIN32_PACKAGE_DIR)
|
|
|
|
|
2008-01-12 21:42:25 +01:00
|
|
|
mkdir -p $(WIN32_PACKAGE_DIR)
|
|
|
|
|
|
|
|
# Copy the binaries and strip them
|
2008-12-08 22:45:27 +01:00
|
|
|
cp $(top_builddir)/dic/compdic$(EXEEXT) $(top_builddir)/dic/listdic$(EXEEXT) $(top_builddir)/qt/eliot$(EXEEXT) $(WIN32_PACKAGE_DIR)
|
2008-01-12 21:42:25 +01:00
|
|
|
$(STRIP) $(WIN32_PACKAGE_DIR)/*
|
|
|
|
|
|
|
|
# Copy the i18n files
|
|
|
|
cat $(top_srcdir)/po/LINGUAS | while read lang; do \
|
|
|
|
mkdir -p $(WIN32_PACKAGE_DIR)/locale/$${lang}/LC_MESSAGES; \
|
|
|
|
cp $(top_srcdir)/po/$${lang}.gmo $(WIN32_PACKAGE_DIR)/locale/$${lang}/LC_MESSAGES/eliot.mo; \
|
|
|
|
done
|
2008-09-03 19:28:27 +02:00
|
|
|
mkdir -p $(WIN32_PACKAGE_DIR)/locale/qt4
|
|
|
|
cp $(QT4LOCALEDIR)/*.qm $(WIN32_PACKAGE_DIR)/locale/qt4/ || true
|
2008-01-12 21:42:25 +01:00
|
|
|
|
|
|
|
# Copy relevant text files
|
2009-11-30 22:54:48 +01:00
|
|
|
for i in AUTHORS COPYING COPYING.arabica NEWS THANKS; do \
|
2008-01-12 21:42:25 +01:00
|
|
|
cp $(top_srcdir)/$$i $(WIN32_PACKAGE_DIR)/$$i.txt; \
|
2010-05-22 20:38:07 +02:00
|
|
|
todos $(WIN32_PACKAGE_DIR)/$$i.txt; \
|
2008-01-12 21:42:25 +01:00
|
|
|
done
|
|
|
|
|
2013-01-11 19:31:37 +01:00
|
|
|
# Copy reports
|
|
|
|
cp -r $(top_srcdir)/extras/reports $(WIN32_PACKAGE_DIR)
|
|
|
|
todos $(WIN32_PACKAGE_DIR)/reports/README.txt
|
|
|
|
|
2008-01-12 21:42:25 +01:00
|
|
|
# Copy the mingw DLL
|
|
|
|
gunzip -c /usr/share/doc/mingw32-runtime/mingwm10.dll.gz > $(WIN32_PACKAGE_DIR)/mingwm10.dll
|
|
|
|
|
2013-01-17 16:21:27 +01:00
|
|
|
|
|
|
|
# Prepare the win32 package (zip version)
|
|
|
|
package-win32-zip: package-win32-dir
|
|
|
|
rm -f $(WIN32_ZIP_FILE)
|
2008-01-12 21:42:25 +01:00
|
|
|
# Zip the temporary dir and remove it
|
2013-01-17 16:21:27 +01:00
|
|
|
zip -r -9 $(WIN32_ZIP_FILE) $(WIN32_PACKAGE_DIR)
|
2008-01-12 21:42:25 +01:00
|
|
|
rm -rf $(WIN32_PACKAGE_DIR)
|
2013-01-17 16:21:27 +01:00
|
|
|
@echo "Package generated: $(WIN32_ZIP_FILE)"
|
|
|
|
|
|
|
|
|
|
|
|
# Prepare the win32 package (exe version)
|
|
|
|
# This target supposes that a 'iscc' script is available:
|
|
|
|
# see https://katastrophos.net/andre/blog/2009/03/16/setting-up-the-inno-setup-compiler-on-debian/
|
|
|
|
# It also supposes the ELIOT_DIC_DIR environment variable points to a folder
|
|
|
|
# containing the dictionaries, with the correct structure.
|
|
|
|
package-win32-exe: package-win32-dir
|
|
|
|
rm -rf $(WIN32_INSTALLER_DIR)
|
|
|
|
|
|
|
|
# Make sure that the environment variable is present,
|
|
|
|
# and check quickly the directory
|
|
|
|
if [ ! -d "$(ELIOT_DIC_DIR)" ]; then \
|
|
|
|
echo "Environment variable ELIOT_DIC_DIR not correctly defined!"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
if [ ! -d "$(ELIOT_DIC_DIR)/english" ]; then \
|
|
|
|
echo "Invalid directories structure in \\$$ELIOT_DIC_DIR!"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Prepare a temporary directory for InnoSetup
|
|
|
|
mkdir -p $(WIN32_INSTALLER_DIR)
|
|
|
|
mv $(WIN32_PACKAGE_DIR) $(WIN32_INSTALLER_DIR)/eliot
|
|
|
|
cp -r $(top_srcdir)/extras/innosetup/inno* $(WIN32_INSTALLER_DIR)
|
|
|
|
cp -r $(top_builddir)/extras/innosetup/* $(WIN32_INSTALLER_DIR)
|
|
|
|
cp -r $(ELIOT_DIC_DIR) $(WIN32_INSTALLER_DIR)
|
|
|
|
|
|
|
|
# Run the compiler
|
|
|
|
iscc $(WIN32_INSTALLER_DIR)/eliot-setup.iss
|
|
|
|
|
|
|
|
mv $(WIN32_INSTALLER_DIR)/Output/*.exe $(WIN32_EXE_FILE)
|
|
|
|
rm -rf $(WIN32_INSTALLER_DIR)
|
|
|
|
@echo "Executable generated: $(WIN32_EXE_FILE)"
|
2010-01-29 22:13:05 +01:00
|
|
|
|
2010-02-07 22:37:24 +01:00
|
|
|
|
2010-01-29 22:13:05 +01:00
|
|
|
# Prepare the macosx package
|
|
|
|
package-macosx:
|
2010-02-07 22:37:24 +01:00
|
|
|
# Remove previous stuff
|
|
|
|
rm -rf $(top_builddir)/eliot-$(VERSION)
|
2010-01-29 22:13:05 +01:00
|
|
|
|
|
|
|
# Prepare the bundle structure
|
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/Contents/MacOS
|
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/Contents/Resources
|
|
|
|
cp $(top_srcdir)/extras/macosx/Info.plist $(MACOSX_PACKAGE_DIR)/Contents
|
|
|
|
cp $(top_srcdir)/extras/macosx/eliot-64.icns $(MACOSX_PACKAGE_DIR)/Contents/Resources
|
|
|
|
|
|
|
|
# Copy the binaries and strip them
|
|
|
|
cp $(top_builddir)/qt/eliot$(EXEEXT) $(MACOSX_PACKAGE_DIR)/Contents/MacOS/Eliot
|
|
|
|
strip $(MACOSX_PACKAGE_DIR)/Contents/MacOS/Eliot
|
|
|
|
|
|
|
|
# Copy the i18n files
|
|
|
|
cat $(top_srcdir)/po/LINGUAS | while read lang; do \
|
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/locale/$${lang}/LC_MESSAGES; \
|
|
|
|
cp $(top_srcdir)/po/$${lang}.gmo $(MACOSX_PACKAGE_DIR)/locale/$${lang}/LC_MESSAGES/eliot.mo; \
|
|
|
|
done
|
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/locale/qt4
|
2012-01-27 21:37:31 +01:00
|
|
|
cp $(QT4LOCALEDIR)/qt_*.qm $(MACOSX_PACKAGE_DIR)/locale/qt4/ || true
|
2010-02-07 22:37:24 +01:00
|
|
|
|
2012-01-27 21:37:31 +01:00
|
|
|
# Copy the shared libraries (up to 3 levels of recursive dependencies)
|
2010-02-17 23:10:30 +01:00
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/Contents/Frameworks
|
2012-01-27 21:37:31 +01:00
|
|
|
otool -L $(MACOSX_PACKAGE_DIR)/Contents/MacOS/Eliot | grep /opt/local/ | sed 's/ (.*//' > dylib.list1
|
|
|
|
otool -L `cat dylib.list1` | grep /opt/local/ | grep " (" | sed 's/ (.*//' | sort -u > dylib.list2
|
|
|
|
otool -L `cat dylib.list2` | grep /opt/local/ | grep " (" | sed 's/ (.*//' | sort -u > dylib.list3
|
|
|
|
for lib in `cat dylib.list3`; do \
|
2010-02-17 23:10:30 +01:00
|
|
|
cp $$lib $(MACOSX_PACKAGE_DIR)/Contents/Frameworks; \
|
|
|
|
done
|
2012-01-27 21:37:31 +01:00
|
|
|
rm -f dylib.list*
|
2010-02-17 23:10:30 +01:00
|
|
|
|
|
|
|
# Copy needed Qt resources
|
|
|
|
mkdir -p $(MACOSX_PACKAGE_DIR)/Contents/Resources
|
2012-10-14 16:27:32 +02:00
|
|
|
cp -r "`find /opt/local -name qt_menu.nib`" $(MACOSX_PACKAGE_DIR)/Contents/Resources
|
2010-02-17 23:10:30 +01:00
|
|
|
|
|
|
|
# Change the dependencies, so that we point to the libraries inside the bundle
|
2010-02-18 22:49:59 +01:00
|
|
|
cd $(MACOSX_PACKAGE_DIR)/Contents/Frameworks; \
|
|
|
|
for lib in `ls`; do \
|
2010-02-17 23:10:30 +01:00
|
|
|
for dep in `otool -L $$lib | grep /opt/local/ | sed 's/ (.*//'`; do \
|
2013-04-06 15:09:24 +02:00
|
|
|
chmod 755 $$lib; \
|
2010-02-18 22:49:59 +01:00
|
|
|
install_name_tool -change $$dep @executable_path/../Frameworks/`basename $$dep` $$lib; \
|
2012-01-27 21:37:31 +01:00
|
|
|
install_name_tool -change $$dep @executable_path/../Frameworks/`basename $$dep` ../MacOS/Eliot; \
|
2010-02-17 23:10:30 +01:00
|
|
|
done; \
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2010-02-07 22:37:24 +01:00
|
|
|
# Build the .dmg file
|
|
|
|
package-macosx-dmg: package-macosx
|
|
|
|
rm -f $(DMG_FILE)
|
|
|
|
hdiutil create "$(DMG_FILE)" -verbose -scrub -srcfolder "$(top_builddir)/eliot-$(VERSION)"
|
|
|
|
|