Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14608

qmake generates incorrect makefiles when using subdirs, ordered build and custom makefile name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.0
    • 4.7.0
    • Build tools: qmake
    • None
    • Debian Linux (intel x86, 32bit)
    • 96a3bf7a8bbc1e5361e16cbeeceb4be674b88c30

    Description

      Suppose you have a project with subdirectories. The main project file contains:

        TEMPLATE = subdirs
        CONFIG += ordered
        CONFIG += debug_and_release
        MAKEFILE = "Makefile.custom"
      

      When you then create the makefiles with qmake, the custom makefile name is not used in the build rules for the ordered sub-targets.
      The result is that when you then start a build with "make -f Makefile.custom debug", the build process changes into the first subdirectory, where it then attempts to execute "make debug" and not "make -f Makefile.custom debug".
      This also happens when the makefile name is provided on the qmake command line with the "-o" option.

      The bug seems to be in generator/makefile.cpp#2611:

                      //don't need the makefile arg if it isn't changed
                      QString makefilein;
                      if(subtarget->makefile != "$(MAKEFILE)")
                          makefilein = " -f " + subtarget->makefile;
      

      If this is changed to just:

                      // always need the makefile arg
                      QString makefilein = " -f " + subtarget->makefile;
      

      then it works as intended.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            buddenha Oswald Buddenhagen
            persch Robert Persch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes