############################################################################# # Makefile for building: @@APPNAME@@ ############################################################################# ####### VERSION (modified by the configure script) ############ APPNAME=@@APPNAME@@ ####### VERSION (modified by the configure script) ############ VERSION=@@APPVER@@ ####### OS (modified by the configure script) ############ OS=@@OS@@ ARCH=@@ARCH@@ ####### Qt (modified by the configure script) ############ QTVER=@@QTVER@@ QTPATH=@@QTPATH@@ ####### PATHES ############ BUILDDIR=build DISTDIR=dist BUILDPATH=$(BUILDDIR)/$(OS)$(ARCH) DISTPATH=$(DISTDIR)/$(OS)$(ARCH)/$(APPNAME)-$(VERSION) ARDIR=archive ARPATH=$(ARDIR)/$(APPNAME)/v$(VERSION) ####### COMPILERS ############ CC-lin32 = gcc CXX-lin32 = g++ CC-lin64 = gcc CXX-lin64 = g++ CC-win32 = i686-w64-mingw32-gcc-win32 CXX-win32 = i686-w64-mingw32-g++-win32 WINDRES-win32 = i686-w64-mingw32-windres CC-win64 = x86_64-w64-mingw32-gcc-win32 CXX-win64 = x86_64-w64-mingw32-g++-win32 WINDRES-win64 = x86_64-w64-mingw32-windres CC = $(CC-$(OS)$(ARCH)) CXX = $(CXX-$(OS)$(ARCH)) WINDRES = $(WINDRES-$(OS)$(ARCH)) DEFINES-lin32 = -DDEBUG -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -D@@APPDEF@@_LIN DEFINES-lin64 = -DDEBUG -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -D@@APPDEF@@_LIN DEFINES-win32 = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_AXCONTAINER_LIB -DQT_PRINTSUPPORT_LIB -DQT_AXBASE_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_XML_LIB -D@@APPDEF@@_WIN DEFINES = $(DEFINES-$(OS)$(ARCH)) CFLAGS-lin32 = @@DEBUG@@ -pipe -O2 -Wall -fPIC -D_REENTRANT $(DEFINES) CFLAGS-lin64 = @@DEBUG@@ -pipe -O2 -Wall -fPIC -D_REENTRANT $(DEFINES) CXXFLAGS-lin32 = @@DEBUG@@ -pipe -O2 -Wall -fPIC -D_REENTRANT $(DEFINES) CXXFLAGS-lin64 = @@DEBUG@@ -pipe -O2 -Wall -fPIC -D_REENTRANT $(DEFINES) CFLAGS-win32 = @@DEBUG@@ -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra $(DEFINES) CXXFLAGS-win32 = @@DEBUG@@ -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads $(DEFINES) CFLAGS = $(CFLAGS-$(OS)$(ARCH)) CXXFLAGS = $(CXXFLAGS-$(OS)$(ARCH)) INCPATH-lin64-qt4 = -I/usr/share/qt4/mkspecs/linux-g++ -I$(QTPATH)/QtCore -I$(QTPATH)/QtGui -I$(QTPATH)/QtNetwork -I$(QTPATH)/QtXml -I$(QTPATH)/QtXmlPatterns -I$(QTPATH) INCPATH-lin64-qt5 = -I$(QTPATH)/mkspecs/linux-g++-64 -I$(QTPATH) -I$(QTPATH)/QtWidgets -I$(QTPATH)/QtCore -I$(QTPATH)/QtGui -I$(QTPATH)/QtPrintSupport -I$(QTPATH)/QtNetwork -I$(QTPATH)/QtXml -I$(QTPATH)/QtXmlPatterns INCPATH-win32-qt5 = -I$(QTPATH)/mkspecs/win32-g++ -I$(QTPATH)/include -I$(QTPATH)/include/ActiveQt -I$(QTPATH)/include/QtWidgets -I$(QTPATH)/include/QtGui -I$(QTPATH)/include/QtCore -I$(QTPATH)/inlucde/QtNetwork -I$(QTPATH)/include/QtXml -I$(QTPATH)/include/QtXmlPatterns -I$(QTPATH)/include/QtPrintSupport INCPATH = $(INCPATH-$(OS)$(ARCH)-qt$(QTVER)) -I. ################## LINKER ##################### LINK-lin32 = g++ LINK-lin64 = g++ LINK-win32 = i686-w64-mingw32-g++-win32 LINK-win64 = x86_64-w64-mingw32-g++-win32 LINK = $(LINK-$(OS)$(ARCH)) LFLAGS-lin32 = -m32 -Wl,-O1 LFLAGS-lin64 = -m64 -Wl,-O1 LFLAGS-win32 = -Wl,-s -mthreads -Wl,-subsystem,console -mthreads -static-libgcc -static-libstdc++ LFLAGS-win64 = -Wl,-s -mthreads -Wl,-subsystem,console -mthreads -static-libgcc -static-libstdc++ LFLAGS = $(LFLAGS-$(OS)$(ARCH)) LIBS-lin64-qt4 = -lQtCore -lQtGui -lQtXml -lQtXmlPatterns -lpthread -lm LIBS-lin64-qt5 = -lQt5Core -lQt5Gui -lQt5Xml -lQt5XmlPatterns -lQt5Widgets -lQt5PrintSupport -lQt5Network -lpthread -lm LIBS-win32-qt5 = -lmingw32 -L$(QTPATH)/lib -lqtmain -lQt5AxContainer -lQt5PrintSupport -lQt5AxBase -lglu32 -lopengl32 -lole32 -loleaut32 -luser32 -lgdi32 -ladvapi32 -luuid -lQt5Widgets -lQt5Gui -lQt5Core -lQt5Xml -lQt5XmlPatterns -lQt5Network -lm -lws2_32 LIBS = $(LIBS-$(OS)$(ARCH)-qt$(QTVER)) ################## OBJECTS ##################### include object-files.txt OBJ-lin = $(COMMON-OBJ) OBJ-win = $(COMMON-OBJ) $(BUILDPATH)/$(APPNAME)_res.o OBJ = $(OBJ-$(OS)) ################## EXECUTBALE #################### EXENAME-lin = $(APPNAME) EXENAME-win = $(APPNAME).exe EXENAME = $(EXENAME-$(OS)) all: $(BUILDPATH)/$(EXENAME) $(BUILDPATH)/$(EXENAME) : $(OBJ) $(LINK) $(LFLAGS) -o $@ $^ $(LIBS) cp $(BUILDPATH)/$(EXENAME) . $(BUILDPATH)/$(APPNAME)_res.o: $(APPNAME).rc $(WINDRES) -i $(APPNAME).rc -o $(BUILDPATH)/$(APPNAME)_res.o --include-dir=. $(DEFINES) ################## DISTRIBUTION ARCHIVE ##################### DISTNAME = dist-$(OS) dist : $(DISTNAME) dist-lin: $(BUILDPATH)/$(APPNAME) @echo -n creating binary distribution archive for Linux ... @-rm -rf $(DISTPATH) @-mkdir -p $(DISTPATH) @-mkdir -p $(DISTPATH)/locales @cp $(BUILDPATH)/$(APPNAME) $(DISTPATH) @if ls $(APPNAME)_*.qm 2>/dev/null 1>&2; then for loc in $(APPNAME)_*.qm; do cp $$loc $(DISTPATH)/locales; done; fi @cp install.sh $(DISTPATH) @if [ -d examples ]; then cp -r examples $(DISTPATH); fi @cd $(DISTPATH); cd ..; tar zcf $(APPNAME)-$(VERSION)_$(OS)$(ARCH).tgz $(APPNAME)-$(VERSION); rm -rf $(APPNAME)-$(VERSION) @echo done; echo result is in $(DISTDIR)/$(OS)$(ARCH)/$(APPNAME)-$(VERSION)_$(OS)$(ARCH).tgz dist-win: $(BUILDPATH)/$(EXENAME) @echo -n creating binary distribution archive for Windows ... @rm -rf $(DISTPATH) @mkdir -p $(DISTPATH) @cp $(BUILDPATH)/$(APPNAME).exe $(DISTPATH) @cp -r lib/$(OS)$(ARCH)/* $(DISTPATH) @if ls $(APPNAME)_*.qm 2>/dev/null 1>&2; then for loc in $(APPNAME)_*.qm; do cp $$loc $(DISTPATH); done; fi @if [ -d examples ]; then cp -r examples $(DISTPATH); fi @cd $(DISTPATH); cd ..; zip -r $(APPNAME)-$(VERSION)_$(OS)$(ARCH).zip $(APPNAME)-$(VERSION)/* ; rm -rf $(APPNAME)-$(VERSION) @echo done; echo result is in $(DISTDIR)/$(OS)$(ARCH)/$(APPNAME)-$(VERSION)_$(OS)$(ARCH).zip src-dist: @echo -n creating source archive ... @rm -rf $(ARPATH) @mkdir -p $(ARPATH) @cp *.cpp $(ARPATH) @cp *.h $(ARPATH) # copying various files: translations (.ts), locales (.qm), resources (.qrc), xml related (.xml,.xsd), config. files (.conf) ... @if ls $(APPNAME)_*.ts 2>/dev/null 1>&2; then for loc in $(APPNAME)_*.ts; do cp $$loc $(ARPATH); done; fi @if ls $(APPNAME)_*.qm 2>/dev/null 1>&2; then for loc in $(APPNAME)_*.qm; do cp $$loc $(ARPATH); done; fi @if ls *.conf 2>/dev/null 1>&2; then for loc in *.conf; do cp $$loc $(ARPATH); done; fi @if ls *.xml 2>/dev/null 1>&2; then for loc in *.xml; do cp $$loc $(ARPATH); done; fi @if ls *.xsd 2>/dev/null 1>&2; then for loc in *.xsd; do cp $$loc $(ARPATH); done; fi @if [ -f $(APPNAME).qrc ]; then cp $(APPNAME).qrc $(ARPATH); fi @if [ -d icons ]; then cp -r icons $(ARPATH); fi @if [ -d examples ]; then cp -r examples $(ARPATH); fi @cp -r lib $(ARPATH) @cp install.sh.in $(ARPATH) @cp Makefile.in $(ARPATH) @cp object-files.txt $(ARPATH) @cp configure $(ARPATH) @if [ -f $(APPNAME).rc ]; then cp $(APPNAME).rc $(ARPATH); fi @if [ -f $(APPNAME).ico ]; then cp $(APPNAME).ico $(ARPATH); fi @cp $(APPNAME).creator $(ARPATH) @if [ -f $(APPNAME).creator.user ]; then cp $(APPNAME).creator.user $(ARPATH); fi @cp $(APPNAME).files $(ARPATH) @cp $(APPNAME).includes $(ARPATH) @if [ -f $(APPNAME).config ]; then cp $(APPNAME).config $(ARPATH); fi @cd $(ARPATH); cd ../..; tar zcf $(APPNAME)-$(VERSION)-src.tgz $(APPNAME); rm -rf $(APPNAME) @echo done; echo result is in $(ARDIR)/$(APPNAME)-$(VERSION)-src.zip clean: rm -f $(OBJ) rm -f *~ rm -f moc_*.cpp rm -f rcc_*.cpp rm -f $(BUILDPATH)/$(EXENAME) rm -f $(EXENAME) ### NEW RULES ### $(BUILDPATH)/%.o : %.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< moc_%.cpp : %.h /usr/bin/moc -qt=$(QTVER) $(DEFINES) $(INCPATH) -o $@ $< rcc_%.cpp : %.qrc /usr/bin/rcc -qt=$(QTVER) $< -o $@ -name $* ### DEPENDENCIES OF EACH SOURCE FILE (auto-added by configure) ###