0

我有以下项目结构:

/
    general.pro
    a/
        a.pro
        some files
    b/
        b.pro
        some files
    c/
        Makefile
        some files

general.pro是一个TEMPLATE=subdirs风格的 qmake-project。另外两个项目文件是普通/普通的 qmake 项目文件(文件夹 a 和 b)。第三个文件夹(文件夹 c)包含一个内核模块,其内容如下Makefile: http: //pastebin.com/Bv39D6KK

我想知道是否Makefile可以以某种方式将其转换为 qmake 项目文件。如果没有,有没有办法让general.pro项目文件有一个“c”文件夹,其中包含一个也应该运行的 Makefile?

问候

4

1 回答 1

1

I really doubt, you can include Makefile in a .pro file.

Here is my thoughts about what you can do:

  1. If c is your project, you could simply create one more .pro file for it.
  2. If it is not, and you don't need to edit it, you could build it without including into subdirs (if it's a library, you are using in a or b, you still can build it, and then create a .pri file and add includes and libs etc).
  3. If you need it for a build machine or for deploying, you could use build script.
  4. You could use cmake.

Update:

It turns out, there is a solution.

Though, I could not make it work myself, I hope it helps. What you need is to add following lines to a top-level pro file:

mytarget.commands = make -C c
QMAKE_EXTRA_TARGETS += mytarget
PRE_TARGETDEPS += mytarget

Where c is a name of sub-directory, containing Makefile.

于 2013-05-08T18:40:58.387 回答