Commits

Alex Chi committed 4d6aebc

[TASK] add some function to make the makefile can compile with external library and include path

Comments (0)

Files changed (1)

naclautomake/__init__.py

         self.__IncludePaths = ''
         self.__NaClIncludePath = '-idirafter $(NACL_SDK_ROOT)/include'
 
+    def add(self, value):
+        self.__IncludePaths += ' -I' + value
+
     def addFromSelf(self, value):
         self.__IncludePaths += ' -I$(SOLUCTION_PATH)/' + value
 
             res = linkString(res, '/'.join([self.__Paths[index], 'lib' + self.__Libs[index] + '_x86_' + x86_xx + '.a']), ' ')
         return res
 
+    def add(self, path, lib):
+        self.__Paths.append(path + '/$(TOOLCHAIN)/$(MAKE_TYPE)')
+        self.__Libs.append(lib)
+
     def addFromSelf(self, path, lib):
         self.__Paths.append('$(SOLUCTION_PATH)/out/' + path + '/$(TOOLCHAIN)/$(MAKE_TYPE)')
         self.__Libs.append(lib)
     def setToolChain(self, value):
         self.__Defines.setToolChain(value)
 
+    def include(self, value):
+        self.__IncludePaths.add(value);
+
     def includeFromSelf(self, value):
-        self.__IncludePaths.addFromSelf(value)
+        self.__IncludePaths.add(value)
+
+    def library(self, path, lib):
+        self.__Libraries.add(path, lib)
 
     def libraryFromSelf(self, path, lib):
         self.__Libraries.addFromSelf(path, lib)