lds 文件预编译处理

lds文件包含进.c源文件后进行预处理,将预处理结果重新命名为lds

```

# update add_params_from_aostools.cmake with macro and include path

# and call cmake to build

comp_path = os.path.dirname(sys.argv[0])

macro_path = "macro_defines.h"

f = open(macro_path, 'w')

data_list = key_value["macro_list"].split('-D')

for item in data_list:

    k_list = item.split('=')

    if len(k_list) < 2:

        continue

    head = "#ifndef " + k_list[0] + "\n"

    f.write(head)

    data = item.replace('=', "    ")

    f.write("#define "+ data + "\n")

    f.write("#endif\n\n")

f.close()

build_cmd = '%s-gcc %s -imacros %s -E -D__ARM__  -D__ALIGN__=4 -P %s/_ak37e_alios.c -o %s/_ak37e_alios.lds' % (key_value["toolchain"], key_value["cflag"], macro_path, comp_path, comp_path)

print(build_cmd)

ret = os.system(build_cmd) >> 8

if ret != 0:

    exit(ret)

```

你可能感兴趣的:(windows,服务器,linux)