Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem with qmake generated makefile name in subdirectories for Qt 5.6



  • Using the below command in makefile to generate the makefile for top and sub directories with name Makefile_g.
    The top level directory generates the makefile with name "Makefile_g" but subdirectories makefiles are generated with "Makefile" in Qt5.6. Incase of Qt 4.8, both the top directory and subdirectories makefiles are generated with "Makefile_g" filename.

    Makefile_g: $(PRO_FILE_NAME)
    $(QMAKEPATH)qmake -o $@ $(QMAKESPEC_SWITCH) $(QMAKESPEC) $<

    Here $(PRO_FILE_NAME) is top level pro file.
    QMAKEPATH incase of ubuntu is /usr/local/Qt-5.6.3/bin and $(QMAKESPEC_SWITCH) $(QMAKESPEC) are empty incase of ubuntu.

    Donot see any qmake option difference between Qt 4.8 and Qt 5.6 https://doc.qt.io/qt-5/qmake-running.​html.

    qmake --version
    QMake version 3.0
    Using Qt version 5.6.3 in /usr/local/Qt-5.6.3/lib

    Is this a known issue in qmake generator make file code in Qt 5.6(qmake/generators/makefile.cpp)?
    Any suggestions are appreciated.


  • Lifetime Qt Champion

    Hi,

    Can you provide a minimal compilable example project that shows that issue ?



  • @SGaist
    Attached is the minimal compilable example project showing the issue.
    Incase unable to view the example, attached the same project in https://bugreports.qt.io/browse/QTBUG-87742

    Ensure Qt 5.6.3 is installed in the path /usr/local/Qt-5.6.3.
    The top level handwritten makefile uses TestQmake.pro to generate Makefile_g in the current directory but not in sub-directory unlike Qt 4.8.

    Makefile_g: $(PRO_FILE_NAME)
    $(QMAKEPATH)qmake -o $@ $(QMAKESPEC_SWITCH) $(QMAKESPEC) $<

    To build the example project:
    cd TestQmake
    make clean
    make all

    Expected: The makefile in subdirectory testwidget should be generated with filename "Makefile_g"
    Actual: The makefile in subdirectory testwidget is generated with filename "Makefile"


Log in to reply