###########################################################
# global Makefile for MagicSmoke
-# (c) Konrad Rosenbaum, 2008-2011
+# (c) Konrad Rosenbaum, 2008-2012
#
# This Makefile is used for creating the complete
# MagicSmoke package - including all sub-packages in
#the directory to install MagicSmoke to for preparation of packages
# change this only if you want to install directly without building
# packages first
-PREFIX = dist
+PREFIX = /usr/local
#the make utility to use
# normally you do not need to change this, the macosx target changes it on its own
###########################################################
# END OF CONFIGURATION
-# No editable content below this line
+# No user editable content below this line
###########################################################
QTDIR=$(shell $(QMAKE) -query QT_INSTALL_PREFIX)
@echo " server - build the server (in Unix mode)"
@echo " all - build everything (in Unix mode)"
@echo " debug - build client in debug mode"
- @echo " macosx - build the client and server on Mac OS/X"
+ @echo " macosx - build the client and server on MacOS/X"
@echo "Documentation, Translation:"
@echo " sdoc - generate source docu, needs doxygen"
@echo " lupdate - update translation source files"
@echo " lrelease - create binary translation files"
- @echo "Installation:"
+ @echo "Direct Installation:"
@echo " install-client - install the client (Unix/Mac)"
@echo " install-server - install the server (Unix/Mac)"
@echo " install - install everything (Unix/Mac)"
+ @echo " --> all these install into $(PREFIX) per default, you can"
+ @echo " override by specifying PREFIX=/my/path for make"
+ @echo "Installation Packages:"
+ @echo " macosx - create the client as dmg for MacOS/X"
@echo " nsis - generate NSIS package (Win32)"
+ @echo " dpkg - generate Debian packages"
+ @echo " tgz - generate generic tar.gz packages (Unix/Linux)"
@echo "Cleanup:"
@echo " clean - clean up intermediate files (Unix/Mac)"
@echo " distclean - clean up built files (Unix/Mac)"
install-client: client
mkdir -p $(PREFIX)/bin
install -D src/msmoke $(PREFIX)/lib/magicsmoke2/msmoke
- cp src/icon.png $(PREFIX)/lib/magicsmoke2/
- echo '#!/bin/sh' >$(PREFIX)/usr/bin/msmoke2
- echo 'LD_LIBRARY_PATH='$(PREFIX)/lib/magicsmoke2:$LD_LIBRARY_PATH' >>$(PREFIX)/bin/msmoke2
- echo 'export LD_LIBRARY_PATH' >>$(PREFIX)/bin/msmoke2
- echo 'exec '$(PREFIX)'/lib/magicsmoke2/msmoke' >>$(PREFIX)/bin/msmoke2
- chmod +x $(PREFIX)/bin/msmoke2
+ strip $(PREFIX)/lib/magicsmoke2/msmoke
+ cp src/images/icon.png $(PREFIX)/lib/magicsmoke2/
+ cp msmoke2.sh-tmpl $(PREFIX)/bin/msmoke2
+ chmod 755 $(PREFIX)/bin/msmoke2
SPREFIX=$(PREFIX)/share/magicmsoke2-server
install-server: server
debug: QMAKEFLAGS+=CONFIG+=debug
debug: client server
+##installation packages
+
macosx: MYMAKE=xcodebuild
macosx: client server lrelease
cd src ; cp *.qm msmoke.app/Contents/MacOS
cd src ; for i in *.qm ; do cp -f $(QTTRANS)/qt$${i#smoke} msmoke.app/Contents/MacOS || true ; done
cd src ; rm -f msmoke.dmg ; macdeployqt msmoke.app -dmg
-
+ @echo "....."
+ @echo "You find the package in src/msmoke.dmg"
nsis: script client
echo !define QTDIR / >qtpath.nsh
$(QMAKE) -query QT_INSTALL_PREFIX >>qtpath.nsh
$(NSIS) $(NOPT) smoke.nsi
+dpkg:
+ fakeroot debian/rules binary
+
+tgz-clean:
+ -rm -rf dist-srv dist-cli dist-doc
+
+tgz-server: PREFIX=dist-srv
+tgz-server: install-server
+ cd dist-srv ; tar c . |gzip > ../magicsmoke2-server.tar.gz
+
+tgz-client: PREFIX=dist-cli
+tgz-client: install-client
+ cp -a $(QTDIR)/lib/libQtScript.s* dist-cli/lib/magicsmoke2
+ cp -a $(QTDIR)/lib/libQtScriptTools.s* dist-cli/lib/magicsmoke2
+ cp -a $(QTDIR)/lib/libQtCore.s* dist-cli/lib/magicsmoke2
+ cp -a $(QTDIR)/lib/libQtGui.s* dist-cli/lib/magicsmoke2
+ cp -a $(QTDIR)/lib/libQtNetwork.s* dist-cli/lib/magicsmoke2
+ cp -a $(QTDIR)/lib/libQtXml.s* dist-cli/lib/magicsmoke2
+ cd dist-cli ; tar c . |gzip >../magicsmoke2-client.tar.gz
+
+tgz-doc: PREFIX=dist-srv
+tgz-doc: install-doc
+ cd dist-doc ; tar c . |gzip >../magicsmoke2-doc.tar.gz
+
+tgz: tgz-clean tgz-server tgz-client tgz-doc
+
+
#tell Make that the rules above are symbolic:
.PHONY: script woc wob server client sdoc zip wbase clean distclean tzone elam debug macosx