summaryrefslogtreecommitdiffstats
path: root/book/wscript
blob: e300add56f5f351a2f1c444858bfdfc08761bc6a (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
56
57
58
59
60
61
62
63
from sys import path
from os.path import abspath, exists
path.append(abspath('../common/'))

from waf import cmd_configure, cmd_build

def configure(ctx):
	cmd_configure(ctx)

def build(ctx):

	dirs = [
		"user",
		"rtemsconfig",
		"shell",
		"ada_user",
		"bsp_howto",
		"c_user",
		"cpu_supplement",
		"develenv",
		"filesystem",
		"networking",
		"new_chapters",
		"porting",
		"posix1003_1",
		"posix_users",
		"relnotes"
	]

	p = ctx.path.parent.abspath()
	for dir in dirs:
		if not exists("%s/%s" % (p, dir)):
			ctx.fatal("Directory does not exist: %s/%s" % (p, dir))

	for dir in dirs:
		files = ctx.path.parent.find_node(dir).ant_glob("**/*.rst")
		files = [x for x in files if x.name.find("/build/") == -1]
		ctx.path.get_bld().make_node(dir).mkdir() # dirs

		ctx(
			features    = "subst",
			is_copy     = True,
			source      = files,
			target      = [x.abspath().replace(ctx.srcnode.parent.abspath(), "") for x in files]
		)


	ctx(
		features    = "subst",
		is_copy     = True,
		source      = ctx.srcnode.find_node("index_book.rst"),
		target      = ["index.rst"]
	)


	sub = {
		"VERSION":				"1.0",
		"RELEASE":				"5.0.0",
		"DOC":					"Manual",
		"FILE_DOC":				"rtemsmanual",
	}

	cmd_build(ctx, sub, source_dir="build")