Pimping the build system to not crap out when parallel makes are used.
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 2 Apr 2008 15:38:23 +0000 (15:38 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 2 Apr 2008 15:38:23 +0000 (15:38 +0000)
Kudos to bhughes and QtCentre for telling me about undocumented qmake options
to specify inter-subdir deps.
Minus points for the people who think that qmake documentation is not necessary
and can be omitted :p

build/quassel.pro
build/targets/mono.pri [moved from build/targets/monolithic.pri with 100% similarity]
build/targets/mono.pro [moved from build/targets/monolithic.pro with 80% similarity]
build/targets/target.pri
src/client/client.pri
src/common/common.pri
src/core/core.pri
src/qtui/qtui.pri
version.inc

index 33c25b2..6dce1c0 100644 (file)
 #
 # NOTE: To change the build configuration, you have to run 'make distclean' first!
 
-
-# Set project-wide config options
-
-#CONFIG = qt warn_on release
-
 TEMPLATE = subdirs
 
-# Check build configuration
-isEmpty(BUILD) {
-  BUILD = all  # build everything by default
-}
-
-contains(BUILD, all) {
-  BUILD += qtclient core mono
-}
+TARGETS = qtclient core mono
 
-contains(BUILD, mono) {
-  include(targets/monolithic.pri)
-  BUILD_MODS *= $${MODULES}
-  BUILD_TARGETS *= monolithic
-}
-
-contains(BUILD, core) {
-  include(targets/core.pri)
-  BUILD_MODS *= $${MODULES}
-  BUILD_TARGETS *= core
-}
+# Check build configuration
+isEmpty(BUILD): BUILD = all  # build everything by default
+contains(BUILD, all): BUILD = $${TARGETS}
 
-contains(BUILD, qtclient) {
-  include(targets/qtclient.pri)
+# Find modules and targets to build
+for(target, TARGETS): contains(BUILD, $$target) {
+  include(targets/$${target}.pri)
   BUILD_MODS *= $${MODULES}
-  BUILD_TARGETS *= qtclient
+  BUILD_TARGETS *= $$target
 }
 
-# First we build contrib stuff...
-# SUBDIRS += contrib/libqxt.pro   # no deps to libqxt at the moment
-
-# Then we build all needed modules...
+# Now add modules and their deps
 for(mod, BUILD_MODS) {
-  SUBDIRS += modules/$${mod}.pro
+  include(../src/$${mod}/$${mod}.pri)
+  SUBDIRS += mod_$${mod}
+  eval(mod_$${mod}.file = modules/$${mod}.pro)
+  eval(mod_$${mod}.makefile = Makefile.mod_$${mod})  # This prevents distclean from removing our Makefile -_-
+  for(dep, DEPMOD): eval(mod_$${mod}.depends += mod_$${dep})
+  export(mod_$${mod}.file)
+  export(mod_$${mod}.makefile)
+  export(mod_$${mod}.depends)
 }
 
-# ... followed by the binaries.
+# Same with targets
 for(target, BUILD_TARGETS) {
-  SUBDIRS += targets/$${target}.pro
+  include(targets/$${target}.pri)
+  SUBDIRS += $${target}
+  eval($${target}.file = targets/$${target}.pro)
+  eval($${target}.makefile = Makefile.target_$${target})
+  for(mod, MODULES): eval($${target}.depends += mod_$${mod})
+  export($${target}.file)
+  export($${target}.makefile)
+  export($${target}.depends)
 }
+
similarity index 80%
rename from build/targets/monolithic.pro
rename to build/targets/mono.pro
index 3c35668..10f8655 100644 (file)
@@ -1,4 +1,4 @@
-include(monolithic.pri)
+include(mono.pri)
 include(target.pri)
 
 RESOURCES *= ../../src/icons/icons.qrc
index 48ed6e5..428daef 100644 (file)
@@ -19,7 +19,7 @@ linux-g++:static {
 for(mod, MODULES) {
   INCLUDEPATH *= $$SRCPATH/$$mod
   LIBS *= -L../modules/$$dirname(mod) -l$$basename(mod)
-  PRE_TARGETDEPS *= ../modules/$$mod
+  #PRE_TARGETDEPS *= ../modules/$$mod
 }
 PRE_TARGETDEPS *= ../../version.inc
 
index 726690c..d16cec3 100644 (file)
@@ -1,5 +1,6 @@
 DEPMOD = common
 QT_MOD = core network gui
+
 SRCS += buffer.cpp buffersettings.cpp clientbacklogmanager.cpp treemodel.cpp networkmodel.cpp buffermodel.cpp client.cpp clientsettings.cpp clientsyncer.cpp \
         mappedselectionmodel.cpp selectionmodelsynchronizer.cpp
 HDRS += buffer.h buffersettings.h clientbacklogmanager.h treemodel.h networkmodel.h buffermodel.h client.h clientsettings.h clientsyncer.h quasselui.h \
index 7326b76..0942f1a 100644 (file)
@@ -1,5 +1,6 @@
 DEPMOD =
 QT_MOD = network
+
 SRCS += backlogmanager.cpp bufferinfo.cpp buffersyncer.cpp bufferviewconfig.cpp bufferviewmanager.cpp global.cpp identity.cpp \
         logger.cpp message.cpp settings.cpp signalproxy.cpp syncableobject.cpp \
         util.cpp network.cpp ircuser.cpp ircchannel.cpp
index 78087d1..d202545 100644 (file)
@@ -1,5 +1,6 @@
 DEPMOD = common
 QT_MOD = core network sql script
+
 SRCS = core.cpp corebacklogmanager.cpp corebufferviewconfig.cpp corebufferviewmanager.cpp coresession.cpp coresettings.cpp networkconnection.cpp sqlitestorage.cpp abstractsqlstorage.cpp storage.cpp basichandler.cpp \
        ircserverhandler.cpp userinputhandler.cpp ctcphandler.cpp coreusersettings.cpp sessionthread.cpp sslserver.cpp
 HDRS = core.h corebacklogmanager.h corebufferviewconfig.h corebufferviewmanager.h coresession.h coresettings.h networkconnection.h sqlitestorage.h abstractsqlstorage.h storage.h basichandler.h \
index e410de4..abd785e 100644 (file)
@@ -1,4 +1,4 @@
-DEPMOD = uisupport common client
+DEPMOD = client common uisupport
 QT_MOD = core gui network
 
 SRCS += aboutdlg.cpp bufferwidget.cpp chatitem.cpp chatline.cpp chatline-old.cpp chatscene.cpp chatview.cpp chatwidget.cpp \
index 5017273..a5be41b 100644 (file)
@@ -4,8 +4,8 @@
 { using namespace Global;
 
   quasselVersion = "0.2.0-alpha5-pre";
-  quasselDate = "2008-04-01";
-  quasselBuild = 685;
+  quasselDate = "2008-04-02";
+  quasselBuild = 686;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;