Make building emulator optional (allow building tools without building MAME) (#11889)
This commit is contained in:
parent
7a1c86c4d1
commit
d5340b8be4
9
makefile
9
makefile
@ -20,6 +20,7 @@
|
|||||||
# TARGET = mame
|
# TARGET = mame
|
||||||
# SUBTARGET = tiny
|
# SUBTARGET = tiny
|
||||||
# TOOLS = 1
|
# TOOLS = 1
|
||||||
|
# EMULATOR = 1
|
||||||
# TESTS = 1
|
# TESTS = 1
|
||||||
# BENCHMARKS = 1
|
# BENCHMARKS = 1
|
||||||
# OSD = sdl
|
# OSD = sdl
|
||||||
@ -650,6 +651,14 @@ PARAMS += --with-tools
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef EMULATOR
|
||||||
|
PARAMS += --with-emulator
|
||||||
|
else
|
||||||
|
ifeq '$(EMULATOR)' '1'
|
||||||
|
PARAMS += --with-emulator
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef TESTS
|
ifdef TESTS
|
||||||
ifneq '$(TESTS)' '0'
|
ifneq '$(TESTS)' '0'
|
||||||
PARAMS += --with-tests
|
PARAMS += --with-tests
|
||||||
|
@ -120,6 +120,11 @@ newoption {
|
|||||||
description = "Enable building tools.",
|
description = "Enable building tools.",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "with-emulator",
|
||||||
|
description = "Enable building emulator.",
|
||||||
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "with-tests",
|
trigger = "with-tests",
|
||||||
description = "Enable building tests.",
|
description = "Enable building tests.",
|
||||||
@ -529,30 +534,32 @@ msgprecompile ("Precompiling $(subst ../,,$<)...")
|
|||||||
|
|
||||||
messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" }
|
messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" }
|
||||||
|
|
||||||
if (_OPTIONS["PROJECT"] ~= nil) then
|
if _OPTIONS["with-emulator"] then
|
||||||
PROJECT_DIR = path.join(path.getabsolute(".."),"projects",_OPTIONS["PROJECT"]) .. "/"
|
if (_OPTIONS["PROJECT"] ~= nil) then
|
||||||
if (not os.isfile(path.join("..", "projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then
|
PROJECT_DIR = path.join(path.getabsolute(".."),"projects",_OPTIONS["PROJECT"]) .. "/"
|
||||||
error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist")
|
if (not os.isfile(path.join("..", "projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then
|
||||||
end
|
error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist")
|
||||||
dofile (path.join(".." ,"projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))
|
end
|
||||||
elseif (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then
|
dofile (path.join(".." ,"projects", _OPTIONS["PROJECT"], "scripts", "target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))
|
||||||
local subtargetscript = path.join("target", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".lua")
|
elseif (_OPTIONS["SOURCES"] == nil) and (_OPTIONS["SOURCEFILTER"] == nil) then
|
||||||
local subtargetfilter = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".flt")
|
local subtargetscript = path.join("target", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".lua")
|
||||||
if os.isfile(subtargetscript) then
|
local subtargetfilter = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["subtarget"] .. ".flt")
|
||||||
dofile(subtargetscript)
|
if os.isfile(subtargetscript) then
|
||||||
elseif os.isfile(subtargetfilter) then
|
dofile(subtargetscript)
|
||||||
local makedep = path.join(MAME_DIR, "scripts", "build", "makedep.py")
|
elseif os.isfile(subtargetfilter) then
|
||||||
local driverlist = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["target"] .. ".lst")
|
local makedep = path.join(MAME_DIR, "scripts", "build", "makedep.py")
|
||||||
local OUT_STR = os.outputof(
|
local driverlist = path.join(MAME_DIR, "src", _OPTIONS["target"], _OPTIONS["target"] .. ".lst")
|
||||||
string.format(
|
local OUT_STR = os.outputof(
|
||||||
"%s %s -r %s filterproject -t %s -f %s %s",
|
string.format(
|
||||||
PYTHON, makedep, MAME_DIR, _OPTIONS["subtarget"], subtargetfilter, driverlist))
|
"%s %s -r %s filterproject -t %s -f %s %s",
|
||||||
if #OUT_STR == 0 then
|
PYTHON, makedep, MAME_DIR, _OPTIONS["subtarget"], subtargetfilter, driverlist))
|
||||||
error("Error creating projects from driver filter file for subtarget " .. _OPTIONS["subtarget"])
|
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
|
end
|
||||||
load(OUT_STR)()
|
|
||||||
else
|
|
||||||
error("Definition file for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1480,32 +1487,34 @@ group "core"
|
|||||||
|
|
||||||
dofile(path.join("src", "emu.lua"))
|
dofile(path.join("src", "emu.lua"))
|
||||||
|
|
||||||
if (STANDALONE~=true) then
|
|
||||||
dofile(path.join("src", "mame", "frontend.lua"))
|
|
||||||
end
|
|
||||||
|
|
||||||
group "devices"
|
group "devices"
|
||||||
dofile(path.join("src", "devices.lua"))
|
dofile(path.join("src", "devices.lua"))
|
||||||
devicesProject(_OPTIONS["target"],_OPTIONS["subtarget"])
|
devicesProject(_OPTIONS["target"],_OPTIONS["subtarget"])
|
||||||
|
|
||||||
if (STANDALONE~=true) then
|
if _OPTIONS["with-emulator"] then
|
||||||
group "drivers"
|
if (STANDALONE~=true) then
|
||||||
findfunction("createProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"])
|
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"])
|
|
||||||
else
|
|
||||||
startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"])
|
|
||||||
end
|
end
|
||||||
else
|
|
||||||
startproject (_OPTIONS["subtarget"])
|
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["subtarget"])
|
||||||
|
end
|
||||||
|
mainProject(_OPTIONS["target"],_OPTIONS["subtarget"])
|
||||||
|
strip()
|
||||||
end
|
end
|
||||||
mainProject(_OPTIONS["target"],_OPTIONS["subtarget"])
|
|
||||||
strip()
|
|
||||||
|
|
||||||
if _OPTIONS["with-tools"] then
|
if _OPTIONS["with-tools"] then
|
||||||
group "tools"
|
group "tools"
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
--
|
--
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if _OPTIONS["with-emulator"] then
|
||||||
|
|
||||||
project ("emu")
|
project ("emu")
|
||||||
uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf")
|
uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf")
|
||||||
kind (LIBTYPE)
|
kind (LIBTYPE)
|
||||||
@ -308,6 +310,7 @@ custombuildtask {
|
|||||||
layoutbuildtask("emu/layout", "triphsxs"),
|
layoutbuildtask("emu/layout", "triphsxs"),
|
||||||
layoutbuildtask("emu/layout", "quadhsxs"),
|
layoutbuildtask("emu/layout", "quadhsxs"),
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
|
||||||
project ("precompile")
|
project ("precompile")
|
||||||
uuid ("a6fb15d4-b123-4445-acef-13c8e80fcacf")
|
uuid ("a6fb15d4-b123-4445-acef-13c8e80fcacf")
|
||||||
|
Loading…
Reference in New Issue
Block a user