From 9d095960f0b45a04bb86878834bdfbb032aa41eb Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 10 Apr 2009 16:07:44 +0000 Subject: [PATCH] Add asrc, csrc, cxxsrc, cppasrc taken from the cpu definition in the makefile git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2487 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 22 +++++++++++++++++++--- wizard/const.py | 3 +++ wizard/mktemplates/template.mk | 26 +++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 2c84468a..5d3edd69 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -94,7 +94,7 @@ def mkGenerator(project_info, makefile): mk_data["$cxxflags"] = " ".join(project_info.info("CPU_INFOS")["CXX_FLAGS"]) mk_data["$asflags"] = " ".join(project_info.info("CPU_INFOS")["AS_FLAGS"]) mk_data["$arflags"] = " ".join(project_info.info("CPU_INFOS")["AR_FLAGS"]) - mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) + mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) mk_data["$prefix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[0] mk_data["$suffix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[1] mk_data["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c" @@ -124,6 +124,10 @@ def csrcGenerator(project_info): # file to be included in PCSRC variable pcsrc = [] # files to be included in CPPASRC variable + cppasrc = [] + # files to be included in CXXSRC variable + cxxsrc = [] + # files to be included in ASRC variable asrc = [] # constants to be included at the beginning of the makefile constants = {} @@ -150,13 +154,25 @@ def csrcGenerator(project_info): pcsrc.append(file) for file in dependency_files: csrc.append(file) + for file in project_info.info("CPU_INFOS")["C_SRC"]: + csrc.append(file) + for file in project_info.info("CPU_INFOS")["PC_SRC"]: + pcsrc.append(file) for file in asm_files: - asrc.append(file) + cppasrc.append(file) + for file in project_info.info("CPU_INFOS")["CPPA_SRC"]: + cppasrc.append(file) + for file in project_info.info("CPU_INFOS")["CXX_SRC"]: + cxxsrc.append(file) + for file in project_info.info("CPU_INFOS")["ASRC"]: + asrc.append(file) csrc = " \\\n\t".join(csrc) + " \\" pcsrc = " \\\n\t".join(pcsrc) + " \\" + cppasrc = " \\\n\t".join(cppasrc) + " \\" + cxxsrc = " \\\n\t".join(cxxsrc) + " \\" asrc = " \\\n\t".join(asrc) + " \\" constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + str(value) for key, value in constants.items()]) - return csrc, pcsrc, asrc, constants + return csrc, pcsrc, cppasrc, cxxsrc, asrc, constants def findModuleFiles(module, project_info): # Find the files related to the selected module diff --git a/wizard/const.py b/wizard/const.py index 8fd71619..34873fdf 100644 --- a/wizard/const.py +++ b/wizard/const.py @@ -29,6 +29,9 @@ CPU_DEF = { "AR_FLAGS": [], "LD_FLAGS" : [], "CPPA_SRC" : [], + "CXX_SRC": [], + "ASRC": [], + "C_SRC": [], "SUPPORTED_DRV" : [], "PC_SRC" : [], "CPU_DESC" : [] diff --git a/wizard/mktemplates/template.mk b/wizard/mktemplates/template.mk index 402df258..51688df4 100644 --- a/wizard/mktemplates/template.mk +++ b/wizard/mktemplates/template.mk @@ -47,7 +47,7 @@ $pname_PCSRC = $($pname_WIZARD_PCSRC) $($pname_USER_PCSRC) # Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CPPASRC INSTEAD! $pname_WIZARD_CPPASRC = \ - $asrc + $cppasrc # # Files included by the user. @@ -57,6 +57,30 @@ $pname_USER_CPPASRC = \ # Automatically generated by the wizard. PLEASE DO NOT EDIT! $pname_CPPASRC = $($pname_WIZARD_CPPASRC) $($pname_USER_CPPASRC) +# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CXXSRC INSTEAD! +$pname_WIZARD_CXXSRC = \ + $cxxsrc + # + +# Files included by the user. +$pname_USER_CXXSRC = \ + # + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +$pname_CXXSRC = $($pname_WIZARD_CXXSRC) $($pname_USER_CXXSRC) + +# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_ASRC INSTEAD! +$pname_WIZARD_ASRC = \ + $asrc + # + +# Files included by the user. +$pname_USER_ASRC = \ + # + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +$pname_ASRC = $($pname_WIZARD_ASRC) $($pname_USER_ASRC) + $pname_CFLAGS = $cflags $pname_LDFLAGS = $ldflags $pname_CPPFLAGS = $cppflags -- 2.25.1