Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bad makefile

Bad makefile

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      1
      • B Offline
        B Offline
        Balyak
        wrote on last edited by Balyak
        #3

        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.
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved