scons
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scons [2009/08/11 11:55] – created suapapa | scons [2013/08/03 05:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 윈도에서 scons 설치하기 ====== | ||
+ | *파이썬 2.6.x설치 | ||
+ | *[[http:// | ||
+ | *제어판-> | ||
+ | |||
+ | ====== basic ====== | ||
정적라이브러리 | 정적라이브러리 | ||
<code python> | <code python> | ||
Line 9: | Line 15: | ||
라이브러리와 링크 | 라이브러리와 링크 | ||
<code python> | <code python> | ||
- | Library(’foo’, [’f1.c’, ’f2.c’, ’f3.c’]) | + | Library('foo', ['f1.c', 'f2.c', 'f3.c']) |
- | Program(’prog.c’, LIBS=[’foo’, ’bar’], LIBPATH=’.’) | + | Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.') |
</ | </ | ||
+ | <code python> | ||
+ | Program(' | ||
+ | </ | ||
+ | ====== env ====== | ||
+ | <code python> | ||
+ | env = Environment(FOO = ' | ||
+ | dict = env.Dictionary() | ||
+ | for key in [' | ||
+ | print "key = %s, value = %s" % (key, dict[key]) | ||
+ | </ | ||
+ | <code python> | ||
+ | opt = Environment(CCFLAGS = ' | ||
+ | dbg = Environment(CCFLAGS = ' | ||
+ | o = opt.Object(' | ||
+ | opt.Program(o) | ||
+ | d = dbg.Object(' | ||
+ | dbg.Program(d) | ||
+ | </ | ||
+ | 환경 추가 | ||
+ | <code python> | ||
+ | env.Append(CCFLAGS = " | ||
+ | env.Append(LINKFLAGS = " | ||
+ | </ | ||
+ | |||
+ | ====== install ====== | ||
+ | install 이라는 alias를 생성 | ||
+ | <code python> | ||
+ | env = Environment() | ||
+ | hello = env.Program(' | ||
+ | env.Install('/ | ||
+ | env.Alias(' | ||
+ | </ | ||
+ | 실행하면 요래 | ||
+ | <code bash> | ||
+ | % scons -Q | ||
+ | cc -o hello.o -c hello.c | ||
+ | cc -o hello hello.o | ||
+ | % scons -Q install | ||
+ | Install file: " | ||
+ | </ | ||
+ | ====== custom builder ====== | ||
+ | 외부 명령어 foobuild를 쓸 때 | ||
+ | <code python> | ||
+ | bld = Builder(action = ' | ||
+ | env = Environment(BUILDERS = {' | ||
+ | env.Foo(' | ||
+ | env.Foo(' | ||
+ | </ | ||
+ | 파이썬 코드를 쓸 때 | ||
+ | <code python> | ||
+ | def build_function(target, | ||
+ | # Code to build " | ||
+ | return None | ||
+ | bld = Builder(action = build_function, | ||
+ | env = Environment(BUILDERS = {' | ||
+ | env.Foo(' | ||
+ | </ | ||
+ | ====== references ====== | ||
+ | *[[http:// | ||
+ | *[[http:// | ||
+ | *[[http:// |
scons.1249991709.txt.gz · Last modified: 2013/08/03 05:04 (external edit)