diff options
author | Lionel Landwerlin <[email protected]> | 2016-10-04 16:19:43 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2016-10-08 02:17:03 +0100 |
commit | 63a366a8813fec3836213cfd5ab006add332ec84 (patch) | |
tree | 1a063ce5fcdaa7bb449c05bedb02ed6ec3894cab /src/intel/Makefile.genxml.am | |
parent | 4d7d9825f34a31368e63c493c28d57c8f84a984c (diff) |
intel: aubinator: generate a standalone binary
Embed the xml files into the binary, so aubinator can be used from any
location.
v2: Split generation packing into another patch (Jason)
Check for xxd (Jason)
v3: Fix out of tree builds (Jason)
Generate custom variable name rather than names generated by xxd
(Lionel)
v4: Move generated _xml.h files to genxml/ (Sirisha)
v5: Remove newline from makefile (Jason)
v6: Add comment on gen*_xml.h creation (Jason)
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/Makefile.genxml.am')
-rw-r--r-- | src/intel/Makefile.genxml.am | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/intel/Makefile.genxml.am b/src/intel/Makefile.genxml.am index f80e2fd3bb8..8d7d4026638 100644 --- a/src/intel/Makefile.genxml.am +++ b/src/intel/Makefile.genxml.am @@ -21,7 +21,7 @@ BUILT_SOURCES += $(GENXML_GENERATED_FILES) -SUFFIXES = _pack.h .xml +SUFFIXES = _pack.h _xml.h .xml $(GENXML_GENERATED_FILES): genxml/gen_pack_header.py @@ -29,6 +29,16 @@ $(GENXML_GENERATED_FILES): genxml/gen_pack_header.py $(MKDIR_GEN) $(PYTHON_GEN) $(srcdir)/genxml/gen_pack_header.py $< > $@ +# xxd generates variable names based on the path of the input file. We +# prefer to generate our own name here, so it doesn't vary from +# in/out-of-tree builds. +%_xml.h: %.xml Makefile + $(MKDIR_GEN) + $(AM_V_GEN) echo -n "static const uint8_t " > $@; \ + sed -e 's,_xml.h,,' <<< "`basename $@`_xml[] = {" >> $@; \ + cat $< | $(XXD) -i >> $@; \ + echo "};" >> $@ + EXTRA_DIST += \ genxml/gen4.xml \ genxml/gen45.xml \ |