diff options
-rw-r--r-- | makefile | 9 | ||||
-rw-r--r-- | scripts/genie.lua | 91 | ||||
-rw-r--r-- | scripts/src/emu.lua | 3 |
3 files changed, 62 insertions, 41 deletions
@@ -20,6 +20,7 @@ # TARGET = mame # SUBTARGET = tiny # TOOLS = 1 +# EMULATOR = 1 # TESTS = 1 # BENCHMARKS = 1 # OSD = sdl @@ -650,6 +651,14 @@ PARAMS += --with-tools endif endif +ifndef EMULATOR +PARAMS += --with-emulator +else +ifeq '$(EMULATOR)' '1' +PARAMS += --with-emulator +endif +endif + ifdef TESTS ifneq '$(TESTS)' '0' PARAMS += --with-tests diff --git a/scripts/genie.lua b/scripts/genie.lua index 001b81339ae..3a6a2bfd38b 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -121,6 +121,11 @@ newoption { } newoption { + trigger = "with-emulator", + description = "Enable building emulator.", +} + +newoption { trigger = "with-tests", description = "Enable building tests.", } @@ -529,30 +534,32 @@ msgprecompile ("Precompiling $(subst ../,,$<)...") messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" } -if (_OPTIONS["PROJECT"] ~= nil) then - PROJECT_DIR = path.join(path.getabsolute(".."),"projects",_OPTIONS["PROJECT"]) .. "/" - if (not os.isfile(path.join("..", "projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then - error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") - end - dofile (path.join(".." ,"projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) -elseif (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then - local subtargetscript = path.join("target", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".lua") - local subtargetfilter = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".flt") - if os.isfile(subtargetscript) then - dofile(subtargetscript) - elseif os.isfile(subtargetfilter) then - local makedep = path.join(MAME_DIR, "scripts", "build", "makedep.py") - local driverlist = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["target"] .. ".lst") - local OUT_STR = os.outputof( - string.format( - "%s %s -r %s filterproject -t %s -f %s %s", - PYTHON, makedep, MAME_DIR, _OPTIONS["subtarget"], subtargetfilter, driverlist)) - if #OUT_STR == 0 then - error("Error creating projects from driver filter file for subtarget " .. _OPTIONS["subtarget"]) +if _OPTIONS["with-emulator"] then + if (_OPTIONS["PROJECT"] ~= nil) then + PROJECT_DIR = path.join(path.getabsolute(".."),"projects",_OPTIONS["PROJECT"]) .. "/" + if (not os.isfile(path.join("..", "projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then + error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") + end + dofile (path.join(".." ,"projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua")) + elseif (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then + local subtargetscript = path.join("target", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".lua") + local subtargetfilter = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".flt") + if os.isfile(subtargetscript) then + dofile(subtargetscript) + elseif os.isfile(subtargetfilter) then + local makedep = path.join(MAME_DIR, "scripts", "build", "makedep.py") + local driverlist = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["target"] .. ".lst") + local OUT_STR = os.outputof( + string.format( + "%s %s -r %s filterproject -t %s -f %s %s", + PYTHON, makedep, MAME_DIR, _OPTIONS["subtarget"], subtargetfilter, driverlist)) + if #OUT_STR == 0 then + error("Error creating projects from driver filter file for subtarget " .. _OPTIONS["subtarget"]) + end + load(OUT_STR)() + else + error("Definition file for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") end - load(OUT_STR)() - else - error("Definition file for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist") end end @@ -1480,32 +1487,34 @@ group "core" dofile(path.join("src", "emu.lua")) -if (STANDALONE~=true) then - dofile(path.join("src", "mame", "frontend.lua")) -end - group "devices" dofile(path.join("src", "devices.lua")) devicesProject(_OPTIONS["target"],_OPTIONS["subtarget"]) -if (STANDALONE~=true) then - group "drivers" - findfunction("createProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"]) -end +if _OPTIONS["with-emulator"] then + if (STANDALONE~=true) then + dofile(path.join("src", "mame", "frontend.lua")) + end -group "emulator" -dofile(path.join("src", "main.lua")) -if (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then - if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then - startproject (_OPTIONS["target"]) + if (STANDALONE~=true) then + group "drivers" + findfunction("createProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"]) + end + + group "emulator" + dofile(path.join("src", "main.lua")) + if (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then + if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then + startproject (_OPTIONS["target"]) + else + startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"]) + end else - startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"]) + startproject (_OPTIONS["subtarget"]) end -else - startproject (_OPTIONS["subtarget"]) + mainProject(_OPTIONS["target"],_OPTIONS["subtarget"]) + strip() end -mainProject(_OPTIONS["target"],_OPTIONS["subtarget"]) -strip() if _OPTIONS["with-tools"] then group "tools" diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index bed80ebccb6..df53570a61e 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -9,6 +9,8 @@ -- --------------------------------------------------------------------------- +if _OPTIONS["with-emulator"] then + project ("emu") uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf") kind (LIBTYPE) @@ -308,6 +310,7 @@ custombuildtask { layoutbuildtask("emu/layout", "triphsxs"), layoutbuildtask("emu/layout", "quadhsxs"), } +end project ("precompile") uuid ("a6fb15d4-b123-4445-acef-13c8e80fcacf") |