# INCLUDES .. additional include directories and defines for user-space
# kernel_INCLUDES .. additional include directories and defines for kernel-space
# rtlinux_INCLUDES .. additional include directories and defines for RT-Linux
-# QT_SUBDIRS .. subdirectories where to build QT applications using qmake
-# QTDIR .. where QT resides
# OMIT_KERNEL_PASSES if defined, all kernel passes are omited
#
# LINUX_DIR .. location of Linux kernel sources
ifneq ($(OMK_SERIALIZE_INCLUDED),y)
include-pass: $(check-dir)
library-pass: include-pass
-binary-pass utils-pass: library-pass
+binary-pass: library-pass
kernel-lib-pass: include-pass
kernel-mod-pass: kernel-lib-pass
kernel-modpost-pass: kernel-mod-pass
# Syntax: $(call PROGRAM_template,<dir>,<executable-name>,<executable-suffix>,<linker-sript>)
+# FIXME: ???????? asi je tu blbej komentar
define PROGRAM_template
USER_IDLS += $$($(1)_SERVER_IDL) $$($(1)_CLIENT_IDL) $$($(1)_IDL)
library-pass-local: $(addprefix $(USER_INCLUDE_DIR)/,$(cmetric_include_HEADERS)) \
$(lib_LIBRARIES:%=$(USER_LIB_DIR)/lib%.a) $(shared_LIBRARIES:%=$(USER_LIB_DIR)/lib%.$(SOLIB_EXT))
-binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%)
-
-utils-pass-local: $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%)
+binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%)
# Special rules for CMETRIC generated headers
#=====================================================================
-$(eval $(call omk_pass_template, kernel-lib-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,-n "$(kernel_LIBRARIES)$(rtlinux_LIBRARIES)"))
-$(eval $(call omk_pass_template, kernel-mod-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,-n "$(kernel_MODULES)$(rtlinux_MODULES)"))
+$(eval $(call omk_pass_template, kernel-lib-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,$(kernel_LIBRARIES)$(rtlinux_LIBRARIES)))
+$(eval $(call omk_pass_template, kernel-mod-pass,$(KERN_OBJS_DIR),KERN_RULE_TEMPLATES=y,$(kernel_MODULES)$(rtlinux_MODULES)))
kernel-modpost-pass:
+@if [ -e "$(KERN_MODPOST_DIR)/module-changes" -o -e "$(KERN_MODPOST_DIR)/modpost-running" ] ; \
-f $(SOURCES_DIR)/Makefile KERN_RULE_TEMPLATES=y KERN_MODPOST_PASS=y $(@:%=%-local) ; \
fi
-define qt_subpass
- +@$(foreach dir, $(QT_SUBDIRS), $(call mkdir_def,$(USER_OBJS_DIR)/$(dir)) ; \
- if [ "$@" != "binary-pass" ] ; then exit 0 ; fi ; \
- if [ ! -e $(SOURCES_DIR)/$(dir)/Makefile ] ; then \
- ( cd $(SOURCES_DIR)/$(dir) ; $$QTDIR/bin/qmake TOP_DIR=$(MAKERULES_DIR) \
- RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) QTDIR=$(QTDIR) CC=$(CC) \
- CXX=$(CXX) || exit 1 ;) ; fi ; \
- $(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(dir) \
- RELATIVE_DIR=$(RELATIVE_PREFIX)$(dir) -C $(SOURCES_DIR)/$(dir) \
- -f $(SOURCES_DIR)/$(dir)/Makefile || exit 1 ;)
-endef
-
-$(eval $(call omk_pass_template, library-pass,$(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,-n "$(lib_LIBRARIES)$(shared_LIBRARIES)"))
-$(eval $(call omk_pass_template, utils-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,-n "$(utils_PROGRAMS)"))
-$(eval $(call omk_pass_template, binary-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,-n "$(bin_PROGRAMS)$(QT_SUBDIRS)",$(qt_subpass)))
+$(eval $(call omk_pass_template, library-pass,$(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,$(lib_LIBRARIES)$(shared_LIBRARIES)))
+$(eval $(call omk_pass_template, binary-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,$(bin_PROGRAMS)$(utils_PROGRAMS)))
OTHER_PASSES = clean install include-pass
-$(eval $(call omk_pass_template,$(OTHER_PASSES), $(USER_OBJS_DIR)))
+$(eval $(call omk_pass_template,$(OTHER_PASSES),$(USER_OBJS_DIR),,always))
# Create directories only for the first time
ifndef CHECK_DIR_DONE
touch -t 200001010101 $(KERN_LIB_DIR)/kernel.mk ; \
fi
+default: $(check-dir) include-pass library-pass binary-pass
ifndef OMIT_KERNEL_PASSES
-kernel-passes = kernel-lib-pass kernel-pass
+# Also make kernel passes if not disabled
+default: kernel-lib-pass kernel-pass
endif
-default: $(check-dir) include-pass library-pass binary-pass utils-pass $(kernel-passes)
# Local Variables:
# mode:makefile