blob: 8c73cf6218ce98e96077cf91d79298db717a30fa [file] [log] [blame]
developer825ab6a2023-01-18 13:58:01 +08001#!/usr/bin/python3 -u
2import argparse
3import os
4import sys
5import traceback
6
7__author__ = "Sam Shih <sam.shih@medaitek.com>"
8__copyright__ = "Copyright 2023, MediaTek Inc"
9
10
11
developer4914e572023-01-30 10:22:29 +080012def create_inc_file(config,output):
developer825ab6a2023-01-18 13:58:01 +080013 f = open(config, "r")
14 data = f.read()
15 f.close()
developer4914e572023-01-30 10:22:29 +080016 out = "PKG_MAKE_FLAGS_%s= \" \\\n"% output
developer825ab6a2023-01-18 13:58:01 +080017
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 += " \""
developer4914e572023-01-30 10:22:29 +080026 f = open("%s.inc"% output, "w")
developer825ab6a2023-01-18 13:58:01 +080027 f.write(out)
28 f.close()
29
30
31
developer4914e572023-01-30 10:22:29 +080032create_inc_file (sys.argv[1], sys.argv[2])