[examples-v2 commit] filesystem: Update wscript. compiles now to make it better
Gedare Bloom
gedare at rtems.org
Thu Dec 12 19:49:53 UTC 2013
Module: examples-v2
Branch: master
Commit: defab8351192623a507afc6124176c7cd4807a67
Changeset: http://git.rtems.org/examples-v2/commit/?id=defab8351192623a507afc6124176c7cd4807a67
Author: Gedare Bloom <gedare at rtems.org>
Date: Fri Nov 22 17:08:24 2013 -0500
filesystem: Update wscript. compiles now to make it better
---
filesystem/fat_ramdisk/wscript | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/filesystem/fat_ramdisk/wscript b/filesystem/fat_ramdisk/wscript
index d480ee5..ace27cc 100644
--- a/filesystem/fat_ramdisk/wscript
+++ b/filesystem/fat_ramdisk/wscript
@@ -6,9 +6,24 @@
# Waf build script for RTEMS fat_ramdisk
import rtems_waf.rtems as rtems
-
+import os
version = "1.0.0"
+## TODO: Move this somewhere more general
+from waflib.Task import Task
+from waflib.TaskGen import extension
+
+class bin2c(Task):
+ run_str = 'rtems-bin2c ${SRC} ${TGT[0].abspath()} && touch ${TGT[1].abspath()}'
+ ext_out = ['.h']
+
+ at extension('FilesystemImage')
+def process_tarfs(self, node):
+ c_node = node.change_ext('.c')
+ h_node = node.change_ext('.h')
+ self.create_task('bin2c', node, [c_node, h_node])
+ self.source.append(c_node)
+
def build(bld):
rtems.build(bld)
@@ -22,18 +37,14 @@ def build(bld):
#
bld.includes = ['.']
bld.defines = ['PACKAGE_VERSION="' + version + '"']
-
- generate_fs = 'cd rootfs ; tar cf ../FilesystemImage .'
- generate_fs = generate_fs + ' ; cd .. ; '
- generate_fs = generate_fs + 'rtems-bin2c FilesystemImage FilesystemImage'
- bld(rule=generate_fs,
- source='rootfs/shell-init',
- target=['FilesystemImage.c','FilesystemImage.h'])
+ bld(rule='tar -C ' + bld.path.find_dir('rootfs').abspath() + \
+ ' -cf ${TGT} .',
+ target='FilesystemImage')
bld(features = 'c cprogram',
target = 'fat_ramdisk.exe',
includes = bld.includes,
defines = bld.defines,
cflags = cflags,
- source = ['init.c', 'FilesystemImage.c', 'FilesystemImage.h'])
+ source = 'init.c FilesystemImage')
More information about the vc
mailing list