| 1 |
#!/usr/bin/env python3 |
| 2 |
|
| 3 |
import sys, os |
| 4 |
|
| 5 |
if len(sys.argv) != 3: |
| 6 |
print("You is fail.") |
| 7 |
sys.exit(1) |
| 8 |
|
| 9 |
with open(sys.argv[1]) as f: |
| 10 |
val = f.read().strip() |
| 11 |
outdir = sys.argv[2] |
| 12 |
|
| 13 |
outhdr = os.path.join(outdir, 'source%s.h' % val) |
| 14 |
outsrc = os.path.join(outdir, 'source%s.cpp' % val) |
| 15 |
|
| 16 |
with open(outhdr, 'w', encoding='utf-8') as f: |
| 17 |
f.write('int func%s();\n' % val) |
| 18 |
with open(outsrc, 'w', encoding='utf-8') as f: |
| 19 |
f.write('''int func%s() { |
| 20 |
return 0; |
| 21 |
} |
| 22 |
''' % val) |