[rtems-examples PATCH v2 2/2] filesystem: Add checks for rtems-bin2c

Vijay Kumar Banerjee vijaykumar9597 at gmail.com
Wed Mar 18 09:43:11 UTC 2020


---
 file_io/crc/wscript            | 23 ++++++++++++-----------
 filesystem/fat_ramdisk/wscript | 18 +++++++++---------
 2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/file_io/crc/wscript b/file_io/crc/wscript
index 531da20..45384a9 100644
--- a/file_io/crc/wscript
+++ b/file_io/crc/wscript
@@ -26,14 +26,15 @@ def build(bld):
     #
     # Package the root file system as a C file.
     #
-    rootfs.build_from_src_root(bld,
-                               name = 'fs-root',
-                               root = 'rootfs')
-
-    bld(features = 'c cprogram',
-        target = 'crc.exe',
-        includes = bld.includes,
-        defines = bld.defines,
-        source = ['init.c',
-                  'fs-root-tar.c',
-                  'crc_32.c'])
+    if rtems.check_env(bld, 'RTEMS_BIN2C'):
+        rootfs.build_from_src_root(bld,
+                                   name = 'fs-root',
+                                   root = 'rootfs')
+
+        bld(features = 'c cprogram',
+            target = 'crc.exe',
+            includes = bld.includes,
+            defines = bld.defines,
+            source = ['init.c',
+                      'fs-root-tar.c',
+                      'crc_32.c'])
diff --git a/filesystem/fat_ramdisk/wscript b/filesystem/fat_ramdisk/wscript
index a980187..ecf216f 100644
--- a/filesystem/fat_ramdisk/wscript
+++ b/filesystem/fat_ramdisk/wscript
@@ -26,17 +26,17 @@ def build(bld):
     #
     # Package the root file system as a C file.
     #
-    rootfs.build_from_src_root(bld,
-                               name = 'fs-root',
-                               root = 'rootfs')
+    if rtems.check_env(bld, 'RTEMS_BIN2C', 'RTEMS_TLD'):
+        rootfs.build_from_src_root(bld,
+                                   name = 'fs-root',
+                                   root = 'rootfs')
 
-    bld(features = 'c cprogram',
-        target = 'fat_ramdisk.exe',
-        includes = bld.includes,
-        defines = bld.defines,
-        source = ['init.c', 'fs-root-tar.c'])
+        bld(features = 'c cprogram',
+            target = 'fat_ramdisk.exe',
+            includes = bld.includes,
+            defines = bld.defines,
+            source = ['init.c', 'fs-root-tar.c'])
 
-    if rtems.check_env(bld, 'RTEMS_TLD'):
         bld(features = 'c rtrace',
             target = 'fat_ramdisk.texe',
             includes = bld.includes,
-- 
2.21.1



More information about the devel mailing list