Add a Qmake package to buildroot

2k views Asked by At

I'm trying to add a Qmake package to buildroot, the package is called DummyPgm. I've managed to get it into the menu and select it, but during the build process the Makefile isn't found. I get an error message saying:

>>> dummypgm 0.1.0 Extracting
gzip -d -c /home/kellyj/BuildSystem/buildroot/dl/DummyPgm-0.1.0.tar.gz | tar --strip-components=1 -C /home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0  -xf -

>>> dummypgm 0.1.0 Patching

>>> dummypgm 0.1.0 Configuring
/home/kellyj/BuildSystem/buildroot/output/host/usr/bin/qmake -o Makefile -v /home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0/MsgDisplay.pro
QMake version 3.0
Using Qt version 5.3.1 in /home/kellyj/BuildSystem/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib

>>> dummypgm 0.1.0 Building
/usr/bin/make -j3 -C /home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0
make[1]: Entering directory `/home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0'
make: *** [/home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0/.stamp_built] Error 2

My .mk file contains the following:

DUMMYPGM_VERSION = 0.1.0
DUMMYPGM_SOURCE = DummyPgm-$(DUMMYPGM_VERSION).tar.gz
DUMMYPGM_INSTALL_STAGING = YES
DUMMYPGM_INSTALL_TARGET = YES

define DUMMYPGM_CONFIGURE_CMDS
    $(HOST_DIR)/usr/bin/qmake -o Makefile -v $(@D)/MsgDisplay.pro
endef

define DUMMYPGM_BUILD_CMDS
    $(MAKE) -C $(@D)
endef

define DUMMYPGM_INSTALL_TARGET_CMDS
    install -D -m 0755 $(@D)
$(TARGET_DIR)/usr/bin/MsgDisplay
endef

$(eval $(generic-package))

It seems that the Makefile is never created, or at least that it is created in the wrong place. The directory output/build/dummypgm-0.1.0 contains these files:

MsgDisplay.pri  MsgDisplay.pro  MsgDisplay.pro.user  MsgHandler.cpp  MsgHandler.h  MsgServer.cpp  MsgServer.h  Tcp  Tools  main.cpp

so MsgDisplay.pro is present.

I've tried running the command /home/kellyj/BuildSystem/buildroot/output/host/usr/bin/qmake -o Makefile -v /home/kellyj/BuildSystem/buildroot/output/build/dummypgm-0.1.0/MsgDisplay.pro by hand in my home area and I see no error message, but no Makefile is produced.

If someone could help me figure this out I'd be extremely grateful.

1

There are 1 answers

0
Thomas Petazzoni On

Yes, this part of your code is wrong:

define DUMMYPGM_CONFIGURE_CMDS
    $(HOST_DIR)/usr/bin/qmake -o Makefile -v $(@D)/MsgDisplay.pro
endef

It may not be obvious at first sight, but you have to realize that all commands are executed in the top-level source directory of Buildroot. So I suspect you most likely overwrite the main Buildroot Makefile, instead of creating the Makefile in output/build/dummypgm-0.1.0 as you expected.

You should therefore do like is done in the QWT package in Buildroot (see package/qwt/qwt.mk):

define DUMMYPGM_CONFIGURE_CMDS
    (cd $(@D); $(TARGET_MAKE_ENV) $(QT_QMAKE))
endef

This will go into the output/build/dummypgm-0.1.0 (i.e $(@D)) and will invoke qmake from there. QT_QMAKE is a variable made available by Buildroot to allow other packages to call qmake with the proper arguments.