blob: e0e750e4cb5dd9699d1bdfa90ff4a2103c7f4955 (
plain)
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
53
54
55
|
import os ;
using gcc : : [ os.environ CXX ] ;
import type : register ;
import generators : register-standard ;
project
: requirements
<variant>release:<cflags>"-std=c++0x"
<variant>debug:<cflags>"-W -Wall -Werror -Wwrite-strings -std=c++0x"
<variant>debug:<linkflags>"-Wl,-z,defs"
;
import type ;
import generators ;
import feature ;
import "class" : new ;
import scanner ;
type.register SLICE : ice ;
class slice-scanner : common-scanner
{
rule pattern ( )
{
return "^[ \t]*#[ \t]*include[ ]*[<\"]([^>\"]*)[>\"]" ;
}
}
scanner.register slice-scanner : include ;
type.set-scanner SLICE : slice-scanner ;
class slice-generator : generator
{
import "class" : new ;
rule __init__ ( * : * )
{
generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
rule run ( project name ? : property-set : sources * )
{
#could I register new virtual targets here? The problem is I can't seem to
#be able to get the list of includes that the scanner built from anywhere
return [ generator.run $(project) $(name) : $(property-set) : $(sources) ] ;
}
rule generated-targets ( sources + : property-set : project name ? )
{
return [ generator.generated-targets $(sources) : $(property-set) : $(project) $(name) ] ;
}
}
generators.register [ new slice-generator slice.slice2cpp : SLICE : CPP H ] ;
actions slice.slice2cpp
{
slice2cpp --checksum --output-dir $(1[1]:D) $(2)
}
IMPORT $(__name__) : slice.slice2cpp : : slice.slice2cpp ;
alias all : project2 netfs ytfs ;
|