Qmake: generate include another makefile in makefile

Is there a way to tell qmake to add an include directive in the Makefile to include another Makefile.

I need to add one line at the beginning of the generated Makefile:

enable custom.inc

Perhaps there is only a way to output text in Makfiles from qmake, but I could not find.

+4
source share
3 answers

You can use the undocumented variable QMAKE_EXTRA_INCLUDES , for example

QMAKE_EXTRA_INCLUDES += /path/to/your/file.mk

+1
source

you can define a new target in the make file and then tell what that target does:

 mytarget.target = .buildfile mytarget.commands = make -f AnotherMakeFile QMAKE_EXTRA_TARGETS += mytarget PRE_TARGETDEPS += .buildfile 

the last 2 statements add your target .build to the Makefile and mytarget for the Qt compilation process.

here you can get more information: http://qt-project.org/doc/qt-4.8/qmake-environment-reference.html

0
source

I did not find a way to enable the Makefile, but I had a similar problem when I wanted a single file to contain a common set of build variables. The solution I came up with was to use the QMake include(filename.pro) command (see the QMake help page ). This causes QMake to include another project file. In my case, it contained all the general settings.

0
source

Source: https://habr.com/ru/post/1439290/


All Articles