diff options
author | David Walter Seikel | 2014-05-24 12:16:20 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-24 12:16:20 +1000 |
commit | 79602a4b88e4b48922f64d8203524e921eb33b48 (patch) | |
tree | c93ff60095d1cbd819cd0cd4d3e74a591aa714fa | |
parent | Big include and libraries clean up. (diff) | |
download | SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.zip SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.gz SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.bz2 SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.xz |
Auto clean the files we build.
-rwxr-xr-x | build.lua | 6 | ||||
-rwxr-xr-x | src/LuaSL/build.lua | 2 | ||||
-rwxr-xr-x | src/extantz/build.lua | 3 | ||||
-rwxr-xr-x | src/love/build.lua | 2 |
4 files changed, 7 insertions, 6 deletions
@@ -16,7 +16,6 @@ pkgConfig = function (what, name) | |||
16 | end | 16 | end |
17 | 17 | ||
18 | removeFiles = function (dir, files) | 18 | removeFiles = function (dir, files) |
19 | print('clean') | ||
20 | for i, v in ipairs(files) do | 19 | for i, v in ipairs(files) do |
21 | os.execute('rm -f ' .. dir .. '/' .. v) | 20 | os.execute('rm -f ' .. dir .. '/' .. v) |
22 | end | 21 | end |
@@ -30,6 +29,10 @@ end | |||
30 | compileFiles = function (name, dir, files, extras) | 29 | compileFiles = function (name, dir, files, extras) |
31 | local objects = '' | 30 | local objects = '' |
32 | print('\n' .. name) | 31 | print('\n' .. name) |
32 | removeFiles(dir, {name}) | ||
33 | for i, v in ipairs(files) do | ||
34 | removeFiles(dir, {v .. '.o'}) | ||
35 | end | ||
33 | for i, v in ipairs(files) do | 36 | for i, v in ipairs(files) do |
34 | print(' ' .. v) | 37 | print(' ' .. v) |
35 | os.execute('cd ' .. dir .. '; gcc ' .. CFLAGS .. ' -c -o ' .. v .. '.o ' .. v .. '.c') | 38 | os.execute('cd ' .. dir .. '; gcc ' .. CFLAGS .. ' -c -o ' .. v .. '.o ' .. v .. '.c') |
@@ -81,7 +84,6 @@ EDJE_FLAGS = '-id ' .. baseDir .. '/media -fd ' .. baseDir .. '/media' | |||
81 | if 'nil' == type(args) then | 84 | if 'nil' == type(args) then |
82 | -- Building this passes my "holding breath" test, if it can compile while I'm holding my breath, no need for make files. | 85 | -- Building this passes my "holding breath" test, if it can compile while I'm holding my breath, no need for make files. |
83 | print('_______________ BUILDING lemon _______________') | 86 | print('_______________ BUILDING lemon _______________') |
84 | removeFiles('libraries/lemon', {'*.o', 'lemon'}) | ||
85 | compileFiles('lemon', 'libraries/lemon', {'lemon'}, '') | 87 | compileFiles('lemon', 'libraries/lemon', {'lemon'}, '') |
86 | print('_______________ BUILDING Irrlicht _______________') | 88 | print('_______________ BUILDING Irrlicht _______________') |
87 | -- Irrlicht is an external project that comes with make files anyway, and doesn't otherwise pass the test. | 89 | -- Irrlicht is an external project that comes with make files anyway, and doesn't otherwise pass the test. |
diff --git a/src/LuaSL/build.lua b/src/LuaSL/build.lua index 0878e3d..0bd376c 100755 --- a/src/LuaSL/build.lua +++ b/src/LuaSL/build.lua | |||
@@ -14,7 +14,7 @@ if 'nil' == type(dir) then | |||
14 | end | 14 | end |
15 | 15 | ||
16 | 16 | ||
17 | removeFiles(dir, {'../../LuaSL', '*.o', '*.output', '*.backup', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) | 17 | removeFiles(dir, {'*.output', '*.backup', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) |
18 | 18 | ||
19 | -- Run lemon first, flex depends on it to define the symbol values. | 19 | -- Run lemon first, flex depends on it to define the symbol values. |
20 | runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') | 20 | runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') |
diff --git a/src/extantz/build.lua b/src/extantz/build.lua index 90caca5..c2990ff 100755 --- a/src/extantz/build.lua +++ b/src/extantz/build.lua | |||
@@ -17,8 +17,7 @@ CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/inc | |||
17 | LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' | 17 | LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' |
18 | libs = libs .. ' -lIrrlicht -lephysics -lGL -lbz2 -lGuiLua' | 18 | libs = libs .. ' -lIrrlicht -lephysics -lGL -lbz2 -lGuiLua' |
19 | 19 | ||
20 | removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'}) | 20 | removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', '../../media/extantz.edj'}) |
21 | removeFiles(dir, {'../../extantz', 'camera.o', 'files.o', 'scenri.o', 'woMan.o'}) | ||
22 | 21 | ||
23 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' extantz.edc ../../media/extantz.edj') | 22 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' extantz.edc ../../media/extantz.edj') |
24 | runCommand('Irrlicht files', dir, 'g++ ' .. CFLAGS .. ' -ffast-math -c crappisspuke.cpp -o crappisspuke.o ' .. LDFLAGS) | 23 | runCommand('Irrlicht files', dir, 'g++ ' .. CFLAGS .. ' -ffast-math -c crappisspuke.cpp -o crappisspuke.o ' .. LDFLAGS) |
diff --git a/src/love/build.lua b/src/love/build.lua index 8fd9a29..b3911cd 100755 --- a/src/love/build.lua +++ b/src/love/build.lua | |||
@@ -14,7 +14,7 @@ if 'nil' == type(dir) then | |||
14 | end | 14 | end |
15 | 15 | ||
16 | 16 | ||
17 | removeFiles(dir, {'../../love', '*.o', '../../media/love.edj'}) | 17 | removeFiles(dir, {'../../media/love.edj'}) |
18 | 18 | ||
19 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') | 19 | runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') |
20 | compileFiles('../../love', dir, {'love'}, '') | 20 | compileFiles('../../love', dir, {'love'}, '') |