makefile = directory + "/Makefile"
if os.path.exists(makefile):
os.remove(makefile)
- shutil.copy(sourcesDir + "/Makefile", makefile)
+ makefile = open("mktemplates/Makefile").read()
+ makefile = makefileGenerator(makefile)
+ open(directory + "/Makefile", "w").write(makefile)
## Destination project dir
prjdir = directory + "/" + os.path.basename(directory)
shutil.rmtree(prjdir, True)
## Destinatio mk file
makefile = open("mktemplates/template.mk", "r").read()
makefile = mkGenerator(projectInfos, makefile)
- open(prjdir + "/" + "template.mk", "w").write(makefile)
+ open(prjdir + "/" + "project.mk", "w").write(makefile)
def mkGenerator(projectInfos, makefile):
"""
makefile = makefile.replace(key, mkData[key])
return makefile
+def makefileGenerator(projectInfos, makefile):
+ """
+ Generate the Makefile for the current project.
+ """
+ # TODO: write a general function that works for both the mk file and the Makefile
+ while makefile.find("project_name") != -1:
+ makefile = makefile.replace("project_name", os.path.basename(projectInfos.info("PROJECT_PATH")))
+ return makefile
+
def getSystemPath():
path = os.environ["PATH"]
if os.name == "nt":
--- /dev/null
+#
+# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+# Set to 1 for verbose build output, 0 for terse output
+V := 0
+
+default: all
+
+include bertos/config.mk
+
+include project_name/project_name.mk
+
+include bertos/rules.mk