developer | 825ab6a | 2023-01-18 13:58:01 +0800 | [diff] [blame] | 1 | #!/usr/bin/python3 -u |
| 2 | import argparse |
| 3 | import os |
| 4 | import sys |
| 5 | import traceback |
| 6 | |
| 7 | __author__ = "Sam Shih <sam.shih@medaitek.com>" |
| 8 | __copyright__ = "Copyright 2023, MediaTek Inc" |
| 9 | |
| 10 | |
| 11 | |
developer | 4914e57 | 2023-01-30 10:22:29 +0800 | [diff] [blame] | 12 | def create_inc_file(config,output): |
developer | 825ab6a | 2023-01-18 13:58:01 +0800 | [diff] [blame] | 13 | f = open(config, "r") |
| 14 | data = f.read() |
| 15 | f.close() |
developer | 4914e57 | 2023-01-30 10:22:29 +0800 | [diff] [blame] | 16 | out = "PKG_MAKE_FLAGS_%s= \" \\\n"% output |
developer | 825ab6a | 2023-01-18 13:58:01 +0800 | [diff] [blame] | 17 | |
| 18 | for line in data.split("\n"): |
| 19 | if "#" not in line: |
| 20 | if "CONFIG_MTK_WIFI7" in line: |
| 21 | out += "\t" |
| 22 | out += (line.replace("_MTK_WIFI7", "")) |
| 23 | out += " \\" |
| 24 | out += "\n" |
| 25 | out += " \"" |
developer | 4914e57 | 2023-01-30 10:22:29 +0800 | [diff] [blame] | 26 | f = open("%s.inc"% output, "w") |
developer | 825ab6a | 2023-01-18 13:58:01 +0800 | [diff] [blame] | 27 | f.write(out) |
| 28 | f.close() |
| 29 | |
| 30 | |
| 31 | |
developer | 4914e57 | 2023-01-30 10:22:29 +0800 | [diff] [blame] | 32 | create_inc_file (sys.argv[1], sys.argv[2]) |