Commits

Alex Chi committed 6eb8618

[TASK] add new function to add the include directory to project
[TASK] update compiler
[TASK] update demo.py

  • Participants
  • Parent commits 85a633b

Comments (0)

Files changed (3)

File demo/demo.py

             , [EMakeType.DEBUG, EMakeType.DEPLOY, EMakeType.PROFILE])
         demo = am.solution.newProject('demo', './', EProjectType.EXE)
         demo.addCodeFile('demo.cc', '')
+        demo.addIncPath('incpath1')
+        demo.addIncPath('incpath2')
         print am.makefile()
         am.write('Makefile')
 

File naclautomake/compiler.py

         self.__ostypes__ = ostypes
         self.__projecttype__ = projecttype
 
-    def makefile(self, project):
+    def getAllIncludePath(self, project):
         res = ''
+        if 0 < len(project.incPaths):
+            res = '-I'
+            res += ' -I'.join(project.incPaths)
+        return res
+
+    def mfKey(self, outputpath, codefile):
+        res = 'key'
+        return res
+
+    def mfDependency(self, outputpath, codefile):
+        res = 'dependency'
+        return res
+
+    def mfAllCodeFile(self, project):
+        res = '# compile code'
+        for codefile in project.srcs:
+            res = '\n'.join([res, ': '.join([self.mfKey(project.outputpath, codefile), self.mfDependency(project.outputpath, codefile)])])
+        return res
+
+    def makefile(self, project):
+        res = self.getAllIncludePath(project)
+        res = '\n'.join([res, self.mfAllCodeFile(project)])
         return res

File naclautomake/project.py

         self.__solution__ = solution
         self.__depends__ = []
         self.__bedepends__ = []
-        self.__incinsidepaths__ = []
-        self.__incoutsidepaths__ = []
+        self.__incpaths__ = []
         self.__incs__ = []
         self.__srcs__ = []
 
         self.__bedepends__ = UniqueList(self.__bedepends__)
 
     @property
-    def incInsidePaths(self):
-        return self.__incinsidepaths__
+    def incPaths(self):
+        return self.__incpaths__
 
-    @property
-    def incOutsidePaths(self):
-        return self.__incoutsidepaths__
+    def addIncPath(self, path):
+        self.__incpaths__.append(path)
 
     @property
     def incs(self):