From 79602a4b88e4b48922f64d8203524e921eb33b48 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 24 May 2014 12:16:20 +1000 Subject: Auto clean the files we build. --- build.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build.lua') 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) end removeFiles = function (dir, files) - print('clean') for i, v in ipairs(files) do os.execute('rm -f ' .. dir .. '/' .. v) end @@ -30,6 +29,10 @@ end compileFiles = function (name, dir, files, extras) local objects = '' print('\n' .. name) + removeFiles(dir, {name}) + for i, v in ipairs(files) do + removeFiles(dir, {v .. '.o'}) + end for i, v in ipairs(files) do print(' ' .. v) os.execute('cd ' .. dir .. '; gcc ' .. CFLAGS .. ' -c -o ' .. v .. '.o ' .. v .. '.c') @@ -81,7 +84,6 @@ EDJE_FLAGS = '-id ' .. baseDir .. '/media -fd ' .. baseDir .. '/media' if 'nil' == type(args) then -- Building this passes my "holding breath" test, if it can compile while I'm holding my breath, no need for make files. print('_______________ BUILDING lemon _______________') - removeFiles('libraries/lemon', {'*.o', 'lemon'}) compileFiles('lemon', 'libraries/lemon', {'lemon'}, '') print('_______________ BUILDING Irrlicht _______________') -- Irrlicht is an external project that comes with make files anyway, and doesn't otherwise pass the test. -- cgit v1.1