]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/vxworks
check-dir target converted to double-colon rule
[omk.git] / snippets / vxworks
index e3483ddc654e7bd9e4c5849de2faa91eef9ce4ce..988286b9a4f8c4faafd9cbf605866d5acc4bca89 100644 (file)
@@ -7,10 +7,42 @@
 # nobase_include_HEADERS .. public headers copied even with directory part
 # renamed_include_HEADERS .. public headers copied to the different target name
 # bin_PROGRAMS     .. list of the require binary programs
+# test_PROGRAMS    .. list of the test programs
 # utils_PROGRAMS   .. list of the development utility programs
 # xxx_SOURCES      .. list of specific target sources
+# xxx_LIBS         .. list of specific target libraries
 # INCLUDES         .. additional include directories and defines for user-space
 
+ifndef WRENV
+$(error $(shell $(call canttest,WRENV is not defined in config.target)))
+endif
+ifndef WRPACKAGE
+$(error $(shell $(call canttest,WRPACKAGE is not defined in config.target)))
+endif
+ifndef CPU
+$(error $(shell $(call canttest,CPU is not defined in config.target)))
+endif
+ifndef TOOL
+$(error $(shell $(call canttest,TOOL is not defined in config.target)))
+endif
+
+BUILD_DIR_NAME = _build/$(CPU)$(TOOL)
+COMPILED_DIR_NAME = _compiled/$(CPU)$(TOOL)
+GROUP_DIR_NAME =
+
+
+USER_INCLUDE_DIR := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/include
+USER_LIB_DIR     := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/lib
+USER_UTILS_DIR   := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin-utils
+USER_TESTS_DIR   := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin-tests
+USER_BIN_DIR     := $(MAKERULES_DIR)/$(COMPILED_DIR_NAME)/bin
+USER_BUILD_DIR   := $(MAKERULES_DIR)/$(BUILD_DIR_NAME)/rtp
+
+# Note the use of "recursive" =. That's because RELATIVE_DIR is
+# sometimes defined later in 'base'.
+USER_OBJS_DIR    = $(USER_BUILD_DIR)/$(RELATIVE_DIR)
+LOCAL_BUILD_DIR  = $(USER_OBJS_DIR)
+
 .PHONY: check-dir
 
 # Some support to serialize some targets for parallel make
@@ -24,6 +56,15 @@ kernel-modpost-pass: kernel-mod-pass
 kernel-pass: kernel-mod-pass kernel-modpost-pass
 
 override OMK_SERIALIZE_INCLUDED = y
+MAKEOVERRIDES := $(filter-out OMK_SERIALIZE_INCLUDED=n,$(MAKEOVERRIDES))
+endif
+
+# Checks for OMK tester
+ifdef OMK_TESTSROOT
+default-config-pass-check include-pass-check:
+library-pass-check binary-pass-check:
+       @[ -x "$(shell which $(CC))" ] || $(call canttest,Cannot find compiler: $(CC))
+       @[ -x "$(WRENV)" ] || $(call canttest,Cannot execute wrenv script)
 endif
 
 
@@ -128,22 +169,24 @@ endef
 
 $(foreach prog,$(utils_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_UTILS_DIR))))
 
+$(foreach prog,$(test_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_TESTS_DIR))))
+
 $(foreach prog,$(bin_PROGRAMS),$(eval $(call PROGRAM_template,$(prog),$(USER_BIN_DIR))))
 
 $(foreach lib,$(lib_LIBRARIES),$(eval $(call LIBRARY_template,$(lib))))
 
 $(foreach lib,$(shared_LIBRARIES),$(eval $(call SOLIB_template,$(lib))))
 
-OTHER_PASSES = clean install include-pass
-$(eval $(call omk_pass_template,$(OTHER_PASSES),$(USER_OBJS_DIR),,always))
+$(eval $(call omk_pass_template,clean,$(USER_OBJS_DIR),,always))
+$(eval $(call omk_pass_template,install,$(USER_OBJS_DIR),,always))
+$(eval $(call omk_pass_template,include-pass,$(USER_OBJS_DIR),,always))
 
-include-pass-local:
-       $(call include-pass-template,$(USER_INCLUDE_DIR),include)
+$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include))
 
 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)/%.vxe) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%.vxe)
+binary-pass-local: $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%.vxe) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%.vxe) $(utils_PROGRAMS:%=$(USER_UTILS_DIR)/%.vxe)
 
 clean-local:
        @echo Cleaning in $(USER_OBJS_DIR)
@@ -153,14 +196,15 @@ clean-local:
               $(LOCAL_CONFIG_H:%=$(USER_OBJS_DIR)/%)
 
 $(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)))
+$(eval $(call omk_pass_template, binary-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,$(bin_PROGRAMS)$(utils_PROGRAMS)$(test_PROGRAMS)))
 
-check-dir:
+check-dir::
        @$(call mkdir_def,$(USER_BUILD_DIR))
        @$(call mkdir_def,$(USER_INCLUDE_DIR))
        @$(call mkdir_def,$(USER_LIB_DIR))
        @$(call mkdir_def,$(USER_BIN_DIR))
        @$(call mkdir_def,$(USER_UTILS_DIR))
+       @$(call mkdir_def,$(USER_TESTS_DIR))
 
 
 default: include-pass library-pass binary-pass