# VERSION file
self._writeVersionFile(os.path.join(self.maindir, "VERSION"))
# Destination makefile
- self._writeMakefile(os.path.join(self.maindir, "Makefile"))
+ self._writeMakefile()
# Copy the sources
self._copySources(self.sources_dir, self.srcdir)
# Set properly the autoenabled parameters
# Copy all the configuration files
self._writeCfgFiles(self.sources_dir, self.cfgdir)
# Destination wizard mk file
- self._writeWizardMkFile(os.path.join(self.prjdir, os.path.basename(self.prjdir) + "_wiz.mk"))
+ self._writeWizardMkFile()
def _newCustomBertosProject(self):
# Create/write/copy the common things
# Copy all the hw files
self._writeHwFiles(self.sources_dir, self.hwdir)
# Destination user mk file
- self._writeUserMkFile(os.path.join(self.prjdir, os.path.basename(self.prjdir) + ".mk"))
+ self._writeUserMkFile()
# Destination main.c file
self._writeMainFile(self.prjdir + "/main.c")
# Create project files for selected plugins
# VERSION file
self._writeVersionFile(os.path.join(self.maindir, "VERSION"))
# Destination makefile
- self._writeMakefile(os.path.join(self.maindir, "Makefile"))
+ self._writeMakefile()
# Merge sources
self._mergeSources(self.sources_dir, self.srcdir, self.old_srcdir)
# Copy all the hw files
self._writeHwFiles(self.sources_dir, self.hwdir)
# Destination wizard mk file
- self._writeWizardMkFile(os.path.join(self.prjdir, os.path.basename(self.prjdir) + "_wiz.mk"))
+ self._writeWizardMkFile()
# Set properly the autoenabled parameters
self._setupAutoenabledParameters()
# Copy all the configuration files
f.write(projectFileGenerator(self))
f.close()
- def _writeMakefile(self, filename):
- bertos_utils.makefileGenerator(self, filename)
+ def _writeMakefile(self):
+ bertos_utils.makefileGenerator(self)
- def _writeUserMkFile(self, filename):
- bertos_utils.userMkGenerator(self, filename)
+ def _writeUserMkFile(self):
+ bertos_utils.userMkGenerator(self)
- def _writeWizardMkFile(self, filename):
- bertos_utils.mkGenerator(self, filename)
+ def _writeWizardMkFile(self):
+ bertos_utils.mkGenerator(self)
def _writeMainFile(self, filename):
main = open(os.path.join(const.DATA_DIR, "srctemplates/main.c"), "r").read()
version = bertosVersion(project_info.info("BERTOS_PATH"))
return version_file.replace('$version', version)
-def userMkGenerator(project_info, destination):
- makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template.mk"), "r").read()
+def userMkGenerator(project_info):
+ makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template_user.mk"), "r").read()
+ destination = os.path.join(project_info.prjdir, os.path.basename(project_info.prjdir) + "_user.mk")
# Deadly performances loss was here :(
mk_data = {}
mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH"))
+ mk_data["$ppath"] = os.path.basename(project_info.info("PROJECT_SRC_PATH"))
mk_data["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c"
for key in mk_data:
while makefile.find(key) != -1:
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
-def mkGenerator(project_info, destination):
+def mkGenerator(project_info):
"""
Generates the mk file for the current project.
"""
- makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template_wiz.mk"), "r").read()
+ makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template.mk"), "r").read()
+ destination = os.path.join(project_info.prjdir, os.path.basename(project_info.prjdir) + ".mk")
mk_data = {}
mk_data["$pname"] = project_info.info("PROJECT_NAME")
+ mk_data["$ppath"] = os.path.basename(project_info.info("PROJECT_SRC_PATH"))
mk_data["$cpuclockfreq"] = project_info.info("SELECTED_FREQ")
cpu_mk_parameters = []
for key, value in project_info.info("CPU_INFOS").items():
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
-def makefileGenerator(project_info, destination):
+def makefileGenerator(project_info):
"""
Generate the Makefile for the current project.
"""
makefile = open(os.path.join(const.DATA_DIR, "mktemplates/Makefile"), "r").read()
+ destination = os.path.join(project_info.maindir, "Makefile")
# TODO write a general function that works for both the mk file and the Makefile
- while makefile.find("$pname") != -1:
- makefile = makefile.replace("$pname", project_info.info("PROJECT_NAME"))
+ mk_data = {}
+ mk_data["$pname"] = project_info.info("PROJECT_NAME")
+ mk_data["$ppath"] = os.path.basename(project_info.info("PROJECT_SRC_PATH"))
+ for key in mk_data:
+ while makefile.find(key) != -1:
+ makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
def csrcGenerator(project_info):
import os
from bertos_utils import replaceSeparators, csrcGenerator
-def _userMkGenerator(project_info, destination):
+def _userMkGenerator(project_info):
makefile = open(os.path.join(const.DATA_DIR, "mktemplates/old/template.mk"), "r").read()
+ destination = os.path.join(project_info.prjdir, os.path.basename(project_info.prjdir) + ".mk")
# Deadly performances loss was here :(
mk_data = {}
mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH"))
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
-def _mkGenerator(project_info, destination):
+def _mkGenerator(project_info):
"""
Generates the mk file for the current project.
"""
makefile = open(os.path.join(const.DATA_DIR, "mktemplates/old/template_wiz.mk"), "r").read()
+ destination = os.path.join(project_info.prjdir, os.path.basename(project_info.prjdir) + "_wiz.mk")
mk_data = {}
mk_data["$pname"] = project_info.info("PROJECT_NAME")
mk_data["$cpuclockfreq"] = project_info.info("SELECTED_FREQ")
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
-def _makefileGenerator(project_info, destination):
+def _makefileGenerator(project_info):
"""
Generate the Makefile for the current project.
"""
makefile = open(os.path.join(const.DATA_DIR, "mktemplates/old/Makefile"), "r").read()
+ destination = os.path.join(project_info.maindir, "Makefile")
# TODO write a general function that works for both the mk file and the Makefile
while makefile.find("$pname") != -1:
makefile = makefile.replace("$pname", project_info.info("PROJECT_NAME"))
include bertos/config.mk
-include $pname/$pname.mk
+include $ppath/$pname.mk
include bertos/rules.mk
#
#
-# Programmer interface configuration, see http://dev.bertos.org/wiki/ProgrammerInterface for help
-$pname_PROGRAMMER_TYPE = none
-$pname_PROGRAMMER_PORT = none
+# Constants automatically defined by the selected modules
+$constants
-# Files included by the user.
-$pname_USER_CSRC = \
- $main \
- #
+# Our target application
+TRG += $pname
-# Files included by the user.
-$pname_USER_PCSRC = \
- #
+$pname_PREFIX = "$prefix"
-# Files included by the user.
-$pname_USER_CPPASRC = \
- #
+$pname_SUFFIX = "$suffix"
-# Files included by the user.
-$pname_USER_CXXSRC = \
+# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CSRC INSTEAD!
+$pname_WIZARD_CSRC = \
+ $csrc
#
-# Files included by the user.
-$pname_USER_ASRC = \
+# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_PCSRC INSTEAD!
+$pname_WIZARD_PCSRC = \
+ $pcsrc
#
-# Flags included by the user.
-$pname_USER_LDFLAGS = \
+# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CPPASRC INSTEAD!
+$pname_WIZARD_CPPASRC = \
+ $cppasrc
#
-# Flags included by the user.
-$pname_USER_CPPAFLAGS = \
+# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CXXSRC INSTEAD!
+$pname_WIZARD_CXXSRC = \
+ $cxxsrc
#
-# Flags included by the user.
-$pname_USER_CPPFLAGS = \
- -fno-strict-aliasing \
- -fwrapv \
+# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_ASRC INSTEAD!
+$pname_WIZARD_ASRC = \
+ $asrc
#
-# Include the mk file generated by the wizard
-include $pname/$pname_wiz.mk
+$pname_CPPFLAGS = -D'CPU_FREQ=($cpuclockfreqUL)' -D'ARCH=(ARCH_DEFAULT)' -D'WIZ_AUTOGEN' -I$pname/ $($pname_CPU_CPPFLAGS) $($pname_USER_CPPFLAGS)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_LDFLAGS = $($pname_CPU_LDFLAGS) $($pname_WIZARD_LDFLAGS) $($pname_USER_LDFLAGS)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_CPPAFLAGS = $($pname_CPU_CPPAFLAGS) $($pname_WIZARD_CPPAFLAGS) $($pname_USER_CPPAFLAGS)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_CSRC = $($pname_CPU_CSRC) $($pname_WIZARD_CSRC) $($pname_USER_CSRC)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_PCSRC = $($pname_CPU_PCSRC) $($pname_WIZARD_PCSRC) $($pname_USER_PCSRC)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_CPPASRC = $($pname_CPU_CPPASRC) $($pname_WIZARD_CPPASRC) $($pname_USER_CPPASRC)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_CXXSRC = $($pname_CPU_CXXSRC) $($pname_WIZARD_CXXSRC) $($pname_USER_CXXSRC)
+
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$pname_ASRC = $($pname_CPU_ASRC) $($pname_WIZARD_ASRC) $($pname_USER_ASRC)
+
+# CPU specific flags and options, defined in the CPU definition files.
+# Automatically generated by the wizard. PLEASE DO NOT EDIT!
+$cpuparameters
+
+include $ppath/$pname_user.mk
--- /dev/null
+#
+# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# Makefile template for BeRTOS wizard.
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+#
+
+# Programmer interface configuration, see http://dev.bertos.org/wiki/ProgrammerInterface for help
+$pname_PROGRAMMER_TYPE = none
+$pname_PROGRAMMER_PORT = none
+
+# Files included by the user.
+$pname_USER_CSRC = \
+ $main \
+ #
+
+# Files included by the user.
+$pname_USER_PCSRC = \
+ #
+
+# Files included by the user.
+$pname_USER_CPPASRC = \
+ #
+
+# Files included by the user.
+$pname_USER_CXXSRC = \
+ #
+
+# Files included by the user.
+$pname_USER_ASRC = \
+ #
+
+# Flags included by the user.
+$pname_USER_LDFLAGS = \
+ #
+
+# Flags included by the user.
+$pname_USER_CPPAFLAGS = \
+ #
+
+# Flags included by the user.
+$pname_USER_CPPFLAGS = \
+ -fno-strict-aliasing \
+ -fwrapv \
+ #
+
+# Include the mk file generated by the wizard
+++ /dev/null
-#
-# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
-# All rights reserved.
-#
-# Makefile template for BeRTOS wizard.
-#
-# Author: Lorenzo Berni <duplo@develer.com>
-#
-#
-
-# Constants automatically defined by the selected modules
-$constants
-
-# Our target application
-TRG += $pname
-
-$pname_PREFIX = "$prefix"
-
-$pname_SUFFIX = "$suffix"
-
-# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CSRC INSTEAD!
-$pname_WIZARD_CSRC = \
- $csrc
- #
-
-# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_PCSRC INSTEAD!
-$pname_WIZARD_PCSRC = \
- $pcsrc
- #
-
-# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CPPASRC INSTEAD!
-$pname_WIZARD_CPPASRC = \
- $cppasrc
- #
-
-# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_CXXSRC INSTEAD!
-$pname_WIZARD_CXXSRC = \
- $cxxsrc
- #
-
-# Files automatically generated by the wizard. DO NOT EDIT, USE $pname_USER_ASRC INSTEAD!
-$pname_WIZARD_ASRC = \
- $asrc
- #
-
-$pname_CPPFLAGS = -D'CPU_FREQ=($cpuclockfreqUL)' -D'ARCH=(ARCH_DEFAULT)' -D'WIZ_AUTOGEN' -I$pname/ $($pname_CPU_CPPFLAGS) $($pname_USER_CPPFLAGS)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_LDFLAGS = $($pname_CPU_LDFLAGS) $($pname_WIZARD_LDFLAGS) $($pname_USER_LDFLAGS)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_CPPAFLAGS = $($pname_CPU_CPPAFLAGS) $($pname_WIZARD_CPPAFLAGS) $($pname_USER_CPPAFLAGS)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_CSRC = $($pname_CPU_CSRC) $($pname_WIZARD_CSRC) $($pname_USER_CSRC)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_PCSRC = $($pname_CPU_PCSRC) $($pname_WIZARD_PCSRC) $($pname_USER_PCSRC)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_CPPASRC = $($pname_CPU_CPPASRC) $($pname_WIZARD_CPPASRC) $($pname_USER_CPPASRC)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_CXXSRC = $($pname_CPU_CXXSRC) $($pname_WIZARD_CXXSRC) $($pname_USER_CXXSRC)
-
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$pname_ASRC = $($pname_CPU_ASRC) $($pname_WIZARD_ASRC) $($pname_USER_ASRC)
-
-# CPU specific flags and options, defined in the CPU definition files.
-# Automatically generated by the wizard. PLEASE DO NOT EDIT!
-$cpuparameters