parent
5384a203f3
commit
f0626e6cc1
6 changed files with 50 additions and 0 deletions
@ -0,0 +1,13 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import sys, os |
||||
|
||||
output = sys.argv[1] |
||||
inputs = sys.argv[2:] |
||||
|
||||
with open(output, 'w') as ofile: |
||||
ofile.write('#pragma once\n') |
||||
for i in inputs: |
||||
content = open(i, 'r').read() |
||||
i.write(content) |
||||
i.write('\n') |
@ -0,0 +1,11 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import sys, os |
||||
|
||||
ifile = sys.argv[1] |
||||
ofile = sys.argv[2] |
||||
|
||||
resname = open(ifile, 'r').readline().strip() |
||||
|
||||
templ = 'char %s[] = "%s";\n' |
||||
open(ofile, 'w').write(templ % (resname, resname)) |
@ -0,0 +1,7 @@ |
||||
#include<stdio.h> |
||||
|
||||
#include"alltogether.h" |
||||
|
||||
int main(int argc, char **argv) { |
||||
return 0; |
||||
} |
@ -0,0 +1,17 @@ |
||||
project('generatorcustom', 'c') |
||||
|
||||
creator = find_program('gen.py') |
||||
catter = find_program('catter.py') |
||||
|
||||
gen = generator(creator, |
||||
output: '@BASENAME@.h', |
||||
arguments : ['@INPUT@', '@OUTPUT@']) |
||||
|
||||
hs = gen.process('res1.txt', 'res2.txt') |
||||
|
||||
all_headers_in_one = custom_target('alltogether', |
||||
input : hs, |
||||
output : 'alltogether.h', |
||||
command : [catter, '@INPUT@', '@OUTPUT@']) |
||||
|
||||
executable('proggie', 'main.c', hs) |
@ -0,0 +1 @@ |
||||
res1 |
@ -0,0 +1 @@ |
||||
res2 |
Loading…
Reference in new issue