From ce871956069e845e8cd4b1787aa2044f8520de4e Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 18 Apr 2008 18:51:00 +0000 Subject: [PATCH 1/1] Fixed QT compilation from subdirectory and documented QT_SUBDIRS variable darcs-hash:20080418185129-f2ef6-52c01a0f1cd4d998a783ea8e8738e5667a1680bb.gz --- doc/omk-manual.texinfo | 8 ++++++++ snippets/qt | 2 +- tests/qt/{Makefile.omk => Makefile1.omk} | 0 tests/qt/Makefile2.omk | 2 ++ tests/qt/dir/Makefile | 14 ++++++++++++++ tests/qt/dir/Makefile.omk | 1 + tests/qt/runtest | 12 +++++++++++- 7 files changed, 37 insertions(+), 2 deletions(-) rename tests/qt/{Makefile.omk => Makefile1.omk} (100%) create mode 100644 tests/qt/Makefile2.omk create mode 100644 tests/qt/dir/Makefile create mode 100644 tests/qt/dir/Makefile.omk diff --git a/doc/omk-manual.texinfo b/doc/omk-manual.texinfo index c977700..9a5b094 100644 --- a/doc/omk-manual.texinfo +++ b/doc/omk-manual.texinfo @@ -891,6 +891,14 @@ sugest, but also for other Unices and even for Windows. used. If not specified manually, it equals to BUILD_OS. @end defvar +@defvar QT_SUBDIRS + Lists subdirectories with QT project (.pro) file. OMK will generate + there @file{Makefile} by calling @command{qmake} with correct + parameters to interface QT application to the rest of the compilation + tree. Then @command{make} is called there to compile QT + application. Variable @samp{QTDIR} must be set to the directory with + QT instalation (e.g. /usr/share/qt4 on Debian). +@end defvar @node System-Less, RTEMS, Linux, Properties of Specific Makefile.rules diff --git a/snippets/qt b/snippets/qt index 7091df6..b554df4 100644 --- a/snippets/qt +++ b/snippets/qt @@ -21,7 +21,7 @@ qt-subpass: $(foreach dir,$(QT_SUBDIRS), $(SOURCES_DIR)/$(dir)/Makefile) -f $(SOURCES_DIR)/$(dir)/Makefile || exit 1 ;) # Hook to binary pass -binary-pass: qt-subpass +binary-pass-submakes: qt-subpass # Hook to clean pass clean-local: clean-qt diff --git a/tests/qt/Makefile.omk b/tests/qt/Makefile1.omk similarity index 100% rename from tests/qt/Makefile.omk rename to tests/qt/Makefile1.omk diff --git a/tests/qt/Makefile2.omk b/tests/qt/Makefile2.omk new file mode 100644 index 0000000..37acf49 --- /dev/null +++ b/tests/qt/Makefile2.omk @@ -0,0 +1,2 @@ +SUBDIRS = somelib dir + diff --git a/tests/qt/dir/Makefile b/tests/qt/dir/Makefile new file mode 100644 index 0000000..08cf5ff --- /dev/null +++ b/tests/qt/dir/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/tests/qt/dir/Makefile.omk b/tests/qt/dir/Makefile.omk new file mode 100644 index 0000000..4df20f8 --- /dev/null +++ b/tests/qt/dir/Makefile.omk @@ -0,0 +1 @@ +QT_SUBDIRS = ../qtapp diff --git a/tests/qt/runtest b/tests/qt/runtest index 845edc1..8fef771 100755 --- a/tests/qt/runtest +++ b/tests/qt/runtest @@ -4,5 +4,15 @@ source ../functions.sh touch config.omk-default QTDIR=/usr/share/qt4 +export QTDIR [ -d $QTDIR ] || canttest "Can't find QT4 instalation" -make QTDIR=$QTDIR + +cp Makefile1.omk Makefile.omk +make || error "QT compilation" +[ -x qtapp/qtapp ] || error "QT application was not compiled" + +make distclean || error "QT distclean" + +cp Makefile2.omk Makefile.omk +make || error "QT Compilation in subdir" +[ -x qtapp/qtapp ] || error "QT application was not compiled" -- 2.39.2