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