1 | #cflags = '-std=gnu99 -pedantic -Wall' |
---|
2 | cflags = '-std=gnu99 -pedantic -Wall -ggdb' |
---|
3 | |
---|
4 | |
---|
5 | lib_src = ['lib/regfi.c', |
---|
6 | 'lib/talloc.c', |
---|
7 | 'lib/winsec.c', |
---|
8 | 'lib/range_list.c', |
---|
9 | 'lib/lru_cache.c', |
---|
10 | 'lib/void_stack.c'] |
---|
11 | |
---|
12 | env = Environment(CFLAGS=cflags, |
---|
13 | CPPPATH=['include', '/usr/local/include'], |
---|
14 | LIBPATH=['lib', '/usr/local/lib'], |
---|
15 | LIBS=['m', 'pthread', 'regfi']) |
---|
16 | |
---|
17 | |
---|
18 | # Libraries |
---|
19 | libregfi_static = env.Library(lib_src) |
---|
20 | libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread']) |
---|
21 | |
---|
22 | |
---|
23 | # Executables |
---|
24 | reglookup = env.Program(['src/reglookup.c']) |
---|
25 | reglookup_recover = env.Program(['src/reglookup-recover.c']) |
---|
26 | |
---|
27 | |
---|
28 | # Documentation |
---|
29 | # This only needs to be run during the release/packaging process |
---|
30 | man_fixup = "|sed 's/.SH DESCRIPTION/\\n.SH DESCRIPTION/'" |
---|
31 | man_builder = Builder(action='docbook2x-man --to-stdout $SOURCE' |
---|
32 | + man_fixup + '| gzip -9 > $TARGET', |
---|
33 | suffix = '.gz', |
---|
34 | src_suffix = '.docbook') |
---|
35 | env['BUILDERS']['ManPage'] = man_builder |
---|
36 | |
---|
37 | man_reglookup = env.ManPage('doc/reglookup.1.docbook') |
---|
38 | man_reglookup_recover = env.ManPage('doc/reglookup-recover.1.docbook') |
---|
39 | man_reglookup_timeline = env.ManPage('doc/reglookup-timeline.1.docbook') |
---|
40 | |
---|
41 | |
---|
42 | # Installation |
---|
43 | prefix='/usr/local/' |
---|
44 | env.Install(prefix+'bin', [reglookup, reglookup_recover, 'bin/reglookup-timeline']) |
---|
45 | env.Install(prefix+'lib', [libregfi, libregfi_static]) |
---|
46 | env.Install(prefix+'include/regfi', Glob('include/*.h')) |
---|
47 | env.Install(prefix+'man/man1', [man_reglookup, man_reglookup_recover, |
---|
48 | man_reglookup_timeline]) |
---|
49 | |
---|
50 | |
---|
51 | # User Friendly Targets |
---|
52 | env.Alias('libregfi', libregfi) |
---|
53 | env.Alias('reglookup', reglookup) |
---|
54 | env.Alias('reglookup-recover', reglookup_recover) |
---|
55 | env.Alias('bin', [reglookup_recover, reglookup]) |
---|
56 | env.Alias('doc', [man_reglookup,man_reglookup_recover,man_reglookup_timeline]) |
---|
57 | env.Alias('install', [prefix+'bin', prefix+'lib', prefix+'man']) |
---|
58 | |
---|
59 | Default('bin', libregfi) |
---|