/
makefile.js
52 lines (48 loc) · 1.08 KB
/
makefile.js
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
47
48
49
50
51
52
import('conditional.js');
import('lib/build.js');
function _verbosePrint(obj, silent){
var out = '', i;
switch (typeof obj){
case 'string':
out = '"' + obj.replace(/"/g, function(){ return '\\"'; }) + '"';
break;
case 'object':
out = '{\n';
for (i in obj){
if (obj.hasOwnProperty(i)){
out += '\t"' + i.replace(/"/g, function(){ return '\\"'; }) + '": ';
out += _verbosePrint(obj[i], true);
out += ',\n';
}
}
if (out.length > 2){
out = out.substr(0, out.length - 2) + '\n';
}
out += '}';
break;
default:
out = obj.toString ? obj.toString() : obj;
}
if (!silent){
console.log(out);
}
return out;
}
function all(){
if (all.isUpToDate()){
console.log('Up to date.');
}
var dir = shell('ls', true).split('\n');
dir.splice(dir.length - 1, 1);
_verbosePrint(fileProperties('makefile.js'));
console.log(dir);
try{
shell('cp strange/range hange pange', false);
console.log('This is not how it\'s supposed to work... :/');
} catch(e){
}
}
function onfinish(){
echo('done');
}
Build.createBuild(all, ['bin'], ['makejs.cc']);