move source files to "src" subdirectory
This commit is contained in:
parent
0579235c93
commit
cd1e26318a
10
SConstruct
10
SConstruct
@ -37,18 +37,14 @@ env.Append(CCFLAGS = ['-O2', '-Wall'])
|
|||||||
if DEBUG:
|
if DEBUG:
|
||||||
env.Append(CCFLAGS = ['-g'])
|
env.Append(CCFLAGS = ['-g'])
|
||||||
|
|
||||||
sources = [Glob('*.cc')]
|
sources = [Glob('src/*.cc'), 'ag_lua.cc', 'sdl_keymap.cc']
|
||||||
if not os.path.exists('ag_lua.cc'):
|
|
||||||
sources.append('ag_lua.cc')
|
|
||||||
if not os.path.exists('sdl_keymap.cc'):
|
|
||||||
sources.append('sdl_keymap.cc')
|
|
||||||
for sd in subdirs:
|
for sd in subdirs:
|
||||||
sources += [Glob(sd + '/*.c'), Glob(sd + '/*.cc')]
|
sources += [Glob(sd + '/*.c'), Glob(sd + '/*.cc')]
|
||||||
|
|
||||||
def F2C(target, source, env):
|
def F2C(target, source, env):
|
||||||
f = open(str(target[0]), 'w')
|
f = open(str(target[0]), 'w')
|
||||||
for s in source:
|
for s in source:
|
||||||
c_name = re.sub(r'\W', '_', str(s))
|
c_name = re.sub(r'\W', '_', str(s).split('/')[-1])
|
||||||
f.write('unsigned char %s[] = {' % c_name)
|
f.write('unsigned char %s[] = {' % c_name)
|
||||||
src = open(str(s), 'r')
|
src = open(str(s), 'r')
|
||||||
s_len = 0
|
s_len = 0
|
||||||
@ -76,7 +72,7 @@ def bt(cmd):
|
|||||||
env.Append(BUILDERS = {'SDLKeymap' : Builder(action = SDLKeymap)})
|
env.Append(BUILDERS = {'SDLKeymap' : Builder(action = SDLKeymap)})
|
||||||
env.Append(BUILDERS = {'F2C' : Builder(action = F2C)})
|
env.Append(BUILDERS = {'F2C' : Builder(action = F2C)})
|
||||||
|
|
||||||
env.F2C('ag_lua.cc', 'ag.lua')
|
env.F2C('ag_lua.cc', 'src/ag.lua')
|
||||||
env.SDLKeymap('sdl_keymap.cc', 'gen-sdl-keymap.pl')
|
env.SDLKeymap('sdl_keymap.cc', 'gen-sdl-keymap.pl')
|
||||||
env.Program(target, sources)
|
env.Program(target, sources)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user