(path)
| 238 | |
| 239 | |
| 240 | def CreateMakeFile(path): |
| 241 | |
| 242 | global makefile |
| 243 | global base_path |
| 244 | |
| 245 | target_list = [] |
| 246 | library_list = [] |
| 247 | elibrary_list = [] |
| 248 | binary_list = [] |
| 249 | |
| 250 | lib_count = 0 |
| 251 | |
| 252 | makefile_define_path = "%s/%s" % (path, include_makefile_name) |
| 253 | makefile_path = "%s/%s" % (path, makefile_name) |
| 254 | |
| 255 | makefile = open(makefile_path, "w"); |
| 256 | makefile.write("SRC_BASE_PATH=%s\n\n" % base_path) |
| 257 | if(os.path.exists(makefile_define_path)): |
| 258 | define_makefile_file = open(makefile_define_path) |
| 259 | try: |
| 260 | lines = define_makefile_file.readlines() |
| 261 | for line in lines: |
| 262 | args = line.split('=') |
| 263 | if(len(args) > 1 and args[0] == "allobject"): |
| 264 | target_list = str.strip(args[1]).split(' ') |
| 265 | |
| 266 | for target in target_list: |
| 267 | if(len(target) == 0): |
| 268 | continue |
| 269 | lib_count = lib_count+1 |
| 270 | if(target[0:3] == "lib"): |
| 271 | library_list.append(target[3:-2]) |
| 272 | elif(target[0:4] == "elib"): |
| 273 | elibrary_list.append(target[4:-2]) |
| 274 | else: |
| 275 | binary_list.append(target) |
| 276 | |
| 277 | except: |
| 278 | print "file %s not found:" % makefile_define_path |
| 279 | finally: |
| 280 | define_makefile_file.close() |
| 281 | |
| 282 | makefile.write("all:"); |
| 283 | if( lib_count > 0 ): |
| 284 | for lib in library_list: |
| 285 | makefile.write("lib_%s " %(lib)); |
| 286 | |
| 287 | for lib in elibrary_list: |
| 288 | makefile.write("lib_%s " %(lib)); |
| 289 | |
| 290 | for lib in binary_list: |
| 291 | makefile.write("%s_bin " %(lib)); |
| 292 | |
| 293 | makefile.write("sub_dir"); |
| 294 | else: |
| 295 | makefile.write("sub_dir"); |
| 296 | if( path == base_path ): |
| 297 | makefile.write(" mysql"); |
no test coverage detected