aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.lua
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 /build.lua
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.
Diffstat (limited to 'build.lua')
-rwxr-xr-xbuild.lua6
1 files changed, 4 insertions, 2 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.