Bad makefile



  • Hi,
    I'm trying to build latest Qt Installer Framework with static Qt 5.6.0 and mingw 4.9.2 on Windows 10. I have the problem that qmake produces bad makefile (with commands for linux)

    QMAKE         = C:/Qt/5.6_static/5.6.0/bin/qmake
    DEL_FILE      = rm -f
    CHK_DIR_EXISTS= test -d
    MKDIR         = mkdir -p
    COPY          = cp -f
    COPY_FILE     = cp -f
    COPY_DIR      = cp -f -R
    INSTALL_FILE  = cp -f
    INSTALL_PROGRAM = cp -f
    INSTALL_DIR   = cp -f -R
    DEL_FILE      = rm -f
    SYMLINK       = $(QMAKE) -install ln -f -s
    DEL_DIR       = rmdir
    MOVE          = mv -f
    

    so running make produces:

    'test' is not recognized as an internal or external command,
    operable program or batch file.
    The syntax of the command is incorrect.
    makefile:39: recipe for target 'sub-src-make_first' failed
    mingw32-make: *** [sub-src-make_first] Error 1
    

    I tried to specify win32-g++ spec to qmake but it still generated bad makefile.

    I tried to make dummy project in Qt Creator referencing static Qt 5.6.0 and this compiles.



  • Hi @MartinD,

    'test' is not recognized as an internal or external command

    That doesn't sound like a problem with the Makefile, but rather the environment / shell that you're executing make in. Since you're using MinGW, test should be an executable program provided by the MinGW installation.

    If you run test from the same shell that you run mingw32-make, what do you get?

    Are you using the shell that came with MinGW? (not the Windows Command shell)

    Cheers.



  • Same problem with Qt 5.9.7 and MinGW-w64 8.1. There is no test executable provided by the MinGW installation. Also, there is no shell coming with MinGW. The shell is part of MSYS2, but we should be able to use MinGW without having to install MSYS2.

    Edit: found the solution so I'll post it here. As I said, MinGW should compile Qt without relying on MSYS2, but it needs a little tweak.

    1. Edit mkspecs\features\spec_post.prf
    2. Look for the following test:
      equals(MAKEFILE_GENERATOR, MSBUILD) \
      |equals(MAKEFILE_GENERATOR, MSVC.NET) \
      |isEmpty(QMAKE_SH) \
    3. Add the following line just below: |equals(MAKEFILE_GENERATOR, MINGW) \
      The test should look like this:
      equals(MAKEFILE_GENERATOR, MSBUILD) \
      |equals(MAKEFILE_GENERATOR, MSVC.NET) \
      |isEmpty(QMAKE_SH) \
      |equals(MAKEFILE_GENERATOR, MINGW) \
    4. Launch configure, then mingw32-make and everything should work.

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.