source: trunk/SConstruct @ 211

Last change on this file since 211 was 211, checked in by tim, 13 years ago

added install targets for pyregfi

File size: 2.5 KB
Line 
1import sys
2import distutils.sysconfig
3
4#cflags = '-std=gnu99 -pedantic -Wall'
5cflags = '-std=gnu99 -pedantic -Wall -fvisibility=hidden -ggdb'
6
7
8lib_src = ['lib/regfi.c',
9           'lib/winsec.c',
10           'lib/range_list.c',
11           'lib/lru_cache.c',
12           'lib/void_stack.c']
13
14env = Environment(CFLAGS=cflags,
15                  CPPPATH=['include', '/usr/local/include'],
16                  LIBPATH=['lib', '/usr/local/lib'],
17                  LIBS=['m', 'pthread', 'regfi', 'talloc'])
18
19
20# Libraries
21libregfi_static = env.Library(lib_src)
22libregfi = env.SharedLibrary(lib_src, LIBS=['m','pthread', 'talloc'])
23
24
25# Executables
26reglookup = env.Program(['src/reglookup.c'])
27reglookup_recover = env.Program(['src/reglookup-recover.c'])
28
29
30# Documentation
31#  This only needs to be run during the release/packaging process
32man_fixup = "|sed 's/.SH DESCRIPTION/\\n.SH DESCRIPTION/'"
33man_builder = Builder(action='docbook2x-man --to-stdout $SOURCE'
34                      + man_fixup + '| gzip -9 > $TARGET',
35                      suffix = '.gz',
36                      src_suffix = '.docbook')
37env['BUILDERS']['ManPage'] = man_builder
38
39man_reglookup = env.ManPage('doc/reglookup.1.docbook')
40man_reglookup_recover = env.ManPage('doc/reglookup-recover.1.docbook')
41man_reglookup_timeline = env.ManPage('doc/reglookup-timeline.1.docbook')
42
43
44# Installation
45prefix='/usr/local/'
46env.Install(prefix+'bin', [reglookup, reglookup_recover, 'bin/reglookup-timeline'])
47env.Install(prefix+'lib', [libregfi, libregfi_static])
48env.Install(distutils.sysconfig.get_python_lib()+'/pyregfi', ['python/pyregfi/__init__.py', 'python/pyregfi/structures.py'])
49env.Install(prefix+'include/regfi', Glob('include/*.h'))
50env.Install(prefix+'man/man1', [man_reglookup, man_reglookup_recover,
51                                man_reglookup_timeline])
52
53# Could do this instead, but not sure how to ensure cleanup afterward.
54#from distutils.core import setup
55#setup(name='pyregfi', version='0.1', package_dir={'':'python'}, packages=['pyregfi'])
56
57# User Friendly Targets
58env.Alias('libregfi', libregfi)
59env.Alias('pyregfi', distutils.sysconfig.get_python_lib()+'/pyregfi')
60env.Alias('reglookup', reglookup)
61env.Alias('reglookup-recover', reglookup_recover)
62env.Alias('bin', [reglookup_recover, reglookup])
63env.Alias('doc', [man_reglookup,man_reglookup_recover,man_reglookup_timeline])
64env.Alias('install', [prefix+'bin',
65                      prefix+'lib',
66                      prefix+'include/regfi',
67                      distutils.sysconfig.get_python_lib()+'/pyregfi',
68                      prefix+'man'])
69
70Default('bin', libregfi)
Note: See TracBrowser for help on using the repository browser.