ti-dmai: pass c6accel location to makefile
[openembedded.git] / classes / utility-tasks.bbclass
blob7495d96d2902be9d1e7510b33177e9edb1b5a9c6
1 addtask listtasks
2 do_listtasks[nostamp] = "1"
3 python do_listtasks() {
4         import sys
5         # emit variables and shell functions
6         #bb.data.emit_env(sys.__stdout__, d)
7         # emit the metadata which isnt valid shell
8         for e in d.keys():
9                 if bb.data.getVarFlag(e, 'task', d):
10                         sys.__stdout__.write("%s\n" % e)
13 addtask clean
14 do_clean[dirs] = "${TOPDIR}"
15 do_clean[nostamp] = "1"
16 python do_clean() {
17         """clear the build and temp directories"""
18         dir = bb.data.expand("${WORKDIR}", d)
19         if dir == '//': raise bb.build.FuncFailed("wrong DATADIR")
20         bb.note("removing " + base_path_out(dir, d))
21         os.system('rm -rf ' + dir)
23         dir = "%s.*" % bb.data.expand(bb.data.getVar('STAMP', d), d)
24         bb.note("removing " + base_path_out(dir, d))
25         os.system('rm -f '+ dir)
28 python do_cleanall() {
29     pass
31 do_cleanall[recrdeptask] = "do_clean"
32 addtask cleanall after do_clean
34 addtask rebuild after do_${BB_DEFAULT_TASK}
35 do_rebuild[dirs] = "${TOPDIR}"
36 do_rebuild[nostamp] = "1"
37 python do_rebuild() {
38         """rebuild a package"""
41 addtask distclean
42 do_distclean[dirs] = "${TOPDIR}"
43 do_distclean[nostamp] = "1"
44 python do_distclean() {
45         """clear downloaded sources, build and temp directories"""
47         bb.build.exec_func('do_clean', d)
49         src_uri = bb.data.getVar('SRC_URI', d, 1)
50         if not src_uri:
51                 return
53         for uri in src_uri.split():
54                 if bb.decodeurl(uri)[0] == "file":
55                         continue
57                 try:
58                         local = bb.data.expand(bb.fetch.localpath(uri, d), d)
59                 except bb.MalformedUrl, e:
60                         bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e)
61                 else:
62                         bb.note("removing %s" % base_path_out(local, d))
63                         try:
64                                 if os.path.exists(local + ".md5"):
65                                         os.remove(local + ".md5")
66                                 if os.path.exists(local):
67                                         os.remove(local)
68                         except OSError, e:
69                                 bb.note("Error in removal: %s" % e)
72 addtask checkuri
73 do_checkuri[nostamp] = "1"
74 python do_checkuri() {
75         import sys
77         localdata = bb.data.createCopy(d)
78         bb.data.update_data(localdata)
80         src_uri = bb.data.getVar('SRC_URI', localdata, 1)
82         try:
83                 bb.fetch.init(src_uri.split(),d)
84         except bb.fetch.NoMethodError:
85                 (type, value, traceback) = sys.exc_info()
86                 raise bb.build.FuncFailed("No method: %s" % value)
88         try:
89                 bb.fetch.checkstatus(localdata)
90         except bb.fetch.MissingParameterError:
91                 (type, value, traceback) = sys.exc_info()
92                 raise bb.build.FuncFailed("Missing parameters: %s" % value)
93         except bb.fetch.FetchError:
94                 (type, value, traceback) = sys.exc_info()
95                 raise bb.build.FuncFailed("Fetch failed: %s" % value)
96         except bb.fetch.MD5SumError:
97                 (type, value, traceback) = sys.exc_info()
98                 raise bb.build.FuncFailed("MD5  failed: %s" % value)
99         except:
100                 (type, value, traceback) = sys.exc_info()
101                 raise bb.build.FuncFailed("Unknown fetch Error: %s" % value)
104 addtask checkuriall after do_checkuri
105 do_checkuriall[recrdeptask] = "do_checkuri"
106 do_checkuriall[nostamp] = "1"
107 do_checkuriall() {
108         :
111 addtask fetchall after do_fetch
112 do_fetchall[recrdeptask] = "do_fetch"
113 do_fetchall() {
114         :
117 addtask buildall after do_build
118 do_buildall[recrdeptask] = "do_build"
119 do_buildall() {
120         :