diff options
| author | randomdan <randomdan@localhost> | 2014-11-14 10:36:23 +0000 | 
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2014-11-14 10:36:23 +0000 | 
| commit | dacb7f365b9bf9125634f949472d74ce735efe60 (patch) | |
| tree | 8957fafd41acab4b58e4bb9fc69ce88cd9db42c5 | |
| parent | Scattering of fixes to remove hacks around paths and fix running the build fr... (diff) | |
| download | p2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.tar.bz2 p2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.tar.xz p2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.zip | |
Build SQL embed asm from an m4 macro, not a hacky echo
| -rw-r--r-- | p2pvr/Jamfile.jam | 18 | ||||
| -rw-r--r-- | p2pvr/embedSql.m4 | 19 | 
2 files changed, 22 insertions, 15 deletions
| 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 + | 
