File: methods.py

package info (click to toggle)
cheesetracker 0.9.9-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,584 kB
  • ctags: 6,585
  • sloc: cpp: 43,276; python: 315; makefile: 54; ansic: 6
file content (46 lines) | stat: -rwxr-xr-x 999 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def make_targets(self, object_list, source_list=[], debug=0):

	import glob
	import string
	import re

	if source_list == []:
		dir = self.Dir('.').abspath
		if self.build_dir:

			## strip build_dir from cwd for glob
			edir = '^' + re.escape(self.Dir('#').abspath) + r'[/\\]' + re.escape(self.build_dir)

			dir = re.sub(edir, '', dir)
			dir = self.Dir('#').abspath + dir
			
			stmp = glob.glob(dir + "/*.cpp")

			## add build_dir to cwd for Object
			sources = []
			for src in stmp:
				obj = re.search(r'[/\\]([^/\\]*)$', src)
				file = self.Dir('.').abspath + obj.group(0)
				sources.append(file)
		else:
			sources = glob.glob(dir + "/*.cpp")
		
	else:
		sources = []
		for src in source_list:
			sources.append(self.Dir('.').abspath + '/' + src)

	for file in sources:

		sobject = file[:-4] + self['OBJSUFFIX']
		if sobject in object_list:
			continue

		if (self.make_so):
			self.SharedObject(file[:-4], file)
		else:
			self.Object(file[:-4], file)

		object_list.append(sobject)