# Homepage: http://rtime.felk.cvut.cz/omk/
# Version: @git-describe@
#
+# Adapted by Tommaso Cucinotta, Scuola Superiore Sant'Anna, Pisa, Italy, for the
+# Project Adaptive Quality of Service Architecture (AQuoSA)
+# More information at: http://aquosa.sourceforge.net
+#
# The OMK build system is distributed under the GNU General Public
# License. See file COPYING for details.
#
# V .. if set to 1, full command text is shown else short form is used
# W .. whole tree - if set to 1, make is always called from the top-level directory
# SUBDIRS .. list of subdirectories intended for make from actual directory
+# kernel_SUBDIRS .. subdirectories within which to propagate kernel targets
+# library_SUBDIRS .. list of subdirectories within which to propagate library targets
+# include_SUBDIRS .. list of subdirectories within which to propagate include pass (defaults to kernel_SUBDIRS + library_SUBDIRS)
+# binary_SUBDIRS .. list of subdirectories within which to propagate binary targets
+# docs_SUBDIRS .. list of subdirectories within which to propagate docs target
+# clean_SUBDIRS .. list of subdirectories within which to propagate clean targets
# default_CONFIG .. list of default config assignments CONFIG_XXX=y/n ...
# We need to ensure definition of sources directory first
SOURCES_DIR := $(shell ( pwd -L ) )
endif
+include $(MAKERULES_DIR)/variables.mk
+
# If we are not called by OMK leaf Makefile...
ifndef MAKERULES_DIR
MAKERULES_DIR := $(abspath $(dir $(filter %Makefile.rules,$(MAKEFILE_LIST))))
ifneq ($(wildcard $(CONFIG_FILE)-default),)
-include $(CONFIG_FILE)-default
else
-ifneq ($(MAKECMDGOALS),default-config)
-$(warning Please, run "make default-config" first)
-endif
+#ifneq ($(MAKECMDGOALS),default-config)
+#$(warning Please, run "make default-config" first)
+#endif
endif
-include $(OUTPUT_DIR)/config.target
+-include $(MAKERULES_DIR)/variables.mk
ifneq ($(wildcard $(CONFIG_FILE)),)
-include $(CONFIG_FILE)
endif #$(CONFIG_FILE_OK)
-CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE))
+CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE)) $(wildcard $(MAKERULES_DIR)/variables.mk)
export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR
OMK_INCLUDED := 1
endif
+all_SUBDIRS=$(kernel_SUBDIRS) $(library_SUBDIRS) $(binary_SUBDIRS) $(docs_SUBDIRS) $(clean_SUBDIRS) $(include_SUBDIRS) $(QT_SUBDIRS)
+include_SUBDIRS+=$(kernel_SUBDIRS) $(library_SUBDIRS)
+
check-make-ver:
@GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | sed -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \
if [ x$$GOOD_MAKE_VERSION != xy ] ; then \
distclean dist-clean:
@$(QUIET_CMD_ECHO) " RM $(COMPILED_DIR_NAME) $(BUILD_DIR_NAME)"
- @rm -fr $(OUTPUT_DIR)/$(COMPILED_DIR_NAME) $(OUTPUT_DIR)/$(BUILD_DIR_NAME)
+ @rm -fr $(OUTPUT_DIR)/$(COMPILED_DIR_NAME) $(OUTPUT_DIR)/$(BUILD_DIR_NAME) autom4te.cache config.log config.log config.status
# Common OMK templates
# ====================
$(foreach subdir,$(EXTRA_RULES_SUBDIRS),$(eval $(call extra_rules_subdir_template,$(subdir))))
-# Usage: $(call omk_pass_template,<pass name>,<build dir>,[<local make flags>],[<local enable condition>])
+# Usage: $(call omk_pass_template,<pass name>,<build dir>,[<local make flags>],[<local enable condition>],[<pass directories>])
define omk_pass_template
.PHONY: $(pass) $(pass)-local $(pass)-check $(pass)-submakes
-$(foreach subdir,$(SUBDIRS),$(eval $(call omk_pass_subdir_template,$(pass),$(2),$(subdir))))
+# Produce in SUBDIRS_NODUPS a set of directories without duplicates
+SUBDIRS_NODUPS:=
+$(foreach x,$(SUBDIRS) $(5),$(eval SUBDIRS_NODUPS:=$(SUBDIRS_NODUPS:$(x)=) $(x)))
+$(foreach subdir,$(SUBDIRS_NODUPS),$(eval $(call omk_pass_subdir_template,$(pass),$(2),$(subdir))))
$(pass):
# Submakes have to be called this way and not as dependecies for pass
# serialization to work
ifneq ($(4)$($(pass)_HOOKS),)
$(pass)-submakes: $(pass)-this-dir
-$(pass)-this-dir: $(foreach subdir,$(SUBDIRS),$(pass)-$(subdir)-subdir)
+$(pass)-this-dir: $(foreach subdir,$(SUBDIRS_NODUPS),$(pass)-$(subdir)-subdir)
+@echo "make[omk]: $(pass) in $(RELATIVE_DIR)"
@$(call mkdir_def,$(2))
+@$(MAKE) $(NO_PRINT_DIRECTORY) SOURCES_DIR=$(SOURCES_DIR) RELATIVE_DIR=$(RELATIVE_DIR) -C $(2) \
RELATIVE_DIR="" SOURCES_DIR=$(OUTPUT_DIR) \
-f $(OUTPUT_DIR)/Makefile default-config-pass
-$(eval $(call omk_pass_template,default-config-pass,$$(LOCAL_BUILD_DIR),,always))
+$(eval $(call omk_pass_template,default-config-pass,$$(LOCAL_BUILD_DIR),,always,))
default-config-pass-local:
# @echo Default config for $(RELATIVE_DIR)