]> rtime.felk.cvut.cz Git - omk.git/blobdiff - snippets/linux
Suppress warning the address of __this_module will always evaluate as true.
[omk.git] / snippets / linux
index f79f7582d883114ac0238093b2cf25cecb960935..4c071d62568e7e7d09b1e74459887c33b55abb2b 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
@@ -430,7 +433,7 @@ KERN_AR = $(AR)
 endif
 ifeq ($(LINUX_QUOTE_MODNAME),y)
 KERN_MQ=\"
-KERN_KBUILD_MODNAME=-D"KBUILD_MODNAME=((THIS_MODULE)?(THIS_MODULE)->name:NULL)"
+KERN_KBUILD_MODNAME=-D"KBUILD_MODNAME=((THIS_MODULE)!=NULL?(THIS_MODULE)->name:NULL)"
 endif
 endif # CONFIG_RTLINUX
 
@@ -671,13 +674,13 @@ check-dir:
 
 install-local:                 # TODO
 
-include-pass-local: $(include_GEN_HEADERS)
-       $(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
@@ -754,6 +757,12 @@ clean-local: clean-custom
        fi
 
 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