-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove vim and sed dependency for build.
- Loading branch information
1 parent
7ccd0de
commit f78ae6c
Showing
4 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
prog_xxd = find_program('xxd') | ||
prog_sed = find_program('sed') | ||
prog_sh = find_program('sh') | ||
prog_python3 = find_program('python3') | ||
|
||
gen = generator(prog_sh, | ||
gen = generator(prog_python3, | ||
output : '@[email protected]', | ||
arguments : ['@CURRENT_SOURCE_DIR@/gen_c.sh', '@INPUT@'], | ||
arguments : ['@SOURCE_DIR@/util/xxd.py', '@INPUT@'], | ||
capture : true, | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Copyright (c) 2023 Wojciech Graj | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
""" | ||
|
||
import sys | ||
|
||
|
||
if __name__ == "__main__": | ||
filename = sys.argv[1] | ||
varname = f"{filename[3:].replace('.', '_').replace('/', '_').replace('-', '_')}" | ||
with open(filename, "rb") as f: | ||
data = [hex(c) for c in f.read()] | ||
print( | ||
f"const unsigned char {varname}[]={{" | ||
+ ','.join(data) | ||
+ "};" | ||
+ f"\nconst unsigned int {varname}_len={len(data)};" | ||
) |