# packages first
PREFIX = /usr/local
-#the make utility to use
-# normally you do not need to change this, the macosx target changes it on its own
-MYMAKE = $(MAKE)
-
#this builds the installation package on win32
NSIS = makensis
QTBIN=$(shell $(QMAKE) -query QT_INSTALL_BINS)
QTTRANS=$(shell $(QMAKE) -query QT_INSTALL_TRANSLATIONS)
+QMCFG = DESTDIR=$(CURDIR)/bin CONFIG+=separate_debug_info
+
none:
@echo "Usage: $(MAKE) target"
@echo " "
@echo " nsis - generate NSIS package (Win32)"
@echo " dpkg - generate Debian packages"
@echo " tgz - generate generic tar.gz packages (Unix/Linux)"
+ @echo " spack - generate signed self-extracting package"
+ @echo " for user installation and update"
@echo "Cleanup:"
@echo " clean - clean up intermediate files (Unix/Mac)"
@echo " distclean - clean up built files (Unix/Mac)"
cd wob && $(abspath pack/woc/woc) magicsmoke.wolf
woc:
- cd pack && $(MYMAKE)
+ cd pack && $(MAKE)
wbase: woc
+ cp -a pack/qtbase/lib* bin
elam:
- cd elam/src && $(QMAKE) $(QMAKEFLAGS) && $(MYMAKE)
+ cd elam/src && $(QMAKE) $(QMCFG) $(QMAKEFLAGS) && $(MAKE)
server: wob
client: wob zip tzone elam
- cd src && $(QMAKE) $(QMAKEFLAGS) && $(MYMAKE)
+ cd src && $(QMAKE) $(QMAKEFLAGS) && $(MAKE)
zip:
- cd zip && $(QMAKE) $(QMAKEFLAGS) && $(MYMAKE)
+ cd zip && $(QMAKE) $(QMCFG) $(QMAKEFLAGS) && $(MAKE)
tzone:
- cd tzone && $(QMAKE) $(QMAKEFLAGS) && $(MYMAKE)
+ cd tzone && $(QMAKE) $(QMCFG) $(QMAKEFLAGS) && $(MAKE)
sdoc:
$(DOXYGEN) Doxyfile-php
$(DOXYGEN) Doxyfile-cpp
- $(MYMAKE) -C pack doc
+ $(MAKE) -C pack doc
cd tzone && $(DOXYGEN) Doxyfile
cd elam/src && $(DOXYGEN) Doxyfile
cd dptr && $(DOXYGEN) Doxyfile
-rm -rf `find . -name '*~'`
-rm -rf `find . -name '*.bak'`
-rm -rf `find . -name 'core*'`
+ -rm -rf bin
distclean: clean
##installation packages
-macosx: MYMAKE=xcodebuild
+macosx: MAKE=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
dpkg:
fakeroot debian/rules binary
-tgz-clean:
+spack-clean 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
+install-libs:
+ mkdir -p dist-cli/lib
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 zip/libQtZipHelper.s* dist-cli/lib/magicsmoke2
cp -a elam/libelam.s* dist-cli/lib/magicsmoke2
cp -a pack/qtbase/libqwbase.s* dist-cli/lib/magicsmoke2
+
+tgz-client: PREFIX=dist-cli
+tgz-client: install-client install-libs
cd dist-cli ; tar c . |gzip >../magicsmoke2-client.tar.gz
tgz-doc: PREFIX=dist-srv
cd dist-doc ; tar c . |gzip >../magicsmoke2-doc.tar.gz
tgz: tgz-clean tgz-server tgz-client tgz-doc
-
+
+spack: PREFIX=dist-cli
+spack: tgz-clean install-client install-libs
+ -rm magicsmoke-installer magicsmoke-installer.exe
+ cd dist-cli && 7z a -sfx ../magicsmoke-installer
+
#tell Make that the rules above are symbolic:
.PHONY: script woc wob server client sdoc zip wbase clean distclean tzone elam debug macosx
# (c) Konrad Rosenbaum, 2007-2011
TEMPLATE = app
-TARGET = ../src/msmoke
+TARGET = magicsmoke
+DESTDIR = $$PWD/../bin
#build for debug or release?
#CONFIG += release
smoke_en.ts
#make sure the correct Qt DLLs are used
-CONFIG += qt thread link_prl
+CONFIG += qt thread link_prl separate_debug_info
QT += xml network script scripttools
QT += widgets printsupport
}
#compilation output:
-DESTDIR = ../src
OBJECTS_DIR = .ctmp
MOC_DIR = .ctmp
RCC_DIR = .ctmp
#make sure dependencies are found
DEPENDPATH += $$INCLUDEPATH
+LIBS += -L$$PWD/../bin
#security features
linux-g++* {
QMAKE_CFLAGS += -fPIE
QMAKE_CXXFLAGS += -fPIE
QMAKE_LFLAGS += -pie
+ #make sure we find our libs
+ QMAKE_LFLAGS += -Wl,-rpath,\'\$$ORIGIN\'
}
#activate C++11 for g++