summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3fde8ae)
This variable could be used as replacement for QT_SUBDIRS. Its purpose is
to specify QT .pro files in the current directory to compile. Therefore,
running make in a directory with QT application calls OMK, which in turn
calls qmake with correct parameters and compiles QT application under
_build tree.
-# QT_SUBDIRS .. subdirectories where to build QT applications using qmake
+# QT_PROJECTS .. list of QT .pro file to use for compilation
+# QT_SUBDIRS .. subdirectories where to build QT applications using qmake (depricated)
# QTDIR .. where QT resides
# QTDIR .. where QT resides
+ifneq ($(QT_SUBDIRS)$(QT_PROJECTS),)
-.PHONY: qt-subpass clean-qt distclean-qt
+# Usage: $(call qt_project_template,<.pro_file relative to SOURCES_DIR>)
+define qt_project_template
-# Usage: $(call qt_makefile_template,<qt-subdir>)
-define qt_subdir_template
+.PHONY: qt-subpass-$(1) clean-qt-$(dir $(1))
-$(LOCAL_BUILD_DIR)/$(1)/Makefile: $(wildcard $(SOURCES_DIR)/$(1)/*.pro)
- $(Q)mkdir -p $(LOCAL_BUILD_DIR)/$(1) && \
- cd $(LOCAL_BUILD_DIR)/$(1) && \
+# FIXME: Handle multiple .pro files correctly
+$(LOCAL_BUILD_DIR)/$(dir $(1))Makefile: $(SOURCES_DIR)/$(1)
+ $(Q)mkdir -p $$(dir $$(@)) && cd $$(dir $$(@)) && \
- TOP_DIR=$(OUTPUT_DIR) RELATIVE_DIR=$(RELATIVE_PREFIX)$(1) \
+ TOP_DIR=$(OUTPUT_DIR) \
+ RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir $(1)) \
$(QTDIR:%=QTDIR=%) CC=$(CC) CXX=$(CXX) \
LIBS+="-L$(USER_LIB_DIR)" DESTDIR=$(USER_BIN_DIR) \
INCLUDEPATH+="$(USER_INCLUDE_DIR)" \
QMAKE_LFLAGS="-Wl,-rpath-link,$(USER_LIB_DIR) $$(QMAKE_LFLAGS)" \
$(QTDIR:%=QTDIR=%) CC=$(CC) CXX=$(CXX) \
LIBS+="-L$(USER_LIB_DIR)" DESTDIR=$(USER_BIN_DIR) \
INCLUDEPATH+="$(USER_INCLUDE_DIR)" \
QMAKE_LFLAGS="-Wl,-rpath-link,$(USER_LIB_DIR) $$(QMAKE_LFLAGS)" \
- $(SOURCES_DIR)/$(1)/*.pro
# This horrible substitution is here to properly escape
# -Wl,-rpath,$ORIGIN flags. It includes escaping for make, shell,
# This horrible substitution is here to properly escape
# -Wl,-rpath,$ORIGIN flags. It includes escaping for make, shell,
# Hook to binary pass
binary-pass-submakes: qt-subpass-$(1)
# Hook to binary pass
binary-pass-submakes: qt-subpass-$(1)
-qt-subpass-$(1): $(LOCAL_BUILD_DIR)/$(1)/Makefile
- $(Q)$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(1) \
- RELATIVE_DIR=$(RELATIVE_PREFIX)$(1) -C $(LOCAL_BUILD_DIR)/$(1) || exit 1 ;
+qt-subpass-$(1): $(LOCAL_BUILD_DIR)/$(dir $(1))Makefile
+ $(Q)$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir $(1)) \
+ RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir $(1)) -C $(LOCAL_BUILD_DIR)/$(dir $(1)) || exit 1 ;
-clean-local: clean-qt-$(1)
-clean-qt-$(1): $(LOCAL_BUILD_DIR)/$(1)/Makefile
- @$(QUIET_CMD_ECHO) " QT CLEAN $(1)"
- $(Q)$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(1) \
- RELATIVE_DIR=$(RELATIVE_PREFIX)$(1) \
- -C $(LOCAL_BUILD_DIR)/$(1) clean
- $(Q)rm $(LOCAL_BUILD_DIR)/$(1)/Makefile
+clean-local: clean-qt-$(dir $(1))
+clean-qt-$(dir $(1)): $(LOCAL_BUILD_DIR)/$(dir $(1))Makefile
+ @$(QUIET_CMD_ECHO) " QT CLEAN $(dir $(1))"
+ $(Q)$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir $(1)) \
+ RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir $(1)) \
+ -C $(LOCAL_BUILD_DIR)/$(dir $(1)) clean
+ $(Q)rm $(LOCAL_BUILD_DIR)/$(dir $(1))Makefile
-$(foreach dir,$(QT_SUBDIRS), $(eval $(call qt_subdir_template,$(dir))))
+$(foreach pro,$(QT_PROJECTS), $(eval $(call qt_project_template,$(pro))))
+$(foreach pro,$(foreach dir,$(QT_SUBDIRS), $(wildcard $(dir)/*.pro)), $(eval $(call qt_project_template,$(pro))))
--- /dev/null
+# 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
+
-trap 'rm -f qtapp/Makefile' EXIT
-
touch config.omk-default
QTDIR=/usr/share/qt4
export QTDIR
touch config.omk-default
QTDIR=/usr/share/qt4
export QTDIR
make || error "QT compilation"
[ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
make || error "QT compilation"
[ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
-make clean || error "QT clean"
+make clean || error "QT clean 1"
cp Makefile2.omk Makefile.omk
make || error "QT Compilation in subdir"
[ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
cp Makefile2.omk Makefile.omk
make || error "QT Compilation in subdir"
[ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
-make clean || error "QT clean"
+make clean || error "QT clean 2"
+
+cp Makefile3.omk Makefile.omk
+make || error "QT_PROJECT test "
+[ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
+
+make clean || error "QT clean 3"