aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-24 12:16:20 +1000
committerDavid Walter Seikel2014-05-24 12:16:20 +1000
commit79602a4b88e4b48922f64d8203524e921eb33b48 (patch)
treec93ff60095d1cbd819cd0cd4d3e74a591aa714fa
parentBig include and libraries clean up. (diff)
downloadSledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.zip
SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.gz
SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.bz2
SledjHamr-79602a4b88e4b48922f64d8203524e921eb33b48.tar.xz
Auto clean the files we build.
-rwxr-xr-xbuild.lua6
-rwxr-xr-xsrc/LuaSL/build.lua2
-rwxr-xr-xsrc/extantz/build.lua3
-rwxr-xr-xsrc/love/build.lua2
4 files changed, 7 insertions, 6 deletions
diff --git a/build.lua b/build.lua
index 4b6c29e..7bbd642 100755
--- a/build.lua
+++ b/build.lua
@@ -16,7 +16,6 @@ pkgConfig = function (what, name)
16end 16end
17 17
18removeFiles = function (dir, files) 18removeFiles = 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
30compileFiles = function (name, dir, files, extras) 29compileFiles = 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'
81if 'nil' == type(args) then 84if '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
14end 14end
15 15
16 16
17removeFiles(dir, {'../../LuaSL', '*.o', '*.output', '*.backup', 'LuaSL_lexer.h', 'LuaSL_lexer.c', 'LuaSL_lemon_yaccer.h', 'LuaSL_lemon_yaccer.c', 'LuaSL_lemon_yaccer.out'}) 17removeFiles(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.
20runCommand('lemon', dir, '../../libraries/lemon/lemon -s -T../../libraries/lemon/lempar.c LuaSL_lemon_yaccer.y') 20runCommand('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
17LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' 17LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux'
18libs = libs .. ' -lIrrlicht -lephysics -lGL -lbz2 -lGuiLua' 18libs = libs .. ' -lIrrlicht -lephysics -lGL -lbz2 -lGuiLua'
19 19
20removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'}) 20removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', '../../media/extantz.edj'})
21removeFiles(dir, {'../../extantz', 'camera.o', 'files.o', 'scenri.o', 'woMan.o'})
22 21
23runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' extantz.edc ../../media/extantz.edj') 22runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' extantz.edc ../../media/extantz.edj')
24runCommand('Irrlicht files', dir, 'g++ ' .. CFLAGS .. ' -ffast-math -c crappisspuke.cpp -o crappisspuke.o ' .. LDFLAGS) 23runCommand('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
14end 14end
15 15
16 16
17removeFiles(dir, {'../../love', '*.o', '../../media/love.edj'}) 17removeFiles(dir, {'../../media/love.edj'})
18 18
19runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') 19runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj')
20compileFiles('../../love', dir, {'love'}, '') 20compileFiles('../../love', dir, {'love'}, '')