From dacb7f365b9bf9125634f949472d74ce735efe60 Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 14 Nov 2014 10:36:23 +0000 Subject: Build SQL embed asm from an m4 macro, not a hacky echo --- p2pvr/Jamfile.jam | 18 +++--------------- p2pvr/embedSql.m4 | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 p2pvr/embedSql.m4 diff --git a/p2pvr/Jamfile.jam b/p2pvr/Jamfile.jam index 6851a3c..07e533a 100644 --- a/p2pvr/Jamfile.jam +++ b/p2pvr/Jamfile.jam @@ -45,23 +45,11 @@ type.register SQL : sql ; generators.register-standard sql.embed.asm : SQL : ASM ; +path-constant root : . ; + actions sql.embed.asm { - echo ".section .rodata - .global sql_$(2:B)_start - .type sql_$(2:B)_start, @object -sql_$(2:B)_start: - .incbin \"$(2)\" - - .global sql_$(2:B)_end - .type sql_$(2:B)_end, @object -sql_$(2:B)_end: - .byte 0 - - .global sql_$(2:B)_len - .type sql_$(2:B)_len, @object -sql_$(2:B)_len: - .int sql_$(2:B)_end - sql_$(2:B)_start" > $(1) + m4 -DNAME="sql_$(2:B)" -DPATH="$(2)" "$(root)/embedSql.m4" > "$(1)" } IMPORT $(__name__) : sql.embed.asm : : sql.embed.asm ; diff --git a/p2pvr/embedSql.m4 b/p2pvr/embedSql.m4 new file mode 100644 index 0000000..d94ee7c --- /dev/null +++ b/p2pvr/embedSql.m4 @@ -0,0 +1,19 @@ +define(`start', NAME`_start') +define(`end', NAME`_end') +define(`len', NAME`_len') +.section .rodata + .global start + .type start, @object +start: + .incbin "PATH" + + .global end + .type end, @object +end: + .byte 0 + + .global len + .type len, @object +len: + .int end - start + -- cgit v1.2.3