0

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.

James
  • 3,957
  • 4
  • 37
  • 82
  • Have not much experience with QMake, but if it is your own package, you could try CMake instead. Had so far no problems at least with Qt4 and BR. – yegorich Nov 18 '14 at 16:43
  • Unfortunately it's not my package. I am trying to add someone else's package to buildroot. I am not allowed access to their source code and they are reluctant to repackage it. Is repackaging with CMake complicated? I could take another shot at persuading them, but I've had no look so far. – James Nov 18 '14 at 16:47
  • CMake is generally a good instrument. But if it is not going to be repackaged, I'd suggest to post your question on BR's [mailing list](http://buildroot.uclibc.org/support.html). – yegorich Nov 18 '14 at 20:15

1 Answers1

3

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.

Thomas Petazzoni
  • 5,636
  • 17
  • 25