aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-20 16:13:37 +1000
committerDavid Walter Seikel2014-04-20 16:13:37 +1000
commitfd361fdf6bc1c637c7f9391f4c6aea38053f4e6b (patch)
tree21a21727c2ed10086b265f9ca9c867641c64c984 /build.lua
parentAdd breath test comments. (diff)
downloadSledjHamr-fd361fdf6bc1c637c7f9391f4c6aea38053f4e6b.zip
SledjHamr-fd361fdf6bc1c637c7f9391f4c6aea38053f4e6b.tar.gz
SledjHamr-fd361fdf6bc1c637c7f9391f4c6aea38053f4e6b.tar.bz2
SledjHamr-fd361fdf6bc1c637c7f9391f4c6aea38053f4e6b.tar.xz
Clean up the LOCALDIR stuff, and replace it with workingDir. Still needs some work.
Diffstat (limited to 'build.lua')
-rwxr-xr-xbuild.lua24
1 files changed, 14 insertions, 10 deletions
diff --git a/build.lua b/build.lua
index 0e88bbf..581c134 100755
--- a/build.lua
+++ b/build.lua
@@ -40,10 +40,10 @@ end
40 40
41local buildSub = function (name, dir) 41local buildSub = function (name, dir)
42 print('_______________ BUILDING ' .. name .. ' _______________') 42 print('_______________ BUILDING ' .. name .. ' _______________')
43 local build, err = loadfile(LOCALDIR .. '/' .. dir .. '/build.lua') 43 local build, err = loadfile(dir .. '/build.lua')
44 if build then 44 if build then
45 setfenv(build, getfenv(2)) 45 setfenv(build, getfenv(2))
46 build(LOCALDIR .. '/' .. dir) 46 build(workingDir .. '/' .. dir)
47 else 47 else
48 print("ERROR - " .. err) 48 print("ERROR - " .. err)
49 end 49 end
@@ -53,8 +53,9 @@ end
53-- On the other hand, there's a more direct way to get to environment variables, it would fail to. 53-- On the other hand, there's a more direct way to get to environment variables, it would fail to.
54CFLAGOPTS = readCommand('echo "$CFLAGOPTS"') 54CFLAGOPTS = readCommand('echo "$CFLAGOPTS"')
55 55
56LOCALDIR = readCommand('pwd')readCommand('pwd') 56workingDir = readCommand('pwd')
57CFLAGS = '-g -Wall -I include -I ' .. LOCALDIR .. ' -I ../../libraries' 57-- TODO - -I ../../libraries will be wrong for somethings, but right now those things don't care.
58CFLAGS = '-g -Wall -I include -I ../../libraries'
58CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'luajit') 59CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'luajit')
59CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'eo') 60CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'eo')
60CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'eet') 61CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'eet')
@@ -63,12 +64,15 @@ CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'ecore-evas')
63CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'ecore-file') 64CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'ecore-file')
64CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'edje') 65CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'edje')
65CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'elementary') 66CFLAGS = CFLAGS .. ' ' .. pkgConfig('cflags', 'elementary')
66CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. LOCALDIR .. '\\"' 67-- TODO - The workingDir part of these strings gets set differently depending on who starts the build.
67CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. LOCALDIR .. '\\"' 68-- Which is a problem for the PACKAGE_*_DIR defines.
68CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. LOCALDIR .. '\\"' 69-- On the other hand, that part needs to be rethought anyway, coz otherwise they are locked to the build place.
70CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. workingDir .. '\\"'
71CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. workingDir .. '\\"'
72CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. workingDir .. '\\"'
69CFLAGS = CFLAGS .. ' ' .. CFLAGOPTS 73CFLAGS = CFLAGS .. ' ' .. CFLAGOPTS
70 74
71LDFLAGS = '-L ' .. LOCALDIR .. ' ' .. pkgConfig('libs-only-L', 'luajit') .. ' -L lib -L /usr/lib -L /lib' 75LDFLAGS = pkgConfig('libs-only-L', 'luajit') .. ' -L lib -L /usr/lib -L /lib'
72libs = pkgConfig('libs', 'elementary') .. ' ' .. pkgConfig('libs', 'luajit') .. ' -lpthread -lm' 76libs = pkgConfig('libs', 'elementary') .. ' ' .. pkgConfig('libs', 'luajit') .. ' -lpthread -lm'
73LFLAGS = '-d' 77LFLAGS = '-d'
74EDJE_FLAGS = '-id images -fd fonts' 78EDJE_FLAGS = '-id images -fd fonts'
@@ -77,8 +81,8 @@ EDJE_FLAGS = '-id images -fd fonts'
77if 'nil' == type(args) then 81if 'nil' == type(args) then
78 -- Building this passes my "holding breath" test, if it can compile while I'm holding my breath, no need for make files. 82 -- Building this passes my "holding breath" test, if it can compile while I'm holding my breath, no need for make files.
79 print('_______________ BUILDING lemon _______________') 83 print('_______________ BUILDING lemon _______________')
80 removeFiles(LOCALDIR .. '/libraries/lemon', {'*.o', 'lemon'}) 84 removeFiles('libraries/lemon', {'*.o', 'lemon'})
81 compileFiles('lemon', LOCALDIR .. '/libraries/lemon', {'lemon'}) 85 compileFiles('lemon', 'libraries/lemon', {'lemon'})
82 print('_______________ BUILDING Irrlicht _______________') 86 print('_______________ BUILDING Irrlicht _______________')
83 -- Irrlicht is an external project that comes with make files anyway, and doesn't otherwise pass the test. 87 -- Irrlicht is an external project that comes with make files anyway, and doesn't otherwise pass the test.
84 runCommand('Irrlicht', 'libraries/irrlicht-1.8.1/source/Irrlicht', 'make') 88 runCommand('Irrlicht', 'libraries/irrlicht-1.8.1/source/Irrlicht', 'make')