]> rtime.felk.cvut.cz Git - omk/sssa.git/blobdiff - snippets/linux
Added export of TARGET_OS and BUILD_OS variables
[omk/sssa.git] / snippets / linux
index b077e30a0161a548e9a5f373c848facda43eec3c..cbfe98192b39b15998c78c3b1d9de98b9ca5459d 100644 (file)
@@ -103,6 +103,9 @@ ifeq ($(TARGET_OS),)
   TARGET_OS := $(BUILD_OS)
 endif
 
+export TARGET_OS
+export BUILD_OS
+
 LOCAL_BUILD_DIR  = $(USER_OBJS_DIR)
 
 # Assign default values to CFLAGS variable. If the variable is defined
@@ -375,9 +378,9 @@ endif
 
 ifdef KERN_RULE_TEMPLATES
 
-$(KERN_LIB_DIR)/kernel.mk: $(LINUX_DIR)/.config $(OUTPUT_DIR)/kernelcfg2mk
+$(KERN_LIB_DIR)/kernel.mk: $(LINUX_DIR)/.config $(MAKERULES_DIR)/kernelcfg2mk
        @$(QUIET_CMD_ECHO) "  KCFG2MK $$@"
-       $(Q) $(OUTPUT_DIR)/kernelcfg2mk $(LINUX_DIR) $(KERN_LIB_DIR)
+       $(Q) $(MAKERULES_DIR)/kernelcfg2mk $(LINUX_DIR) $(KERN_LIB_DIR)
 
 ifeq ($(CONFIG_RTLINUX),y)
 include $(RTL_DIR)/rtl.mk
@@ -654,7 +657,7 @@ $(eval $(call omk_pass_template, binary-pass, $(USER_OBJS_DIR),USER_RULE_TEMPLAT
 
 $(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))
+$(eval $(call omk_pass_template,include-pass,$(USER_OBJS_DIR),USER_RULE_TEMPLATES=y,always))
 
 check-dir:
        @$(call mkdir_def,$(USER_BUILD_DIR))
@@ -671,13 +674,13 @@ check-dir:
 
 install-local:                 # TODO
 
-include-pass-local:
-       $(call include-pass-template,$(USER_INCLUDE_DIR),include)
-       $(call include-pass-template,$(KERN_INCLUDE_DIR),kernel)
+$(eval $(call include-pass-template,$(USER_INCLUDE_DIR),include))
+$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),kernel))
 ifeq ($(CONFIG_RTLINUX),y)
-       $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux)
+$(eval $(call include-pass-template,$(KERN_INCLUDE_DIR),rtlinux))
 endif
 
+
 ifdef USER_RULE_TEMPLATES
 
 # User-space static libraries and applications object files
@@ -742,7 +745,7 @@ endif
 
 clean-local: clean-custom
        @echo Cleaning in $(KERN_OBJS_DIR) and $(USER_OBJS_DIR)
-       @rm -f $(KERN_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.lo \
+       @rm -f $(KERN_OBJS_DIR)/*.o $(USER_OBJS_DIR)/*.[och] $(USER_OBJS_DIR)/*.lo\
               $(KERN_OBJS_DIR)/*.d $(USER_OBJS_DIR)/*.d \
               $(KERN_OBJS_DIR)/*.map $(USER_OBJS_DIR)/*.map \
               $(KERN_OBJS_DIR)/*.mod.c \
@@ -753,7 +756,14 @@ clean-local: clean-custom
            touch -t 200001010101 $(KERN_LIB_DIR)/kernel.mk ; \
        fi
 
-default: extra-rules-subdirs include-pass library-pass binary-pass
+include-pass-submakes: extra-rules-subdirs
+
+# We must go to EXTRA_RULES_SUBDIRS beofre going to any other
+# directory, since the executables compiled in EXTRA_RULES_SUBDIRS
+# might be needed there.
+include-pass-this-dir $(foreach subdir,$(SUBDIRS),include-pass-$(subdir)-subdir): extra-rules-subdirs
+
+default: include-pass library-pass binary-pass
 ifndef OMIT_KERNEL_PASSES
 # Also make kernel passes if not disabled
 default: kernel-lib-pass kernel-pass