1
0
forked from 0ad/0ad

Drop premake4 support, refs #3729. premake4 has been unused for a long time now, and was only left available as a safety net.

Differential Revision: https://code.wildfiregames.com/D1275
This was SVN commit r21955.
This commit is contained in:
Nicolas Auvray 2018-12-26 16:00:53 +00:00
parent b87b7d4ed4
commit 46ddffdd3f
242 changed files with 4 additions and 54171 deletions

View File

@ -36,7 +36,6 @@ in particular, let us know and we can try to clarify it.
/build
Various (unspecified)
/build/premake/premake4
/build/premake/premake5
BSD

View File

@ -1,782 +0,0 @@
-- this file provides project_add_extern_libs, which takes care of the
-- dirty details of adding the libraries' include and lib paths.
--
-- TYPICAL TASK: add new library. Instructions:
-- 1) add a new extern_lib_defs entry
-- 2) add library name to extern_libs tables in premake.lua for all 'projects' that want to use it
-- directory in which OS-specific library subdirectories reside.
if os.is("macosx") then
libraries_dir = rootdir.."/libraries/osx/"
elseif os.is("windows") then
libraries_dir = rootdir.."/libraries/win32/"
else
-- No Unix-specific libs yet (use source directory instead!)
end
-- directory for shared, bundled libraries
libraries_source_dir = rootdir.."/libraries/source/"
third_party_source_dir = rootdir.."/source/third_party/"
local function add_default_lib_paths(extern_lib)
libdirs { libraries_dir .. extern_lib .. "/lib" }
end
local function add_source_lib_paths(extern_lib)
libdirs { libraries_source_dir .. extern_lib .. "/lib" }
end
local function add_default_include_paths(extern_lib)
includedirs { libraries_dir .. extern_lib .. "/include" }
end
local function add_source_include_paths(extern_lib)
includedirs { libraries_source_dir .. extern_lib .. "/include" }
end
local function add_third_party_include_paths(extern_lib)
includedirs { third_party_source_dir .. extern_lib .. "/include" }
end
-- For unixes: add buildflags and linkflags using pkg-config or another similar command.
-- By default, pkg-config is used. Other commands can be passed as "alternative_cmd".
-- Running such commands at build/linktime does not work on all environments.
-- For those environments where it does not work, we already run it now.
-- Any better ideas?
local function pkgconfig_cflags(lib, alternative_cmd)
local cmd_cflags = ""
local result_cflags
if not alternative_cmd then
cmd_cflags = "pkg-config "..lib.." --cflags"
else
cmd_cflags = alternative_cmd
end
if _ACTION == "xcode3" or _ACTION == "xcode4" then
result_cflags = string.gsub(os.capture(cmd_cflags), "\n", "")
buildoptions { result_cflags }
else
buildoptions { "`"..cmd_cflags.."`" }
end
end
local function pkgconfig_libs(lib, alternative_cmd)
local cmd_libs = ""
local result_libs
if not alternative_cmd then
cmd_libs = "pkg-config "..lib.." --libs"
else
cmd_libs = alternative_cmd
end
if _ACTION == "xcode3" or _ACTION == "xcode4" then
-- The syntax of -Wl with the comma separated list doesn't work and -Wl apparently isn't needed in xcode.
-- This is a hack, but it works...
result_libs = string.gsub(os.capture(cmd_libs), "-Wl", "")
result_libs = string.gsub(result_libs, ",", " ")
result_libs = string.gsub(result_libs, "\n", "")
linkoptions { result_libs }
elseif _ACTION == "gmake" then
gnuexternals { "`"..cmd_libs.."`" }
else
linkoptions { "`"..cmd_libs.."`" }
end
end
function os.capture(cmd)
local f = io.popen(cmd, 'r')
local s = f:read('*a')
return s
end
local function add_delayload(name, suffix, def)
if def["no_delayload"] then
return
end
-- currently only supported by VC; nothing to do on other platforms.
if not os.is("windows") then
return
end
-- no extra debug version; use same library in all configs
if suffix == "" then
linkoptions { "/DELAYLOAD:"..name..".dll" }
-- extra debug version available; use in debug config
else
local dbg_cmd = "/DELAYLOAD:" .. name .. suffix .. ".dll"
local cmd = "/DELAYLOAD:" .. name .. ".dll"
configuration "Debug"
linkoptions { dbg_cmd }
configuration "Release"
linkoptions { cmd }
configuration { }
end
end
local function add_default_links(def)
-- careful: make sure to only use *_names when on the correct platform.
local names = {}
if os.is("windows") then
if def.win_names then
names = def.win_names
end
elseif _OPTIONS["android"] and def.android_names then
names = def.android_names
elseif os.is("linux") and def.linux_names then
names = def.linux_names
elseif os.is("macosx") and def.osx_names then
names = def.osx_names
elseif os.is("bsd") and def.bsd_names then
names = def.bsd_names
elseif def.unix_names then
names = def.unix_names
end
local suffix = "d"
-- library is overriding default suffix (typically "" to indicate there is none)
if def["dbg_suffix"] then
suffix = def["dbg_suffix"]
end
-- non-Windows doesn't have the distinction of debug vs. release libraries
-- (to be more specific, they do, but the two are binary compatible;
-- usually only one type - debug or release - is installed at a time).
if not os.is("windows") then
suffix = ""
end
-- OS X "Frameworks" need to be added in a special way to the link
-- i.e. by linkoptions += "-framework ..."
if os.is("macosx") and def.osx_frameworks then
for i,name in pairs(def.osx_frameworks) do
linkoptions { "-framework " .. name }
end
else
for i,name in pairs(names) do
configuration "Debug"
links { name .. suffix }
configuration "Release"
links { name }
configuration { }
add_delayload(name, suffix, def)
end
end
end
-- Library definitions
-- In a perfect world, libraries would have a common installation template,
-- i.e. location of include directory, naming convention for .lib, etc.
-- this table provides a means of working around each library's differences.
--
-- The basic approach is defining two functions per library:
--
-- 1. compile_settings
-- This function should set all settings requred during the compile-phase like
-- includedirs, defines etc...
--
-- 2. link_settings
-- This function should set all settings required during the link-phase like
-- libdirs, linkflag etc...
--
-- The main reason for separating those settings is different linking behaviour
-- on osx and xcode. For more details, read the comment in project_add_extern_libs.
--
-- There are some helper functions for the most common tasks. You should use them
-- if they can be used in your situation to make the definitions more consistent and
-- use their default beviours as a guideline.
--
--
-- add_default_lib_paths(extern_lib)
-- Description: Add '<libraries root>/<libraryname>/lib'to the libpaths
-- Parameters:
-- * extern_lib: <libraryname> to be used in the libpath.
--
-- add_default_include_paths(extern_lib)
-- Description: Add '<libraries root>/<libraryname>/include' to the includepaths
-- Parameters:
-- * extern_lib: <libraryname> to be used in the libpath.
--
-- add_default_links
-- Description: Adds links to libraries and configures delayloading.
-- If the *_names parameter for a plattform is missing, no linking will be done
-- on that plattform.
-- The default assumptions are:
-- * debug import library and DLL are distinguished with a "d" suffix
-- * the library should be marked for delay-loading.
-- Parameters:
-- * win_names: table of import library / DLL names (no extension) when
-- running on Windows.
-- * unix_names: as above; shared object names when running on non-Windows.
-- * osx_names: as above; for OS X specifically (overrides unix_names if both are
-- specified)
-- * bsd_names: as above; for BSD specifically (overrides unix_names if both are
-- specified)
-- * linux_names: ditto for Linux (overrides unix_names if both given)
-- * dbg_suffix: changes the debug suffix from the above default.
-- can be "" to indicate the library doesn't have a debug build;
-- in that case, the same library (without suffix) is used in
-- all build configurations.
-- * no_delayload: indicate the library is not to be delay-loaded.
-- this is necessary for some libraries that do not support it,
-- e.g. Xerces (which is so stupid as to export variables).
extern_lib_defs = {
boost = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("boost")
elseif os.is("macosx") then
-- Suppress all the Boost warnings on OS X by including it as a system directory
buildoptions { "-isystem../" .. libraries_dir .. "boost/include" }
end
-- TODO: This actually applies to most libraries we use on BSDs, make this a global setting.
if os.is("bsd") then
includedirs { "/usr/local/include" }
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("boost")
end
add_default_links({
-- The following are not strictly link dependencies on all systems, but
-- are included for compatibility with different versions of Boost
android_names = { "boost_filesystem-gcc-mt", "boost_system-gcc-mt" },
unix_names = { os.findlib("boost_filesystem-mt") and "boost_filesystem-mt" or "boost_filesystem", os.findlib("boost_system-mt") and "boost_system-mt" or "boost_system" },
osx_names = { "boost_filesystem-mt", "boost_system-mt" },
})
end,
},
comsuppw = {
link_settings = function()
add_default_links({
win_names = { "comsuppw" },
dbg_suffix = "d",
no_delayload = 1,
})
end,
},
cxxtest = {
compile_settings = function()
includedirs { libraries_source_dir .. "cxxtest-4.4" }
end,
},
enet = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("enet")
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("enet")
end
add_default_links({
win_names = { "enet" },
unix_names = { "enet" },
})
end,
},
fcollada = {
compile_settings = function()
add_source_include_paths("fcollada")
end,
link_settings = function()
add_source_lib_paths("fcollada")
if os.is("windows") then
configuration "Debug"
links { "FColladaD" }
configuration "Release"
links { "FCollada" }
configuration { }
else
configuration "Debug"
links { "FColladaSD" }
configuration "Release"
links { "FColladaSR" }
configuration { }
end
end,
},
gloox = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("gloox")
elseif os.is("macosx") then
-- Support GLOOX_CONFIG for overriding the default PATH-based gloox-config
gloox_config_path = os.getenv("GLOOX_CONFIG")
if not gloox_config_path then
gloox_config_path = "gloox-config"
end
pkgconfig_cflags(nil, gloox_config_path.." --cflags")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("gloox")
end
if os.is("macosx") then
gloox_config_path = os.getenv("GLOOX_CONFIG")
if not gloox_config_path then
gloox_config_path = "gloox-config"
end
pkgconfig_libs(nil, gloox_config_path.." --libs")
else
-- TODO: consider using pkg-config on non-Windows (for compile_settings too)
add_default_links({
win_names = { "gloox-1.0" },
unix_names = { "gloox" },
no_delayload = 1,
})
end
end,
},
iconv = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("iconv")
defines { "HAVE_ICONV_CONST" }
defines { "ICONV_CONST=const" }
defines { "LIBICONV_STATIC" }
elseif os.is("macosx") then
add_default_include_paths("iconv")
defines { "LIBICONV_STATIC" }
elseif os.getversion().description == "FreeBSD" then
defines { "HAVE_ICONV_CONST" }
defines { "ICONV_CONST=const" }
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("iconv")
end
add_default_links({
win_names = { "libiconv" },
osx_names = { "iconv" },
dbg_suffix = "",
no_delayload = 1,
})
-- glibc (used on Linux and GNU/kFreeBSD) has iconv
-- FreeBSD 10+ has iconv as a part of libc
if os.is("bsd")
and not (os.getversion().description == "FreeBSD" and os.getversion().majorversion >= 10
or os.getversion().description == "GNU/kFreeBSD") then
add_default_links({
bsd_names = { "iconv" },
})
end
end,
},
icu = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("icu")
elseif os.is("macosx") then
-- Support ICU_CONFIG for overriding the default PATH-based icu-config
icu_config_path = os.getenv("ICU_CONFIG")
if not icu_config_path then
icu_config_path = "icu-config"
end
pkgconfig_cflags(nil, icu_config_path.." --cppflags")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("icu")
end
if os.is("macosx") then
icu_config_path = os.getenv("ICU_CONFIG")
if not icu_config_path then
icu_config_path = "gloox-config"
end
pkgconfig_libs(nil, icu_config_path.." --ldflags-searchpath --ldflags-libsonly --ldflags-system")
else
add_default_links({
win_names = { "icuuc", "icuin" },
unix_names = { "icui18n", "icuuc" },
dbg_suffix = "",
no_delayload = 1,
})
end
end,
},
libcurl = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("libcurl")
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("libcurl")
end
add_default_links({
win_names = { "libcurl" },
unix_names = { "curl" },
})
end,
},
libpng = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("libpng")
end
if os.getversion().description == "OpenBSD" then
includedirs { "/usr/local/include/libpng" }
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("libpng")
end
add_default_links({
win_names = { "libpng16" },
unix_names = { "png" },
-- Otherwise ld will sometimes pull in ancient 1.2 from the SDK, which breaks the build :/
-- TODO: Figure out why that happens
osx_names = { "png16" },
})
end,
},
libsodium = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("libsodium")
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("libsodium")
end
add_default_links({
win_names = { "libsodium" },
unix_names = { "sodium" },
})
end,
},
libxml2 = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("libxml2")
elseif os.is("macosx") then
-- Support XML2_CONFIG for overriding for the default PATH-based xml2-config
xml2_config_path = os.getenv("XML2_CONFIG")
if not xml2_config_path then
xml2_config_path = "xml2-config"
end
-- use xml2-config instead of pkg-config on OS X
pkgconfig_cflags(nil, xml2_config_path.." --cflags")
-- libxml2 needs _REENTRANT or __MT__ for thread support;
-- OS X doesn't get either set by default, so do it manually
defines { "_REENTRANT" }
else
pkgconfig_cflags("libxml-2.0")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("libxml2")
configuration "Debug"
links { "libxml2" }
configuration "Release"
links { "libxml2" }
configuration { }
elseif os.is("macosx") then
xml2_config_path = os.getenv("XML2_CONFIG")
if not xml2_config_path then
xml2_config_path = "xml2-config"
end
pkgconfig_libs(nil, xml2_config_path.." --libs")
else
pkgconfig_libs("libxml-2.0")
end
end,
},
miniupnpc = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("miniupnpc")
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("miniupnpc")
end
add_default_links({
win_names = { "miniupnpc" },
unix_names = { "miniupnpc" },
})
end,
},
nvtt = {
compile_settings = function()
if not _OPTIONS["with-system-nvtt"] then
add_source_include_paths("nvtt")
end
defines { "NVTT_SHARED=1" }
end,
link_settings = function()
if not _OPTIONS["with-system-nvtt"] then
add_source_lib_paths("nvtt")
end
add_default_links({
win_names = { "nvtt" },
unix_names = { "nvcore", "nvmath", "nvimage", "nvtt" },
osx_names = { "nvcore", "nvmath", "nvimage", "nvtt", "squish" },
dbg_suffix = "", -- for performance we always use the release-mode version
})
end,
},
openal = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("openal")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("openal")
end
add_default_links({
win_names = { "openal32" },
unix_names = { "openal" },
osx_frameworks = { "OpenAL" },
dbg_suffix = "",
no_delayload = 1, -- delayload seems to cause errors on startup
})
end,
},
opengl = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("opengl")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("opengl")
end
if _OPTIONS["gles"] then
add_default_links({
unix_names = { "GLESv2" },
dbg_suffix = "",
})
else
add_default_links({
win_names = { "opengl32", "gdi32" },
unix_names = { "GL" },
osx_frameworks = { "OpenGL" },
dbg_suffix = "",
no_delayload = 1, -- delayload seems to cause errors on startup
})
end
end,
},
sdl = {
compile_settings = function()
if os.is("windows") then
includedirs { libraries_dir .. "sdl2/include/SDL" }
elseif not _OPTIONS["android"] then
-- Support SDL2_CONFIG for overriding the default (pkg-config sdl2)
-- i.e. on OSX where it gets set in update-workspaces.sh
sdl_config_path = os.getenv("SDL2_CONFIG")
if sdl_config_path then
pkgconfig_cflags(nil, sdl_config_path.." --cflags")
else
pkgconfig_cflags("sdl2")
end
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("sdl2")
elseif not _OPTIONS["android"] then
sdl_config_path = os.getenv("SDL2_CONFIG")
if sdl_config_path then
pkgconfig_libs(nil, sdl_config_path.." --libs")
else
pkgconfig_libs("sdl2")
end
end
end,
},
spidermonkey = {
compile_settings = function()
if _OPTIONS["with-system-mozjs38"] then
if not _OPTIONS["android"] then
pkgconfig_cflags("mozjs-38")
end
else
if os.is("windows") then
include_dir = "include-win32"
buildoptions { "/FI\"js/RequiredDefines.h\"" }
else
include_dir = "include-unix"
end
configuration "Debug"
includedirs { libraries_source_dir.."spidermonkey/"..include_dir.."-debug" }
defines { "DEBUG" }
configuration "Release"
includedirs { libraries_source_dir.."spidermonkey/"..include_dir.."-release" }
configuration { }
end
end,
link_settings = function()
if _OPTIONS["with-system-mozjs38"] then
if _OPTIONS["android"] then
links { "mozjs-38" }
else
pkgconfig_libs("nspr")
pkgconfig_libs("mozjs-38")
end
else
if os.is("macosx") then
add_default_lib_paths("nspr")
links { "nspr4", "plc4", "plds4" }
end
configuration "Debug"
links { "mozjs38-ps-debug" }
configuration "Release"
links { "mozjs38-ps-release" }
configuration { }
add_source_lib_paths("spidermonkey")
end
end,
},
tinygettext = {
compile_settings = function()
add_third_party_include_paths("tinygettext")
end,
},
valgrind = {
compile_settings = function()
add_source_include_paths("valgrind")
end,
},
vorbis = {
compile_settings = function()
if os.is("windows") then
add_default_include_paths("vorbis")
elseif os.is("macosx") then
add_default_include_paths("libogg")
add_default_include_paths("vorbis")
end
end,
link_settings = function()
if os.is("windows") then
add_default_lib_paths("vorbis")
elseif os.is("macosx") then
add_default_lib_paths("libogg")
add_default_lib_paths("vorbis")
end
-- TODO: We need to force linking with these as currently
-- they need to be loaded explicitly on execution
if os.getversion().description == "OpenBSD" then
add_default_links({
unix_names = { "ogg",
"vorbis" },
})
end
add_default_links({
win_names = { "vorbisfile" },
unix_names = { "vorbisfile" },
osx_names = { "vorbis", "vorbisenc", "vorbisfile", "ogg" },
dbg_suffix = "_d",
})
end,
},
wxwidgets = {
compile_settings = function()
if os.is("windows") then
includedirs { libraries_dir.."wxwidgets/include/msvc" }
add_default_include_paths("wxwidgets")
else
-- Support WX_CONFIG for overriding for the default PATH-based wx-config
wx_config_path = os.getenv("WX_CONFIG")
if not wx_config_path then
wx_config_path = "wx-config"
end
pkgconfig_cflags(nil, wx_config_path.." --unicode=yes --cxxflags")
end
end,
link_settings = function()
if os.is("windows") then
libdirs { libraries_dir.."wxwidgets/lib/vc_lib" }
else
wx_config_path = os.getenv("WX_CONFIG")
if not wx_config_path then
wx_config_path = "wx-config"
end
pkgconfig_libs(nil, wx_config_path.." --unicode=yes --libs std,gl")
end
end,
},
x11 = {
link_settings = function()
add_default_links({
win_names = { },
unix_names = { "X11" },
})
end,
},
xcursor = {
link_settings = function()
add_default_links({
unix_names = { "Xcursor" },
})
end,
},
zlib = {
compile_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_include_paths("zlib")
end
end,
link_settings = function()
if os.is("windows") or os.is("macosx") then
add_default_lib_paths("zlib")
end
add_default_links({
win_names = { "zlib1" },
unix_names = { "z" },
no_delayload = 1,
})
end,
},
}
-- add a set of external libraries to the project; takes care of
-- include / lib path and linking against the import library.
-- extern_libs: table of library names [string]
-- target_type: String defining the projects kind [string]
function project_add_extern_libs(extern_libs, target_type)
for i,extern_lib in pairs(extern_libs) do
local def = extern_lib_defs[extern_lib]
assert(def, "external library " .. extern_lib .. " not defined")
if def.compile_settings then
def.compile_settings()
end
-- Linking to external libraries will only be done in the main executable and not in the
-- static libraries. Premake would silently skip linking into static libraries for some
-- actions anyway (e.g. vs2010).
-- On osx using xcode, if this linking would be defined in the static libraries, it would fail to
-- link if only dylibs are available. If both *.a and *.dylib are available, it would link statically.
-- I couldn't find any problems with that approach.
if target_type ~= "StaticLib" and def.link_settings then
def.link_settings()
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -1,123 +0,0 @@
PREMAKE BUILD INSTRUCTIONS
Premake is written in a mix of C and Lua. This mix enables many new
features, but also makes building Premake a bit more complicated than
your typical application.
If you downloaded a source code package from SourceForge (as opposed
to pulling the sources from the repository), you will find project
files for all of the currently supported toolsets in the build/ folder.
Build the release configuration (the default for the makefiles) and you
will find the executable in bin/release ready to go.
If you want to use a debug build instead, or if you pulled the sources
from BitBucket instead of a SourceForge release, or if you plan on
making changes to Premake, read the next section to learn how to
prepare the project files.
If you find all of this very confusing and need some help, see the end
of this document for contact information. I'll be glad to help. And if
you have any suggestions for improving this process, we'd be glad to
hear them too.
GENERATING THE PROJECT FILES
If you downloaded a source code package from SourceForge, the project
files are already included (in build/) and you can skip ahead to the
next section.
If you pulled the sources from BitBucket, you'll need to generate your
own project files before you can build.
We use Premake to generate the project files for Premake (bootstrapping,
or eating our own dog food). So in order to generate the project files,
you need to have a working version of Premake 4.x installed on your
system. You can get it as source code (with pre-generated project files
ready to build) or a prebuilt binary from the SourceForge download page.
Once you have a working Premake 4.x installed, the first thing you need
to do is to embed the Lua scripts into the application by running this
command in the top-level Premake directory:
premake4 embed
This creates a C file (at src/host/scripts.c) which contains all of the
Lua scripts as static string buffers. These then get compiled into the
executable, which is how we get away with shipping a single file instead
of one executable and whole bunch of scripts. See EMBEDDING THE SCRIPTS,
below, for more information.
Now you can generate project files for your toolset of choice by running
a command like:
premake4 gmake -- for GNU makefiles using GCC
premake4 vs2008 -- for a Visual Studio 2008 solution
Use the "--help" option to see all of the available targets.
This will create a solution/makefile/workspace in the top-level folder,
which you can now go ahead and build.
RELEASE vs. DEBUG BUILDS
Premake can be built in either "release" or "debug" modes. Makefile users
can choose which configuration to build with the "config" argument:
make config=debug -- build in debug mode
make config=release -- build in release mode
IDEs like Visual Studio provide their own mechanism for switching build
configurations.
In release mode you can build and run Premake like any other C application
(once you've embedded the scripts, see the next section).
In debug mode, Premake ignores the embedded Lua scripts and instead reads the
latest versions from the disk at runtime. This allows you to change a script,
and then immediately test it without having to embed or compile first. Speedy!
But Premake needs some help to find the scripts.
You can specify the location of the scripts in one of two ways: using
the /scripts command line argument, like so:
premake4 /scripts=~/Code/premake4/src gmake
Or by setting a PREMAKE_PATH environment variable.
PREMAKE_PATH=~/Code/premake4/src
As you can see, you need to specify the location of the Premake "src"
directory, the one containing "_premake_main.lua".
EMBEDDING THE SCRIPTS
One of the nice things about Premake is that it comes as a single file,
easy to install or move around. To manage this, we need to embed all of
the Lua scripts into the executable, so we can deliver just the one file,
rather than an executable and a whole bunch of scripts.
Scripts are embedded by running the command
premake4 embed
This copies all of the scripts listed in _manifest.lua into the file
src/host/scripts.c, where they are represented as a set of static C
string buffers. This file is then compiled as part of Premake's release
builds.
So: very important to embed the scripts before each release build!
CONFUSED?
I'll be glad to help you out. Stop by the main project website where
you can leave a note in the forums (the preferred approach), join the
mailing list, or contact me directly.
http://industriousone.com/premake
Enjoy!

View File

@ -1,547 +0,0 @@
-------
4.3.1 (in progress)
-------
* Bug 3119793: Fixed ClCompile blocks with vs10 and PCH (Dan Dunham)
* Bug 2920784: Symbol visibility in Xcode3 libraries (burnson2)
* Bug 3133743: Sets ONLY_ACTIVE_ARCH = YES in Xcode debug builds (James Wynn)
* Properly pass return codes back to shell in release builds
* Bug 3135734: Remove WholeProgramOptimization setting in vs10 (doug)
* Bug 3138377: Link dependencies ignored within "SharedLib" configuration
-------
4.3
-------
* CHANGED LICENSE FROM GPLv2 TO BSD
* Added Visual Studio 2010 C/C++ support (Liam Devine)
* Added Solaris support (Dean Ross-Smith)
* Added deployment and image options for Xbox360 (dvoid)
* Patch 2963313: Enable setting .NET framework version (Justen Hyde)
* Patch 2965229: Fix handling of '+' symbol in file patterns (Rachel Blum)
* Patch 2997449: Print configuration with target (ergosys)
* Patch 2997452: Suppress gmake's "nothing to be done" message (ergosys)
* Patch 3011940: Add support for MFC (JTAnderson)
* Patch 3053959: kind() crashes when called with no arguments (rjmyst3)
* Bug 2997728: Project dependencies should be case-sensitive
* Bug 3056381: Xcode project breaks on special chars
* Bug 3007101: Generating PDB in Release builds is not supported
* Bug 2971841: Gmake escaping of shell variable $(...) is broken
* Fixed handling of icons in Xcode (bitshifter)
* Added imagepath to set Xbox360 image file name (Jarod)
* Patch 3063804: Set CompileAs flag for VS200x C projects (rjmyst3)
* Implemented StaticRuntime flag for Xcode (William Burnson)
* Improved portability of Mac OS X binaries (William Burnson)
* Bug 3035545: The pattern { "./folder/*.c" } matches no files
* Bug 3034222: StaticLib projects ignore linkoptions
* Bug 3020382: GCC PCH not working
* Bug 3016050: {"../Dir/file1.c","../../Dir/file2.c"} breaks Xcode (Stephane)
* Bug 3015312: Makefiles are not quoted correctly
* Bug 3097868: Removes relative paths from vs2010 filters (Robert Konrad)
* Bug 3095274: Pre-compiled header support missing for VS2010 target
* Bug 3100062: vs2010 Runtime library selection
-------
4.2.1
-------
* Feature 2944697: Add flag to disable Minimal Rebuild in Visual Studio
* Patch 2928029: Add EnableSSE, EnableSSE2 flags
* Patch 2936443: Expose configuration terms to scripts (Laurent Humbertclaude)
* Bug 2928775: Error loading external Lua module with require()
* Bug 2942438: Wrong runtime library linked
* Bug 2931722: pchheader handling not consistent between tools
* Bug 2958829: Files pattern matching including too many files
* Bug 2953594: includedirs / libdirs converting absolute paths to relative
* Bug 2936188: Improve handling for invalid values in lists
-----
4.2
-----
- Feature 1526976: Add support for Apple Xcode 3
- Feature 2900623: Add targetsuffix and implibsuffix properties
- Added project kind to list of configuration filters
- Feature 2839002: Add gcc switch to improve header dependency generation (Johannes Spohr)
- Feature 2832906: Global variable (_SCRIPT) for current script path
- Feature 2905303: Enable better folder matching in file lists
- Feature 2919629: Add help target for makefiles
- Feature 2820644: Add Xbox360 deployment and image options
- Bug 2909463: Fix Xcode handling of Obj-C++ .mm files
- Bug 2903430: Using relative instead of absolute paths with $() macro
- Bug 2910691: Duplicate build options
- Bug 2910639: Nil reference on dylib project dependency
- Bug 2872066: Two test failures in 4.1.2
- Bug 2912756: dylibs missing lib prefix
- Bug 2910202: Code::Blocks building C files as C++
- Bug 2926917: Use target name for Visual Studio PDB file
- Bug 2927604: Unable to build Premake with Visual Studio
- Clean action now removes MonoDevelop .pidb files correctly
- Added os.executef()
-------
4.1.2
-------
- Fixed ManagedExtension setting for Visual Studio
- Fixed os.match() bug for large result sets (David Raulo)
- Patch 2840052: Order problem of static link
- Patch 2802722: Floating Point Model Flags (Suigintou)
- Patch 2865333: Support for ObjC and ObjC++ sources (Johannes Spohr)
- Patch 2832852: Fix descriptions in cmd help (Sebastian Schuberth)
- Patch 2832848: Show default script name in help (Sebastian Schuberth)
-------
4.1.1
-------
- Use libtool instead of ar for Mac OS X Universal static libraries
- Fixed Xbox 360 linker settings in Visual Studio
- Remove platform-specific intermediate objects on clean
- Bug 2819232: Buildoptions not used when creating Makefile for C#
- Bug 2813297: OS X universal config should be "univ" (William Burnson)
- Bug 2814179: Xbox 360 precompiled headers not working
-----
4.1
-----
- Added support for cross-compiling target platforms
- Added Xbox 360 support to Visual Studio 2005/2008
- Added Mac OS X universal binary support
- Added Playstation 3 support
- Added precompiled header support for GCC
- Support links and libdirs for Visual Studio static libraries
- Fail gracefully when list is assigned to string field
- Changed GCC flags to -fno-exceptions and -fno-rtti
- Improved performance of configuration building step
- Fixed crash when configuration is missing a kind
- Patch 2031626: Support for additional manifest files (Colin Graf)
- Patch 2558089: workaround for --as-needed/correct link order (idl0r)
- Patch 2609028: verbose linking in makefile (kaidokert)
- Bug 2564404: FatalWarnings has no effect with gmake target
- Bug 2550759: pchheader option has wrong type
- Bug 1900333: Parentheses in build path
- Bug 2790865: SharedLib on OSX fixes (Ash Berlin)
- Bug 2790882: Trailing slash in path.getabsolute (Ash Berlin)
RC2 -> RC3
- Bug 2805763: GCC PCH breaks on path
- Bug 2709641: Location field does not propagate to projects
- Bug 2675518: Dependencies wrong on config links
- Bug 2152526: Code::Blocks doesn't build PCH correctly on GCC
RC1 -> RC2
- Removed additional MonoDevelop files in clean action
- Fixed naming of system libraries in Visual Studio link step
- Set OS to Windows when generating for Visual Studio
- Bug 2801257: Linker error LNK1112 when cross-compiling for x64
-----
4.0
-----
This version is a complete rewrite of Premake.
- A new, more readable and extensible syntax for projects
- More robust syntax validation
- A new command-line format, with better argument validation
- Improved path handling across all project settings
- Upgraded to Lua 5.1.4
- Many, many bug fixes
RC4 -> Final
- Set Mac OS X linker flags for Code::Blocks
- Bug 2533504: Files above project root not added to project
RC3 -> RC4
- Embed scripts instead of bytecodes to avoid portability issues
- solution() and project() now only set the active object when
called with a name; remains unchanged otherwise
RC2 -> RC3
- Bug: GCC Windows release builds of Premake4 crash on script errors
- Patched Lua to load precompiled bytecodes on PPC architectures.
- Display paths of generated files
RC1 -> RC2
- Enabled use of absolute Windows paths to different drive letter
- Bug: Post-build commands run before build on Code::Blocks
- Removed FatalWarnings build flag
- Fixed GCC 4.2 warnings (Ryan Pusztai)
- Enable Windows linking to shared libraries even with NoImportLib
flag set (just in case)
- Fixed handling of paths in links
- Added "ToolsVersion" attribute to VS2005 and VS2008 C# projects
- Fixed separator between library dependencies in C++ makefiles
- Added missing os.copyfile() function
- Bug: Sometimes takes a long time to complete on Linux
- Enabled Lua popen support on Linux and Mac OS X
-----
3.7
-----
- Updated Lua to 5.1.3
- Added new CodeLite support target (Ryan Pusztai)
- Added new cb-ow (Code::Blocks Open Watcom) target (Tim Channon)
- Place OSX winexe's into Content/MacOS folder (William Burnson)
- Sibling executables may now be listed in package.links
- Bug 1520012: Improper Makefiles when filenames have spaces
(Diaa Sami)
- Bug 2045506: "no-exceptions" flag ignored for VS200x (Benoit Miller)
- Bug 2034470: Error in cmd line error handler
- Bug 2114152: package or config table isn't generated automatically
-----
3.6
-----
- Patch 1946122: Add support for VS2008 (Ryan Pusztai)
- Patch 1913448: Win32 crash when using '--clean --usetargetpath'
(David Walters)
- Patch 1771168: luaL_getn speed optimization (Richard O'Grady)
- Bug 1939089: Premake segfault on Linux/PPC (Fabio Till)
- Fixed "bad argument #2 to 'chdir'" error
- Disable -MMD on multiple -arch flags (poor man's Universal binary
support)
-----
3.5
-----
- Prevent creation of import libraries on OS X
- Improved handling of dylibs on OS X
- Patch 1771977: Ability to compile C source as C++ in Code::Blocks
(Ryan Pusztai)
- Bug 1804810: out-implib not present in linux gnu compler toolchain
- Bug 1806949: .Net reference paths are broken when bindir is specified
- Bug 1806960: Make clean does not remove .mdb files
- Bug 1831389: Makefiles stored in subdirs contain no targets on
first run
-----
3.4
-----
- Added `no-pch` flag to suppress precompiled headers
- Added App.config support to GNU makefiles
- Add os.mkdir() to script environment
- Makefile now creates target directory before copying .NET references
- Feature 1520182: Enhanced file-handling functions
- Bug 531878: Problems with relative paths
- Bug 1723867: Config-specific post-build on GNU target (Benoit Miller)
- Bug 1596826: XML targets doesn't escape xml entities
- Bug 1600155: Core dump due to newpackage() and matchfiles()
- Bug 1608895: resgen command shown
- Bug 1639730: Output filename is not set
- Bug 1729227: non-portable executable with relative library path
- Bug 1559951: default clean rule removes package dir
- Patch 1733674: PCH support for Code::Block targets (Ryan Pusztai)
- Patch 1746563: Ability to specify GUID for VS targets (Ryan Pusztai)
- Patch 1754867: Creating import lib of different name (Ryan Pusztai)
-----
3.3
-----
- Added support for prebuild, prelink, and postbuild commands
- Added `target` global variable to script environment
- Added build flag `no-edit-and-continue`
- Added build flags `native-wchar` and `no-native-wchar`
- Added build flag `no-manifest`
- Added build flag `seh-exceptions` (VS2005 only)
- Added `resdefines`, `respaths`, and `resoptions`
- Added `prebuildcommands`, `prelinkcommands`, and `postbuildcommands`
- Added `pchheader` and `pchsource` (Visual Studio only)
- Feature 1337547: Package-level bindir and libdir
- Bug 1565755: Generated makefiles do not work with MSYS
- Bug 1587955: Target path ignored for libs
- Bug 1574725: Static library extension for "gnu" target
- Bug 1522861: Fixed by using "ar -rcs" instead of "ar -cr && ranlib"
- Bug 1656816: Mkdir set wrong directory rights
- Bug 1655595: Compile/build problem on FreeBSD
- Bug: "gnu" clean rule doesn't work in cmd.exe
- Improved behavior of Linux findlib()
- Updated Code::Blocks support to latest project version
(major="1" minor="6")
- Patch 1681666: GNU targets always show the console if kind = 'winexe'
-----
3.2
-----
- Added support for Code::Blocks
- Updated MonoDevelop support
- Upgraded Lua to 5.0.3
- Added new matchdirs() to Lua script environment
- Expose list of packages as _PACKAGES global in Lua
- Turn off edit-and-continue in release builds with symbols
- Bug 1559873: libpaths inserts extra space after -L
-----
3.1
-----
- Added support for Visual Studio 2005
- Added support for Windows resources to GNU make target
- Added path handling functions to Lua environment
- Added matchrecursive() for recursive file searches
- Added os.fileexists() function to Lua environment
- Added os.appendfile() function to Lua environment
- Changed `monoresgen` to `resgen` to keep up with Mono project
- Added `mono2` .NET compiler set for Mono .NET 2.0 support
- Feature 1096677: exclude files from matchfiles (package.excludes)
- Bug 1439463: VS2003 RTTI problem
- Bug 1439446: GNU Makefile problem under Mingw32
- Bug 1422068: package.path="." causes bad makefiles
- Bug 1431530: makefile target fails when project path specified
-----
3.0
-----
- Upgraded Lua interpreter to version 5.0.1
- The options table now stores simple values, rather than tables
- Completed MonoDevelop support
- Improved .NET resource handling for GNU generator
- Added unit test suite
- Merged Scott Graham unicode build flag patch
- Removed package.warninglevel in favor of extra-warnings flag
- Added package.targetprefix
- Overhauled structure of generated GNU makefiles
- Added --os command line option
- Fixed bug 1268588: Use gcc to link C packages
- Fixed bug 1363306: GNU C# should copy referenced DLLs
-----
2.4
-----
- Added chdir() to Lua script environment
- Merged Thomas Harning's patch for .NET resources on GNU
- Fixed bug 1194702: Can't put multiple packages in same directory
- Fixed bug in GNU shared library builds (doh!)
- Added target 'vs2002' to replace 'vs7'
-----
2.3
-----
- Added 'project.config[]' with 'bindir' and 'libdir'
- Merged Scott Graham's "warninglevel" patch.
- Fixed bug 1153484: Import lib in wrong directory.
- Fixed bug 1013352: Stack overflow with large projects.
- Fixed bug 945406: package.files, bad value = crash
-----
2.2
-----
- Worked around VS.NET bug for .NET assemblies > 64K.
- Added --very-verbose flag to GNU generator.
- GNU generator now supports assembly sources.
-----
2.1
-----
- File extension of generated binaries can now be set
with config.targetextension.
- Windows targets now handle .def files for DLLs.
-----
2.0
-----
- Can now specify build actions per file
- Include paths are now passed to VC7 resource compiler
- Removed _WIN32 define from Cygwin makefiles
- Added package.objdir to set intermediates directory
- Added rmdir() to Lua script environment
- A big bag of bug fixes
-----
1.9
-----
- Made verbose mode even more verbose.
- posix.c now builds properly as C.
- Fixed package dependency generation for GNU and VS2003.
- Display Lua version number in usage text.
- Fixed VS link between *.aspx and *.aspx.cs files.
- Fixed VS link between *.resx and *.cs files.
- Fixed *.d file generation for gcc 2.9x.
- Unified various help options under '--help'.
- Bin and Lib paths can now be arbitrarily long.
- linkoptions are now applied in VC6 and VC7 projects.
-----
1.8
-----
- Added support for ASP.NET projects.
- Fixed a bug in VC6 support for static libraries.
- matchfiles() now uses package path instead of script path.
- Added --verbose option.
- No longer apply no-rtti and no-exceptions to *.c files.
-----
1.7
-----
- Location of generated project files can now be specified with
the project.path variable.
- Inter-package dependencies are fixed for GNU makefiles.
- No longer need to execute in same directory as project script.
- Added "c" language specifier.
- Added support for .resx and .config files to C# projects.
- Added support for full assembly names in .NET references.
- Fixed handling of paths in package.target variable.
- Improved support for SharpDevelop.
- Started support for OS X.
- Added support for Digital Mars compiler.
-------
1.6.1
-------
- VS7 generator crashed if a package was built before one of its
dependencies. Now immediately assigns UUID before processing.
-----
1.6
-----
- Added support for Visual Studio 2003 and SharpDevelop.
- Added binaries directory as a reference path for VS7.
-----
1.5
-----
- Added initial support for building static libraries.
- Added "no-main" flag, prevents overriding WinMain() on
Windows builds.
- Added "--no-rtti" and "no-exceptions" build flags to
disable those C++ features.
- Display error message when project has no packages.
- Moved VC7 *.pdb files into intermediates directory.
-----
1.4
-----
- Bug fixes to the path manipulation routines.
- GNU makefiles are regenerated when premake scripts change.
-----
1.3
-----
- Added support for the Cygwin environment.
- Added "static-runtime" build flag to statically link against C/C++
standard runtime libraries.
- Bug fixes to Visual Studio 6 and 7 generators and path reversing
algorithm.
-----
1.2
-----
- Standardized format of command-line options.
- Can now handle custom command-line options in script.
- Added new function findlib().
- Added new C++ build flag "managed" for writing C++ .NET code.
- Can now use open-source C# compilers in VS6 generator.
- Several bug fixes to the VS7 generator.
-----
1.1
-----
- Added support for custom build configurations. Added "optimize",
"optimize-size", "optimize-speed", and "no-symbols" flags to control
build settings.
- Added matchfiles() to select files using wildcards.
- Added "unsafe" flag for C# projects.
- Added newpackage() function for creating new package objects inline,
instead of creating separate scripts.
- Changed include() to dopackage() and option() to addoption(). The old
versions have been kept for compatibility, but will be deprecated
eventually.
- Major cleanup of the source code.
-----
1.0
-----
- Fixed a bug related to the reference paths in VS7 C# projects.
- Display a warning message if a reference path can't be found.
- Automatically create bin and lib directories if they do not exist.
- GNU C# projects will now properly use the configured library paths.
-------
0.9.2
-------
- Added --with-mono and --with-pnet options.
- VS7 C# projects will now properly use the configured library paths.
-------
0.9.1
-------
- Switched to Lua (http://www.lua.org/) for project script parsing.
- Add support for custom project options.
- Changed 'type' to 'kind' to avoid conflict with Lua function of the
same name.
- Changed 'conexe' to 'exe' because I liked it better.
- Changed 'library' to 'dll' for C# projects to keep things consistent.
-------
0.9.0
-------
- Initial public release.

View File

@ -1,27 +0,0 @@
Copyright (c) 2003-2011 Jason Perkins and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the Premake nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,15 +0,0 @@
PREMAKE
A build configuration tool
Copyright (C) 2002-2011 by Jason Perkins
Distributed under the terms of the BSD License, see LICENSE.txt
The Lua language and runtime library is (C) TeCGraf, PUC-Rio.
See their website at http://www.lua.org/
See the file BUILD.txt for instructions on building Premake.
For questions, comments, or more information, visit the project
website at http://industriousone.com/premake

View File

@ -1,34 +0,0 @@
# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help
ifndef config
config=release
endif
export config
PROJECTS := Premake4
.PHONY: all clean help $(PROJECTS)
all: $(PROJECTS)
Premake4:
@echo "==== Building Premake4 ($(config)) ===="
@${MAKE} --no-print-directory -C . -f Premake4.make
clean:
@${MAKE} --no-print-directory -C . -f Premake4.make clean
help:
@echo "Usage: make [config=name] [target]"
@echo ""
@echo "CONFIGURATIONS:"
@echo " release"
@echo " debug"
@echo ""
@echo "TARGETS:"
@echo " all (default)"
@echo " clean"
@echo " Premake4"
@echo ""
@echo "For more information, see http://industriousone.com/premake/quick-start"

View File

@ -1,305 +0,0 @@
# GNU Make project makefile autogenerated by Premake
ifndef config
config=release
endif
ifndef verbose
SILENT = @
endif
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
ifndef AR
AR = ar
endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/release
TARGET = $(TARGETDIR)/premake4
DEFINES += -DNDEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -Os
CXXFLAGS += $(CPPFLAGS) -Wall -Os
LDFLAGS += -s -rdynamic
LIBS += -lm
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/debug
TARGET = $(TARGETDIR)/premake4
DEFINES += -D_DEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -g
CXXFLAGS += $(CPPFLAGS) -Wall -g
LDFLAGS += -rdynamic
LIBS += -lm
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
OBJECTS := \
$(OBJDIR)/path_isabsolute.o \
$(OBJDIR)/os_getversion.o \
$(OBJDIR)/os_isfile.o \
$(OBJDIR)/os_uuid.o \
$(OBJDIR)/os_chdir.o \
$(OBJDIR)/os_pathsearch.o \
$(OBJDIR)/os_rmdir.o \
$(OBJDIR)/os_match.o \
$(OBJDIR)/scripts.o \
$(OBJDIR)/os_copyfile.o \
$(OBJDIR)/os_isdir.o \
$(OBJDIR)/os_mkdir.o \
$(OBJDIR)/os_getcwd.o \
$(OBJDIR)/premake.o \
$(OBJDIR)/string_endswith.o \
$(OBJDIR)/loadlib.o \
$(OBJDIR)/ldebug.o \
$(OBJDIR)/lstring.o \
$(OBJDIR)/lparser.o \
$(OBJDIR)/lfunc.o \
$(OBJDIR)/ldump.o \
$(OBJDIR)/liolib.o \
$(OBJDIR)/lgc.o \
$(OBJDIR)/lundump.o \
$(OBJDIR)/lopcodes.o \
$(OBJDIR)/lmem.o \
$(OBJDIR)/lstate.o \
$(OBJDIR)/ltm.o \
$(OBJDIR)/ldo.o \
$(OBJDIR)/lzio.o \
$(OBJDIR)/lstrlib.o \
$(OBJDIR)/lapi.o \
$(OBJDIR)/lbaselib.o \
$(OBJDIR)/ltablib.o \
$(OBJDIR)/llex.o \
$(OBJDIR)/loslib.o \
$(OBJDIR)/ltable.o \
$(OBJDIR)/linit.o \
$(OBJDIR)/ldblib.o \
$(OBJDIR)/lmathlib.o \
$(OBJDIR)/lobject.o \
$(OBJDIR)/lvm.o \
$(OBJDIR)/lcode.o \
$(OBJDIR)/lauxlib.o \
RESOURCES := \
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
.PHONY: clean prebuild prelink
all: $(TARGET)
@:
$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) | prelink
@echo Linking Premake4
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif
$(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif
clean:
@echo Cleaning Premake4
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif
prebuild: $(TARGETDIR) $(OBJDIR)
$(PREBUILDCMDS)
prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
$(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
endif
$(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/path_isabsolute.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getversion.o: ../../src/host/os_getversion.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getversion.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_uuid.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_chdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_pathsearch.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_rmdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_match.o: ../../src/host/os_match.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_match.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/scripts.o: ../../src/host/scripts.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/scripts.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_copyfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_mkdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getcwd.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/premake.o: ../../src/host/premake.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/premake.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/string_endswith.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loadlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldebug.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstring.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lparser.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lfunc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/liolib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lgc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lundump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lopcodes.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmem.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstate.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldo.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lzio.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstrlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lapi.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lbaselib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltablib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/llex.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loslib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltable.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/linit.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldblib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmathlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lobject.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lvm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lcode.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lauxlib.d -MT "$@" -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
-include $(GCH:%.h.gch=%.h.d)

View File

@ -1,34 +0,0 @@
# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help
ifndef config
config=release
endif
export config
PROJECTS := Premake4
.PHONY: all clean help $(PROJECTS)
all: $(PROJECTS)
Premake4:
@echo "==== Building Premake4 ($(config)) ===="
@${MAKE} --no-print-directory -C . -f Premake4.make
clean:
@${MAKE} --no-print-directory -C . -f Premake4.make clean
help:
@echo "Usage: make [config=name] [target]"
@echo ""
@echo "CONFIGURATIONS:"
@echo " release"
@echo " debug"
@echo ""
@echo "TARGETS:"
@echo " all (default)"
@echo " clean"
@echo " Premake4"
@echo ""
@echo "For more information, see http://industriousone.com/premake/quick-start"

View File

@ -1,305 +0,0 @@
# GNU Make project makefile autogenerated by Premake
ifndef config
config=release
endif
ifndef verbose
SILENT = @
endif
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
ifndef AR
AR = ar
endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/release
TARGET = $(TARGETDIR)/premake4
DEFINES += -DNDEBUG -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=10.4
CXXFLAGS += $(CPPFLAGS) -Wall -Os -mmacosx-version-min=10.4
LDFLAGS += -Wl,-x -mmacosx-version-min=10.4
LIBS += -framework CoreServices
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/debug
TARGET = $(TARGETDIR)/premake4
DEFINES += -D_DEBUG -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -g -mmacosx-version-min=10.4
CXXFLAGS += $(CPPFLAGS) -Wall -g -mmacosx-version-min=10.4
LDFLAGS += -mmacosx-version-min=10.4
LIBS += -framework CoreServices
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
OBJECTS := \
$(OBJDIR)/os_chdir.o \
$(OBJDIR)/os_copyfile.o \
$(OBJDIR)/os_getcwd.o \
$(OBJDIR)/os_getversion.o \
$(OBJDIR)/os_isdir.o \
$(OBJDIR)/os_isfile.o \
$(OBJDIR)/os_match.o \
$(OBJDIR)/os_mkdir.o \
$(OBJDIR)/os_pathsearch.o \
$(OBJDIR)/os_rmdir.o \
$(OBJDIR)/os_uuid.o \
$(OBJDIR)/path_isabsolute.o \
$(OBJDIR)/premake.o \
$(OBJDIR)/scripts.o \
$(OBJDIR)/string_endswith.o \
$(OBJDIR)/lapi.o \
$(OBJDIR)/lauxlib.o \
$(OBJDIR)/lbaselib.o \
$(OBJDIR)/lcode.o \
$(OBJDIR)/ldblib.o \
$(OBJDIR)/ldebug.o \
$(OBJDIR)/ldo.o \
$(OBJDIR)/ldump.o \
$(OBJDIR)/lfunc.o \
$(OBJDIR)/lgc.o \
$(OBJDIR)/linit.o \
$(OBJDIR)/liolib.o \
$(OBJDIR)/llex.o \
$(OBJDIR)/lmathlib.o \
$(OBJDIR)/lmem.o \
$(OBJDIR)/loadlib.o \
$(OBJDIR)/lobject.o \
$(OBJDIR)/lopcodes.o \
$(OBJDIR)/loslib.o \
$(OBJDIR)/lparser.o \
$(OBJDIR)/lstate.o \
$(OBJDIR)/lstring.o \
$(OBJDIR)/lstrlib.o \
$(OBJDIR)/ltable.o \
$(OBJDIR)/ltablib.o \
$(OBJDIR)/ltm.o \
$(OBJDIR)/lundump.o \
$(OBJDIR)/lvm.o \
$(OBJDIR)/lzio.o \
RESOURCES := \
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
.PHONY: clean prebuild prelink
all: $(TARGET)
@:
$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) | prelink
@echo Linking Premake4
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif
$(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif
clean:
@echo Cleaning Premake4
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif
prebuild: $(TARGETDIR) $(OBJDIR)
$(PREBUILDCMDS)
prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
$(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
endif
$(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_chdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_copyfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getcwd.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getversion.o: ../../src/host/os_getversion.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getversion.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_match.o: ../../src/host/os_match.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_match.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_mkdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_pathsearch.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_rmdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_uuid.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/path_isabsolute.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/premake.o: ../../src/host/premake.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/premake.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/scripts.o: ../../src/host/scripts.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/scripts.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/string_endswith.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lapi.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lauxlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lbaselib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lcode.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldblib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldebug.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldo.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lfunc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lgc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/linit.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/liolib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/llex.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmathlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmem.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loadlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lobject.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lopcodes.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loslib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lparser.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstate.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstring.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstrlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltable.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltablib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lundump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lvm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lzio.d -MT "$@" -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
-include $(GCH:%.h.gch=%.h.d)

View File

@ -1,34 +0,0 @@
# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help
ifndef config
config=release
endif
export config
PROJECTS := Premake4
.PHONY: all clean help $(PROJECTS)
all: $(PROJECTS)
Premake4:
@echo "==== Building Premake4 ($(config)) ===="
@${MAKE} --no-print-directory -C . -f Premake4.make
clean:
@${MAKE} --no-print-directory -C . -f Premake4.make clean
help:
@echo "Usage: make [config=name] [target]"
@echo ""
@echo "CONFIGURATIONS:"
@echo " release"
@echo " debug"
@echo ""
@echo "TARGETS:"
@echo " all (default)"
@echo " clean"
@echo " Premake4"
@echo ""
@echo "For more information, see http://industriousone.com/premake/quick-start"

View File

@ -1,305 +0,0 @@
# GNU Make project makefile autogenerated by Premake
ifndef config
config=release
endif
ifndef verbose
SILENT = @
endif
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
ifndef AR
AR = ar
endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/release
TARGET = $(TARGETDIR)/premake4
DEFINES += -DNDEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -Os
CXXFLAGS += $(CPPFLAGS) -Wall -Os
LDFLAGS += -s -rdynamic
LIBS += -lm -ldl
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/debug
TARGET = $(TARGETDIR)/premake4
DEFINES += -D_DEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.1.4/src
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -g
CXXFLAGS += $(CPPFLAGS) -Wall -g
LDFLAGS += -rdynamic
LIBS += -lm -ldl
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
OBJECTS := \
$(OBJDIR)/path_isabsolute.o \
$(OBJDIR)/os_getversion.o \
$(OBJDIR)/os_isfile.o \
$(OBJDIR)/os_uuid.o \
$(OBJDIR)/os_chdir.o \
$(OBJDIR)/os_pathsearch.o \
$(OBJDIR)/os_rmdir.o \
$(OBJDIR)/os_match.o \
$(OBJDIR)/scripts.o \
$(OBJDIR)/os_copyfile.o \
$(OBJDIR)/os_isdir.o \
$(OBJDIR)/os_mkdir.o \
$(OBJDIR)/os_getcwd.o \
$(OBJDIR)/premake.o \
$(OBJDIR)/string_endswith.o \
$(OBJDIR)/loadlib.o \
$(OBJDIR)/ldebug.o \
$(OBJDIR)/lstring.o \
$(OBJDIR)/lparser.o \
$(OBJDIR)/lfunc.o \
$(OBJDIR)/ldump.o \
$(OBJDIR)/liolib.o \
$(OBJDIR)/lgc.o \
$(OBJDIR)/lundump.o \
$(OBJDIR)/lopcodes.o \
$(OBJDIR)/lmem.o \
$(OBJDIR)/lstate.o \
$(OBJDIR)/ltm.o \
$(OBJDIR)/ldo.o \
$(OBJDIR)/lzio.o \
$(OBJDIR)/lstrlib.o \
$(OBJDIR)/lapi.o \
$(OBJDIR)/lbaselib.o \
$(OBJDIR)/ltablib.o \
$(OBJDIR)/llex.o \
$(OBJDIR)/loslib.o \
$(OBJDIR)/ltable.o \
$(OBJDIR)/linit.o \
$(OBJDIR)/ldblib.o \
$(OBJDIR)/lmathlib.o \
$(OBJDIR)/lobject.o \
$(OBJDIR)/lvm.o \
$(OBJDIR)/lcode.o \
$(OBJDIR)/lauxlib.o \
RESOURCES := \
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
.PHONY: clean prebuild prelink
all: $(TARGET)
@:
$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) | prelink
@echo Linking Premake4
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif
$(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif
clean:
@echo Cleaning Premake4
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif
prebuild: $(TARGETDIR) $(OBJDIR)
$(PREBUILDCMDS)
prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
$(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
endif
$(OBJDIR)/path_isabsolute.o: ../../src/host/path_isabsolute.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/path_isabsolute.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getversion.o: ../../src/host/os_getversion.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getversion.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isfile.o: ../../src/host/os_isfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_uuid.o: ../../src/host/os_uuid.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_uuid.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_chdir.o: ../../src/host/os_chdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_chdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_pathsearch.o: ../../src/host/os_pathsearch.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_pathsearch.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_rmdir.o: ../../src/host/os_rmdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_rmdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_match.o: ../../src/host/os_match.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_match.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/scripts.o: ../../src/host/scripts.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/scripts.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_copyfile.o: ../../src/host/os_copyfile.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_copyfile.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_isdir.o: ../../src/host/os_isdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_isdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_mkdir.o: ../../src/host/os_mkdir.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_mkdir.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/os_getcwd.o: ../../src/host/os_getcwd.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/os_getcwd.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/premake.o: ../../src/host/premake.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/premake.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/string_endswith.o: ../../src/host/string_endswith.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/string_endswith.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loadlib.o: ../../src/host/lua-5.1.4/src/loadlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loadlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldebug.o: ../../src/host/lua-5.1.4/src/ldebug.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldebug.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstring.o: ../../src/host/lua-5.1.4/src/lstring.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstring.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lparser.o: ../../src/host/lua-5.1.4/src/lparser.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lparser.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lfunc.o: ../../src/host/lua-5.1.4/src/lfunc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lfunc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldump.o: ../../src/host/lua-5.1.4/src/ldump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/liolib.o: ../../src/host/lua-5.1.4/src/liolib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/liolib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lgc.o: ../../src/host/lua-5.1.4/src/lgc.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lgc.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lundump.o: ../../src/host/lua-5.1.4/src/lundump.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lundump.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lopcodes.o: ../../src/host/lua-5.1.4/src/lopcodes.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lopcodes.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmem.o: ../../src/host/lua-5.1.4/src/lmem.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmem.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstate.o: ../../src/host/lua-5.1.4/src/lstate.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstate.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltm.o: ../../src/host/lua-5.1.4/src/ltm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldo.o: ../../src/host/lua-5.1.4/src/ldo.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldo.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lzio.o: ../../src/host/lua-5.1.4/src/lzio.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lzio.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lstrlib.o: ../../src/host/lua-5.1.4/src/lstrlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lstrlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lapi.o: ../../src/host/lua-5.1.4/src/lapi.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lapi.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lbaselib.o: ../../src/host/lua-5.1.4/src/lbaselib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lbaselib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltablib.o: ../../src/host/lua-5.1.4/src/ltablib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltablib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/llex.o: ../../src/host/lua-5.1.4/src/llex.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/llex.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/loslib.o: ../../src/host/lua-5.1.4/src/loslib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/loslib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ltable.o: ../../src/host/lua-5.1.4/src/ltable.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ltable.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/linit.o: ../../src/host/lua-5.1.4/src/linit.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/linit.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/ldblib.o: ../../src/host/lua-5.1.4/src/ldblib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/ldblib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lmathlib.o: ../../src/host/lua-5.1.4/src/lmathlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lmathlib.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lobject.o: ../../src/host/lua-5.1.4/src/lobject.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lobject.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lvm.o: ../../src/host/lua-5.1.4/src/lvm.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lvm.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lcode.o: ../../src/host/lua-5.1.4/src/lcode.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lcode.d -MT "$@" -o "$@" -c "$<"
$(OBJDIR)/lauxlib.o: ../../src/host/lua-5.1.4/src/lauxlib.c $(GCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CC) $(PCHINCLUDES) $(CFLAGS) -MF $(OBJDIR)/lauxlib.d -MT "$@" -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
-include $(GCH:%.h.gch=%.h.d)

View File

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 13.00
# Visual Studio 2013
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Premake4", "Premake4.vcxproj", "{C01B3660-A453-4F42-B58C-F0B862AF8C1C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Debug|Win32 = Debug|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C01B3660-A453-4F42-B58C-F0B862AF8C1C}.Release|Win32.ActiveCfg = Release|Win32
{C01B3660-A453-4F42-B58C-F0B862AF8C1C}.Release|Win32.Build.0 = Release|Win32
{C01B3660-A453-4F42-B58C-F0B862AF8C1C}.Debug|Win32.ActiveCfg = Debug|Win32
{C01B3660-A453-4F42-B58C-F0B862AF8C1C}.Debug|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,332 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C01B3660-A453-4F42-B58C-F0B862AF8C1C}</ProjectGuid>
<RootNamespace>Premake4</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">obj\Release\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">premake4</TargetName>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj\Debug\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">premake4</TargetName>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MinSpace</Optimization>
<AdditionalIncludeDirectories>..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader></PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat></DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<OutputFile>$(OutDir)premake4.exe</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<SmallerTypeCheck>true</SmallerTypeCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader></PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\host\lua-5.1.4\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<OutputFile>$(OutDir)premake4.exe</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDataBaseFileName>$(OutDir)premake4.pdb</ProgramDataBaseFileName>
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\src\host\premake.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lapi.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lauxlib.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lcode.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ldebug.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ldo.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lfunc.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lgc.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\llex.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\llimits.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lmem.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lobject.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lopcodes.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lparser.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lstate.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lstring.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ltable.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ltm.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lua.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\luaconf.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lualib.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lundump.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lvm.h" />
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lzio.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\host\os_chdir.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_copyfile.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_getcwd.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_getversion.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_isdir.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_isfile.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_match.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_mkdir.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_pathsearch.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_rmdir.c">
</ClCompile>
<ClCompile Include="..\..\src\host\os_uuid.c">
</ClCompile>
<ClCompile Include="..\..\src\host\path_isabsolute.c">
</ClCompile>
<ClCompile Include="..\..\src\host\premake.c">
</ClCompile>
<ClCompile Include="..\..\src\host\scripts.c">
</ClCompile>
<ClCompile Include="..\..\src\host\string_endswith.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lapi.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lauxlib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lbaselib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lcode.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldblib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldebug.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldo.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldump.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lfunc.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lgc.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\linit.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\liolib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\llex.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lmathlib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lmem.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\loadlib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lobject.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lopcodes.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\loslib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lparser.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstate.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstring.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstrlib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltable.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltablib.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltm.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lundump.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lvm.c">
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lzio.c">
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\BUILD.txt" />
<None Include="..\..\CHANGES.txt" />
<None Include="..\..\LICENSE.txt" />
<None Include="..\..\README.txt" />
<None Include="..\..\premake4.lua" />
<None Include="..\..\scripts\embed.lua" />
<None Include="..\..\scripts\release.lua" />
<None Include="..\..\src\_manifest.lua" />
<None Include="..\..\src\_premake_main.lua" />
<None Include="..\..\src\actions\clean\_clean.lua" />
<None Include="..\..\src\actions\codeblocks\codeblocks_cbp.lua" />
<None Include="..\..\src\actions\codeblocks\codeblocks_workspace.lua" />
<None Include="..\..\src\actions\codeblocks\_codeblocks.lua" />
<None Include="..\..\src\actions\codelite\codelite_project.lua" />
<None Include="..\..\src\actions\codelite\codelite_workspace.lua" />
<None Include="..\..\src\actions\codelite\_codelite.lua" />
<None Include="..\..\src\actions\example\example_project.lua" />
<None Include="..\..\src\actions\example\example_solution.lua" />
<None Include="..\..\src\actions\example\_example.lua" />
<None Include="..\..\src\actions\make\make_cpp.lua" />
<None Include="..\..\src\actions\make\make_csharp.lua" />
<None Include="..\..\src\actions\make\make_solution.lua" />
<None Include="..\..\src\actions\make\_make.lua" />
<None Include="..\..\src\actions\vstudio\vs2002_csproj.lua" />
<None Include="..\..\src\actions\vstudio\vs2002_csproj_user.lua" />
<None Include="..\..\src\actions\vstudio\vs2002_solution.lua" />
<None Include="..\..\src\actions\vstudio\vs2003_solution.lua" />
<None Include="..\..\src\actions\vstudio\vs2005_csproj.lua" />
<None Include="..\..\src\actions\vstudio\vs2005_csproj_user.lua" />
<None Include="..\..\src\actions\vstudio\vs2005_solution.lua" />
<None Include="..\..\src\actions\vstudio\vs200x_vcproj.lua" />
<None Include="..\..\src\actions\vstudio\vs2010_vcxproxj.lua" />
<None Include="..\..\src\actions\vstudio\vs_generic_solution.lua" />
<None Include="..\..\src\actions\vstudio\_vstudio.lua" />
<None Include="..\..\src\actions\xcode\xcode4_workspace.lua" />
<None Include="..\..\src\actions\xcode\xcode_common.lua" />
<None Include="..\..\src\actions\xcode\xcode_project.lua" />
<None Include="..\..\src\actions\xcode\_xcode.lua" />
<None Include="..\..\src\base\action.lua" />
<None Include="..\..\src\base\api.lua" />
<None Include="..\..\src\base\cmdline.lua" />
<None Include="..\..\src\base\configs.lua" />
<None Include="..\..\src\base\globals.lua" />
<None Include="..\..\src\base\help.lua" />
<None Include="..\..\src\base\io.lua" />
<None Include="..\..\src\base\option.lua" />
<None Include="..\..\src\base\os.lua" />
<None Include="..\..\src\base\path.lua" />
<None Include="..\..\src\base\premake.lua" />
<None Include="..\..\src\base\project.lua" />
<None Include="..\..\src\base\solution.lua" />
<None Include="..\..\src\base\string.lua" />
<None Include="..\..\src\base\table.lua" />
<None Include="..\..\src\base\tree.lua" />
<None Include="..\..\src\base\validate.lua" />
<None Include="..\..\src\tools\dotnet.lua" />
<None Include="..\..\src\tools\gcc.lua" />
<None Include="..\..\src\tools\msc.lua" />
<None Include="..\..\src\tools\ow.lua" />
<None Include="..\..\tests\pepperfish_profiler.lua" />
<None Include="..\..\tests\premake4.lua" />
<None Include="..\..\tests\testfx.lua" />
<None Include="..\..\tests\test_dofile.lua" />
<None Include="..\..\tests\test_gcc.lua" />
<None Include="..\..\tests\test_gmake_cpp.lua" />
<None Include="..\..\tests\test_gmake_cs.lua" />
<None Include="..\..\tests\test_keywords.lua" />
<None Include="..\..\tests\test_platforms.lua" />
<None Include="..\..\tests\test_premake.lua" />
<None Include="..\..\tests\test_project.lua" />
<None Include="..\..\tests\test_stress.lua" />
<None Include="..\..\tests\test_string.lua" />
<None Include="..\..\tests\test_targets.lua" />
<None Include="..\..\tests\test_vs2002_sln.lua" />
<None Include="..\..\tests\test_vs2003_sln.lua" />
<None Include="..\..\tests\test_vs2005_sln.lua" />
<None Include="..\..\tests\test_vs2008_sln.lua" />
<None Include="..\..\tests\test_vs2010_sln.lua" />
<None Include="..\..\tests\actions\test_clean.lua" />
<None Include="..\..\tests\actions\make\test_make_escaping.lua" />
<None Include="..\..\tests\actions\make\test_make_pch.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2005_csproj.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs200x_vcproj.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs200x_vcproj_linker.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2010_filters.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2010_flags.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2010_links.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2010_project_kinds.lua" />
<None Include="..\..\tests\actions\vstudio\test_vs2010_vcxproj.lua" />
<None Include="..\..\tests\actions\xcode\test_xcode_common.lua" />
<None Include="..\..\tests\actions\xcode\test_xcode_dependencies.lua" />
<None Include="..\..\tests\actions\xcode\test_xcode_project.lua" />
<None Include="..\..\tests\base\test_action.lua" />
<None Include="..\..\tests\base\test_api.lua" />
<None Include="..\..\tests\base\test_baking.lua" />
<None Include="..\..\tests\base\test_config.lua" />
<None Include="..\..\tests\base\test_os.lua" />
<None Include="..\..\tests\base\test_path.lua" />
<None Include="..\..\tests\base\test_table.lua" />
<None Include="..\..\tests\base\test_tree.lua" />
<None Include="..\..\tests\folder\ok.lua" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,574 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{36BA0540-A6A1-114F-89F3-042F36024844}</UniqueIdentifier>
</Filter>
<Filter Include="src\host">
<UniqueIdentifier>{FA5D4911-18C5-E44B-97AA-94331270D873}</UniqueIdentifier>
</Filter>
<Filter Include="src\host\lua-5.1.4">
<UniqueIdentifier>{BC8BA9DE-6170-EF4B-AA76-2273C329A3E4}</UniqueIdentifier>
</Filter>
<Filter Include="src\host\lua-5.1.4\src">
<UniqueIdentifier>{5C53251B-4541-0849-9C7B-807CA0D0554C}</UniqueIdentifier>
</Filter>
<Filter Include="scripts">
<UniqueIdentifier>{537A43E1-A784-DF44-8869-FF09689E64FB}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions">
<UniqueIdentifier>{27AF517C-10D6-5C4F-A114-CCA3E2E417CD}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\clean">
<UniqueIdentifier>{E36E9579-D1B5-4C4B-8597-C1BC428BE96B}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\codeblocks">
<UniqueIdentifier>{A766B337-8045-DA44-BF73-E8C2089012DA}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\codelite">
<UniqueIdentifier>{3F536621-36C9-3043-AF39-153814F57430}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\example">
<UniqueIdentifier>{4EB65216-E256-C14B-BA94-2635DCED676B}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\make">
<UniqueIdentifier>{8EB2000D-3744-2A4D-AF31-24AC9660A207}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\vstudio">
<UniqueIdentifier>{6682BEBB-F371-8147-BC19-9517F943B28F}</UniqueIdentifier>
</Filter>
<Filter Include="src\actions\xcode">
<UniqueIdentifier>{B39B9E1D-A0D8-6B4A-85FD-1B1D7B280012}</UniqueIdentifier>
</Filter>
<Filter Include="src\base">
<UniqueIdentifier>{E8945B2E-79D8-7149-B32E-AE3DBB150E49}</UniqueIdentifier>
</Filter>
<Filter Include="src\tools">
<UniqueIdentifier>{390645CE-5B7D-3E42-942D-78343FD35821}</UniqueIdentifier>
</Filter>
<Filter Include="tests">
<UniqueIdentifier>{BC4F4D40-597C-F748-A666-2EDFA87150AD}</UniqueIdentifier>
</Filter>
<Filter Include="tests\actions">
<UniqueIdentifier>{0719453C-23E3-6345-B3DE-1218B5C12237}</UniqueIdentifier>
</Filter>
<Filter Include="tests\actions\make">
<UniqueIdentifier>{244F8DEA-E911-6948-BF29-2DB61556CA92}</UniqueIdentifier>
</Filter>
<Filter Include="tests\actions\vstudio">
<UniqueIdentifier>{6993107F-6A69-B84A-99D8-6F338A127BCC}</UniqueIdentifier>
</Filter>
<Filter Include="tests\actions\xcode">
<UniqueIdentifier>{83AA069D-DDDF-974F-B32B-F5398FB5E77A}</UniqueIdentifier>
</Filter>
<Filter Include="tests\base">
<UniqueIdentifier>{86F6ABC5-91A9-9949-9588-A5DA9BB558E5}</UniqueIdentifier>
</Filter>
<Filter Include="tests\folder">
<UniqueIdentifier>{38AB070D-9B03-9E46-8DE8-B0E5B34ACD23}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\host\premake.h">
<Filter>src\host</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lapi.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lauxlib.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lcode.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ldebug.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ldo.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lfunc.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lgc.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\llex.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\llimits.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lmem.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lobject.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lopcodes.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lparser.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lstate.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lstring.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ltable.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\ltm.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lua.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\luaconf.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lualib.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lundump.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lvm.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
<ClInclude Include="..\..\src\host\lua-5.1.4\src\lzio.h">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\host\os_chdir.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_copyfile.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_getcwd.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_getversion.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_isdir.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_isfile.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_match.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_mkdir.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_pathsearch.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_rmdir.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\os_uuid.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\path_isabsolute.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\premake.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\scripts.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\string_endswith.c">
<Filter>src\host</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lapi.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lauxlib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lbaselib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lcode.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldblib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldebug.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldo.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ldump.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lfunc.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lgc.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\linit.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\liolib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\llex.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lmathlib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lmem.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\loadlib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lobject.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lopcodes.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\loslib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lparser.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstate.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstring.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lstrlib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltable.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltablib.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\ltm.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lundump.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lvm.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\host\lua-5.1.4\src\lzio.c">
<Filter>src\host\lua-5.1.4\src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\BUILD.txt" />
<None Include="..\..\CHANGES.txt" />
<None Include="..\..\LICENSE.txt" />
<None Include="..\..\README.txt" />
<None Include="..\..\premake4.lua" />
<None Include="..\..\scripts\embed.lua">
<Filter>scripts</Filter>
</None>
<None Include="..\..\scripts\release.lua">
<Filter>scripts</Filter>
</None>
<None Include="..\..\src\_manifest.lua">
<Filter>src</Filter>
</None>
<None Include="..\..\src\_premake_main.lua">
<Filter>src</Filter>
</None>
<None Include="..\..\src\actions\clean\_clean.lua">
<Filter>src\actions\clean</Filter>
</None>
<None Include="..\..\src\actions\codeblocks\codeblocks_cbp.lua">
<Filter>src\actions\codeblocks</Filter>
</None>
<None Include="..\..\src\actions\codeblocks\codeblocks_workspace.lua">
<Filter>src\actions\codeblocks</Filter>
</None>
<None Include="..\..\src\actions\codeblocks\_codeblocks.lua">
<Filter>src\actions\codeblocks</Filter>
</None>
<None Include="..\..\src\actions\codelite\codelite_project.lua">
<Filter>src\actions\codelite</Filter>
</None>
<None Include="..\..\src\actions\codelite\codelite_workspace.lua">
<Filter>src\actions\codelite</Filter>
</None>
<None Include="..\..\src\actions\codelite\_codelite.lua">
<Filter>src\actions\codelite</Filter>
</None>
<None Include="..\..\src\actions\example\example_project.lua">
<Filter>src\actions\example</Filter>
</None>
<None Include="..\..\src\actions\example\example_solution.lua">
<Filter>src\actions\example</Filter>
</None>
<None Include="..\..\src\actions\example\_example.lua">
<Filter>src\actions\example</Filter>
</None>
<None Include="..\..\src\actions\make\make_cpp.lua">
<Filter>src\actions\make</Filter>
</None>
<None Include="..\..\src\actions\make\make_csharp.lua">
<Filter>src\actions\make</Filter>
</None>
<None Include="..\..\src\actions\make\make_solution.lua">
<Filter>src\actions\make</Filter>
</None>
<None Include="..\..\src\actions\make\_make.lua">
<Filter>src\actions\make</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2002_csproj.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2002_csproj_user.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2002_solution.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2003_solution.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2005_csproj.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2005_csproj_user.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2005_solution.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs200x_vcproj.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs2010_vcxproxj.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\vs_generic_solution.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\vstudio\_vstudio.lua">
<Filter>src\actions\vstudio</Filter>
</None>
<None Include="..\..\src\actions\xcode\xcode4_workspace.lua">
<Filter>src\actions\xcode</Filter>
</None>
<None Include="..\..\src\actions\xcode\xcode_common.lua">
<Filter>src\actions\xcode</Filter>
</None>
<None Include="..\..\src\actions\xcode\xcode_project.lua">
<Filter>src\actions\xcode</Filter>
</None>
<None Include="..\..\src\actions\xcode\_xcode.lua">
<Filter>src\actions\xcode</Filter>
</None>
<None Include="..\..\src\base\action.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\api.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\cmdline.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\configs.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\globals.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\help.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\io.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\option.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\os.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\path.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\premake.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\project.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\solution.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\string.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\table.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\tree.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\base\validate.lua">
<Filter>src\base</Filter>
</None>
<None Include="..\..\src\tools\dotnet.lua">
<Filter>src\tools</Filter>
</None>
<None Include="..\..\src\tools\gcc.lua">
<Filter>src\tools</Filter>
</None>
<None Include="..\..\src\tools\msc.lua">
<Filter>src\tools</Filter>
</None>
<None Include="..\..\src\tools\ow.lua">
<Filter>src\tools</Filter>
</None>
<None Include="..\..\tests\pepperfish_profiler.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\premake4.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\testfx.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_dofile.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_gcc.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_gmake_cpp.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_gmake_cs.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_keywords.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_platforms.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_premake.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_project.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_stress.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_string.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_targets.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_vs2002_sln.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_vs2003_sln.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_vs2005_sln.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_vs2008_sln.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\test_vs2010_sln.lua">
<Filter>tests</Filter>
</None>
<None Include="..\..\tests\actions\test_clean.lua">
<Filter>tests\actions</Filter>
</None>
<None Include="..\..\tests\actions\make\test_make_escaping.lua">
<Filter>tests\actions\make</Filter>
</None>
<None Include="..\..\tests\actions\make\test_make_pch.lua">
<Filter>tests\actions\make</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2005_csproj.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs200x_vcproj.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs200x_vcproj_linker.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2010_filters.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2010_flags.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2010_links.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2010_project_kinds.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\vstudio\test_vs2010_vcxproj.lua">
<Filter>tests\actions\vstudio</Filter>
</None>
<None Include="..\..\tests\actions\xcode\test_xcode_common.lua">
<Filter>tests\actions\xcode</Filter>
</None>
<None Include="..\..\tests\actions\xcode\test_xcode_dependencies.lua">
<Filter>tests\actions\xcode</Filter>
</None>
<None Include="..\..\tests\actions\xcode\test_xcode_project.lua">
<Filter>tests\actions\xcode</Filter>
</None>
<None Include="..\..\tests\base\test_action.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_api.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_baking.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_config.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_os.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_path.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_table.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\base\test_tree.lua">
<Filter>tests\base</Filter>
</None>
<None Include="..\..\tests\folder\ok.lua">
<Filter>tests\folder</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@ -1,258 +0,0 @@
# Doxyfile 1.5.1-p1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Premake Internals"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = ""
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */UnitTest++/* */lua-5.1.1/*
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View File

@ -1,128 +0,0 @@
--
-- Premake 4.x build configuration script
--
--
-- Define the project. Put the release configuration first so it will be the
-- default when folks build using the makefile. That way they don't have to
-- worry about the /scripts argument and all that.
--
solution "Premake4"
configurations { "Release", "Debug" }
location ( _OPTIONS["to"] )
project "Premake4"
targetname "premake4"
language "C"
kind "ConsoleApp"
flags { "No64BitChecks", "ExtraWarnings", "StaticRuntime" }
includedirs { "src/host/lua-5.1.4/src" }
files
{
"*.txt", "**.lua",
"src/**.h", "src/**.c",
"src/host/scripts.c"
}
excludes
{
"src/premake.lua",
"src/host/lua-5.1.4/src/lua.c",
"src/host/lua-5.1.4/src/luac.c",
"src/host/lua-5.1.4/src/print.c",
"src/host/lua-5.1.4/**.lua",
"src/host/lua-5.1.4/etc/*.c"
}
configuration "Debug"
targetdir "bin/debug"
defines "_DEBUG"
flags { "Symbols" }
configuration "Release"
targetdir "bin/release"
defines "NDEBUG"
flags { "OptimizeSize" }
configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
configuration "bsd"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
links { "m" }
configuration "linux"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
links { "m", "dl" }
configuration "macosx"
defines { "LUA_USE_MACOSX" }
links { "CoreServices.framework" }
configuration { "macosx", "gmake" }
buildoptions{ "-mmacosx-version-min=10.4" }
linkoptions { "-mmacosx-version-min=10.4" }
configuration { "not windows", "not solaris", "not macosx" }
linkoptions { "-rdynamic" }
configuration { "solaris" }
linkoptions { "-Wl,--export-dynamic" }
--
-- A more thorough cleanup.
--
if _ACTION == "clean" then
os.rmdir("bin")
os.rmdir("build")
end
--
-- Use the --to=path option to control where the project files get generated. I use
-- this to create project files for each supported toolset, each in their own folder,
-- in preparation for deployment.
--
newoption {
trigger = "to",
value = "path",
description = "Set the output location for the generated files"
}
--
-- Use the embed action to convert all of the Lua scripts into C strings, which
-- can then be built into the executable. Always embed the scripts before creating
-- a release build.
--
dofile("scripts/embed.lua")
newaction {
trigger = "embed",
description = "Embed scripts in scripts.c; required before release builds",
execute = doembed
}
--
-- Use the release action to prepare source and binary packages for a new release.
-- This action isn't complete yet; a release still requires some manual work.
--
dofile("scripts/release.lua")
newaction {
trigger = "release",
description = "Prepare a new release (incomplete)",
execute = dorelease
}

View File

@ -1,57 +0,0 @@
PREMAKE RELEASE CHECKLIST
-------------------------
VERSION NUMBERS
4.0
4.0-beta1
4.0-rc1
4.0.1
PREP
* Make sure all tests pass on Windows and POSIX
* Update CHANGELOG.txt as needed
* Prep release announcement for forums
* Run `premake4 embed`
* Commit all changes to premake-stable
* Tag premake-stable with the version number and push
* Pull changes to premake-dev
BUILD
* On each platform, run `premake4 release {version} binary`
* On one platform, run `premake4 release {version} source`
* If desired, copy binary to local path
* Upload packages (in release/) to SourceForge
RELEASE
* On SourceForge, set package properties (platform, etc.)
* Update the download page
http://industriousone.com/premake/download
* Post release announcement to the forums
* Update the Latest News on the project home page
* Post annoucement to @industrious on Twitter
* Post announcement to email list
* Post announcement to Industrious Facebook group
* Add release to Freshmeat
http://freshmeat.net/projects/premake

View File

@ -1,96 +0,0 @@
--
-- Embed the Lua scripts into src/host/scripts.c as static data buffers.
-- I embed the actual scripts, rather than Lua bytecodes, because the
-- bytecodes are not portable to different architectures, which causes
-- issues in Mac OS X Universal builds.
--
local function stripfile(fname)
local f = io.open(fname)
local s = f:read("*a")
f:close()
-- strip tabs
s = s:gsub("[\t]", "")
-- strip any CRs
s = s:gsub("[\r]", "")
-- strip out comments
s = s:gsub("\n%-%-[^\n]*", "")
-- escape backslashes
s = s:gsub("\\", "\\\\")
-- strip duplicate line feeds
s = s:gsub("\n+", "\n")
-- strip out leading comments
s = s:gsub("^%-%-\n", "")
-- escape line feeds
s = s:gsub("\n", "\\n")
-- escape double quote marks
s = s:gsub("\"", "\\\"")
return s
end
local function writeline(out, s, continues)
out:write("\t\"")
out:write(s)
out:write(iif(continues, "\"\n", "\",\n"))
end
local function writefile(out, fname, contents)
local max = 1024
out:write("\t/* " .. fname .. " */\n")
-- break up large strings to fit in Visual Studio's string length limit
local start = 1
local len = contents:len()
while start <= len do
local n = len - start
if n > max then n = max end
local finish = start + n
-- make sure I don't cut an escape sequence
while contents:sub(finish, finish) == "\\" do
finish = finish - 1
end
writeline(out, contents:sub(start, finish), finish < len)
start = finish + 1
end
out:write("\n")
end
function doembed()
-- load the manifest of script files
scripts = dofile("src/_manifest.lua")
-- main script always goes at the end
table.insert(scripts, "_premake_main.lua")
-- open scripts.c and write the file header
local out = io.open("src/host/scripts.c", "w+b")
out:write("/* Premake's Lua scripts, as static data buffers for release mode builds */\n")
out:write("/* DO NOT EDIT - this file is autogenerated - see BUILD.txt */\n")
out:write("/* To regenerate this file, run: premake4 embed */ \n\n")
out:write("const char* builtin_scripts[] = {\n")
for i,fn in ipairs(scripts) do
print(fn)
local s = stripfile("src/" .. fn)
writefile(out, fn, s)
end
out:write("\t0\n};\n");
out:close()
end

View File

@ -1,216 +0,0 @@
--
-- Prepare a new Premake release. This is still incomplete and some manual
-- work is needed to get everything packaged up. See RELEASE.txt in this
-- folder for the full checklist.
--
-- Info on using Mercurial to manage releases:
-- http://hgbook.red-bean.com/read/managing-releases-and-branchy-development.html
-- http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
--
function dorelease()
local z
local hgroot = "https://bitbucket.org/premake/premake-stable"
--
-- Helper function: runs a command (formatted, with optional arguments) and
-- suppresses any output. Works on both Windows and POSIX. Might be a good
-- candidate for a core function.
--
local function exec(cmd, ...)
cmd = string.format(cmd, unpack(arg))
local z = os.execute(cmd .. " > output.log 2> error.log")
os.remove("output.log")
os.remove("error.log")
return z
end
--
-- Make sure a version was specified
--
if #_ARGS ~= 2 then
error("** Usage: release [version] [source | binary]", 0)
end
local version = _ARGS[1]
local kind = _ARGS[2]
local pkgname = "premake-" .. version
--
-- Look for required utilities
--
local required = { "hg", "zip", "tar", "make", "gcc" }
for _, value in ipairs(required) do
z = exec("%s --version", value)
if z ~= 0 then
error("** '" .. value .. "' not found", 0)
end
end
--
-- Pre-release checklist
--
print( "")
print( "BEFORE RUNNING THIS SCRIPT follow the checklist in RELEASE.txt" )
print( "")
print( "Press [Enter] to begin.")
io .read()
---------------------------------------------------------------------------
--
-- Everything below this needs to be reworked for Mercurial
--
---------------------------------------------------------------------------
--
-- Check out the release tagged sources to releases/
--
print("Downloading release tag...")
os.mkdir("release")
os.chdir("release")
os.rmdir(pkgname)
z = exec( "hg clone -r %s %s %s", version, hgroot, pkgname)
if z ~= 0 then
error("** Failed to download tagged sources", 0)
end
os.chdir(pkgname)
--
-- Update the version number in premake.c
--
print("Updating version number...")
io.input("src/host/premake.c")
local text = io.read("*a")
text = text:gsub("HEAD", version)
io.output("src/host/premake.c")
io.write(text)
io.close()
--
-- Make absolutely sure the embedded scripts have been updated
--
print("Updating embedded scripts...")
z = exec("premake4 embed")
if z ~= 0 then
error("** Failed to update the embedded scripts", 0)
end
--
-- Generate source packaging
--
if kind == "source" then
--
-- Remove extra directories
--
print("Cleaning up the source tree...")
os.rmdir("samples")
os.rmdir("packages")
os.rmdir(".hg")
os.rmdir(".hgignore")
os.rmdir(".hgtags")
--
-- Generate project files to the build directory
--
print("Generating project files...")
exec("premake4 /to=build/vs2005 vs2005")
exec("premake4 /to=build/vs2008 vs2008")
exec("premake4 /to=build/vs2010 vs2010")
exec("premake4 /to=build/vs2012 vs2012")
exec("premake4 /to=build/vs2013 vs2013")
exec("premake4 /to=build/gmake.windows /os=windows gmake")
exec("premake4 /to=build/gmake.unix /os=linux gmake")
exec("premake4 /to=build/gmake.macosx /os=macosx /platform=universal32 gmake")
exec("premake4 /to=build/codeblocks.windows /os=windows codeblocks")
exec("premake4 /to=build/codeblocks.unix /os=linux codeblocks")
exec("premake4 /to=build/codeblocks.macosx /os=macosx /platform=universal32 codeblocks")
exec("premake4 /to=build/codelite.windows /os=windows codelite")
exec("premake4 /to=build/codelite.unix /os=linux codelite")
exec("premake4 /to=build/codelite.macosx /os=macosx /platform=universal32 codelite")
exec("premake4 /to=build/xcode3 /platform=universal32 xcode3")
--
-- Create source package
--
print("Creating source code package...")
os.chdir("..")
exec("zip -r9 %s-src.zip %s/*", pkgname, pkgname)
--
-- Create a binary package for this platform. This step requires a working
-- GNU/Make/GCC environment. I use MinGW on Windows.
--
else
print("Building platform binary release...")
exec("premake4 /platform=universal32 gmake")
exec("make config=%s", iif(os.is("macosx"), "releaseuniv32", "release"))
local fname
os.chdir("bin/release")
if os.is("windows") then
fname = string.format("%s-windows.zip", pkgname)
exec("zip -9 %s premake4.exe", fname)
else
fname = string.format("%s-%s.tar.gz", pkgname, os.get())
exec("tar czvf %s premake4", fname)
end
os.copyfile(fname, "../../../" .. fname)
os.chdir("../../..")
end
--
-- Upload files to SourceForge
--
--
-- Clean up
--
os.rmdir(pkgname)
print("")
print( "Finished.")
end

View File

@ -1,74 +0,0 @@
--
-- _manifest.lua
-- Manage the list of built-in Premake scripts.
-- Copyright (c) 2002-2010 Jason Perkins and the Premake project
--
-- The master list of built-in scripts. Order is important! If you want to
-- build a new script into Premake, add it to this list.
return
{
-- core files
"base/os.lua",
"base/path.lua",
"base/string.lua",
"base/table.lua",
"base/io.lua",
"base/globals.lua",
"base/action.lua",
"base/option.lua",
"base/tree.lua",
"base/solution.lua",
"base/project.lua",
"base/configs.lua",
"base/api.lua",
"base/cmdline.lua",
"tools/dotnet.lua",
"tools/gcc.lua",
"tools/msc.lua",
"tools/ow.lua",
"base/validate.lua",
"base/help.lua",
"base/premake.lua",
-- CodeBlocks action
"actions/codeblocks/_codeblocks.lua",
"actions/codeblocks/codeblocks_workspace.lua",
"actions/codeblocks/codeblocks_cbp.lua",
-- CodeLite action
"actions/codelite/_codelite.lua",
"actions/codelite/codelite_workspace.lua",
"actions/codelite/codelite_project.lua",
-- GNU make action
"actions/make/_make.lua",
"actions/make/make_solution.lua",
"actions/make/make_cpp.lua",
"actions/make/make_csharp.lua",
-- Visual Studio actions
"actions/vstudio/_vstudio.lua",
"actions/vstudio/vs2002_solution.lua",
"actions/vstudio/vs2002_csproj.lua",
"actions/vstudio/vs2002_csproj_user.lua",
"actions/vstudio/vs200x_vcproj.lua",
"actions/vstudio/vs2003_solution.lua",
"actions/vstudio/vs2005_solution.lua",
"actions/vstudio/vs2005_csproj.lua",
"actions/vstudio/vs2005_csproj_user.lua",
"actions/vstudio/vs_generic_solution.lua",
"actions/vstudio/vs2010_vcxproxj.lua",
-- Xcode action
"actions/xcode/_xcode.lua",
"actions/xcode/xcode_common.lua",
"actions/xcode/xcode_project.lua",
-- Xcode4 action
"actions/xcode/xcode4_workspace.lua",
-- Clean action
"actions/clean/_clean.lua",
}

View File

@ -1,154 +0,0 @@
--
-- _premake_main.lua
-- Script-side entry point for the main program logic.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
local scriptfile = "premake4.lua"
local shorthelp = "Type 'premake4 --help' for help"
local versionhelp = "premake4 (Premake Build Script Generator) %s"
--
-- Inject a new target platform into each solution; called if the --platform
-- argument was specified on the command line.
--
local function injectplatform(platform)
if not platform then return true end
platform = premake.checkvalue(platform, premake.fields.platforms.allowed)
for sln in premake.solution.each() do
local platforms = sln.platforms or { }
-- an empty table is equivalent to a native build
if #platforms == 0 then
table.insert(platforms, "Native")
end
-- the solution must provide a native build in order to support this feature
if not table.contains(platforms, "Native") then
return false, sln.name .. " does not target native platform\nNative platform settings are required for the --platform feature."
end
-- add it to the end of the list, if it isn't in there already
if not table.contains(platforms, platform) then
table.insert(platforms, platform)
end
sln.platforms = platforms
end
return true
end
--
-- Script-side program entry point.
--
function _premake_main(scriptpath)
-- if running off the disk (in debug mode), load everything
-- listed in _manifest.lua; the list divisions make sure
-- everything gets initialized in the proper order.
if (scriptpath) then
local scripts = dofile(scriptpath .. "/_manifest.lua")
for _,v in ipairs(scripts) do
dofile(scriptpath .. "/" .. v)
end
end
-- Set up the environment for the chosen action early, so side-effects
-- can be picked up by the scripts.
premake.action.set(_ACTION)
-- Seed the random number generator so actions don't have to do it themselves
math.randomseed(os.time())
-- If there is a project script available, run it to get the
-- project information, available options and actions, etc.
local fname = _OPTIONS["file"] or scriptfile
if (os.isfile(fname)) then
dofile(fname)
end
-- Process special options
if (_OPTIONS["version"]) then
printf(versionhelp, _PREMAKE_VERSION)
return 1
end
if (_OPTIONS["help"]) then
premake.showhelp()
return 1
end
-- If no action was specified, show a short help message
if (not _ACTION) then
print(shorthelp)
return 1
end
-- If there wasn't a project script I've got to bail now
if (not os.isfile(fname)) then
error("No Premake script ("..scriptfile..") found!", 2)
end
-- Validate the command-line arguments. This has to happen after the
-- script has run to allow for project-specific options
action = premake.action.current()
if (not action) then
error("Error: no such action '" .. _ACTION .. "'", 0)
end
ok, err = premake.option.validate(_OPTIONS)
if (not ok) then error("Error: " .. err, 0) end
-- Sanity check the current project setup
ok, err = premake.checktools()
if (not ok) then error("Error: " .. err, 0) end
-- If a platform was specified on the command line, inject it now
ok, err = injectplatform(_OPTIONS["platform"])
if (not ok) then error("Error: " .. err, 0) end
-- work-in-progress: build the configurations
print("Building configurations...")
premake.buildconfigs()
ok, err = premake.checkprojects()
if (not ok) then error("Error: " .. err, 0) end
-- Hand over control to the action
printf("Running action '%s'...", action.trigger)
premake.action.call(action.trigger)
print("Done.")
return 0
end

View File

@ -1,104 +0,0 @@
--
-- _clean.lua
-- The "clean" action: removes all generated files.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.clean = { }
--
-- Clean a solution or project specific directory. Uses information in the
-- project object to build the target path.
--
-- @param obj
-- A solution or project object.
-- @param pattern
-- A filename pattern to clean; see premake.project.getfilename() for
-- a description of the format.
--
function premake.clean.directory(obj, pattern)
local fname = premake.project.getfilename(obj, pattern)
os.rmdir(fname)
end
--
-- Clean a solution or project specific file. Uses information in the project
-- object to build the target filename.
--
-- @param obj
-- A solution or project object.
-- @param pattern
-- A filename pattern to clean; see premake.project.getfilename() for
-- a description of the format.
--
function premake.clean.file(obj, pattern)
local fname = premake.project.getfilename(obj, pattern)
os.remove(fname)
end
--
-- Register the "clean" action.
--
newaction {
trigger = "clean",
description = "Remove all binaries and generated files",
onsolution = function(sln)
for action in premake.action.each() do
if action.oncleansolution then
action.oncleansolution(sln)
end
end
end,
onproject = function(prj)
for action in premake.action.each() do
if action.oncleanproject then
action.oncleanproject(prj)
end
end
if (prj.objectsdir) then
premake.clean.directory(prj, prj.objectsdir)
end
-- build a list of supported target platforms that also includes a generic build
local platforms = prj.solution.platforms or { }
if not table.contains(platforms, "Native") then
platforms = table.join(platforms, { "Native" })
end
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
premake.clean.directory(prj, cfg.objectsdir)
-- remove all permutations of the target binary
premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "windows", "windows").fullpath)
premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath)
premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "posix", "macosx").fullpath)
premake.clean.file(prj, premake.gettarget(cfg, "build", "posix", "PS3", "windows").fullpath)
if cfg.kind == "WindowedApp" then
premake.clean.directory(prj, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath .. ".app")
end
-- if there is an import library, remove that too
premake.clean.file(prj, premake.gettarget(cfg, "link", "windows", "windows", "windows").fullpath)
premake.clean.file(prj, premake.gettarget(cfg, "link", "posix", "posix", "linux").fullpath)
-- call action.oncleantarget() with the undecorated target name
local target = path.join(premake.project.getfilename(prj, cfg.buildtarget.directory), cfg.buildtarget.basename)
for action in premake.action.each() do
if action.oncleantarget then
action.oncleantarget(target)
end
end
end
end
end
}

View File

@ -1,38 +0,0 @@
--
-- _codeblocks.lua
-- Define the Code::Blocks action(s).
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
newaction {
trigger = "codeblocks",
shortname = "Code::Blocks",
description = "Generate Code::Blocks project files",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "gcc", "ow" },
},
onsolution = function(sln)
premake.generate(sln, "%%.workspace", premake.codeblocks_workspace)
end,
onproject = function(prj)
premake.generate(prj, "%%.cbp", premake.codeblocks_cbp)
end,
oncleansolution = function(sln)
premake.clean.file(sln, "%%.workspace")
end,
oncleanproject = function(prj)
premake.clean.file(prj, "%%.cbp")
premake.clean.file(prj, "%%.depend")
premake.clean.file(prj, "%%.layout")
end
}

View File

@ -1,144 +0,0 @@
--
-- codeblocks_cbp.lua
-- Generate a Code::Blocks C/C++ project.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.codeblocks_cbp(prj)
-- alias the C/C++ compiler interface
local cc = premake.gettool(prj)
_p('<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>')
_p('<CodeBlocks_project_file>')
_p(1,'<FileVersion major="1" minor="6" />')
-- write project block header
_p(1,'<Project>')
_p(2,'<Option title="%s" />', premake.esc(prj.name))
_p(2,'<Option pch_mode="2" />')
_p(2,'<Option compiler="%s" />', _OPTIONS.cc)
-- build a list of supported target platforms; I don't support cross-compiling yet
local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
for i = #platforms, 1, -1 do
if premake.platforms[platforms[i]].iscrosscompiler then
table.remove(platforms, i)
end
end
-- write configuration blocks
_p(2,'<Build>')
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
_p(3,'<Target title="%s">', premake.esc(cfg.longname))
_p(4,'<Option output="%s" prefix_auto="0" extension_auto="0" />', premake.esc(cfg.buildtarget.fullpath))
_p(4,'<Option object_output="%s" />', premake.esc(cfg.objectsdir))
_p(4,'<Option external_deps="%s" />', table.concat(premake.getlinks(cfg, "siblings", "fullpath"),";"))
-- identify the type of binary
local types = { WindowedApp = 0, ConsoleApp = 1, StaticLib = 2, SharedLib = 3 }
_p(4,'<Option type="%d" />', types[cfg.kind])
_p(4,'<Option compiler="%s" />', _OPTIONS.cc)
if (cfg.kind == "SharedLib") then
_p(4,'<Option createDefFile="0" />')
_p(4,'<Option createStaticLib="%s" />', iif(cfg.flags.NoImportLib, 0, 1))
end
-- begin compiler block --
_p(4,'<Compiler>')
for _,flag in ipairs(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getdefines(cfg.defines), cfg.buildoptions)) do
_p(5,'<Add option="%s" />', premake.esc(flag))
end
if not cfg.flags.NoPCH and cfg.pchheader then
_p(5,'<Add option="-Winvalid-pch" />')
_p(5,'<Add option="-include &quot;%s&quot;" />', premake.esc(cfg.pchheader))
end
for _,v in ipairs(cfg.includedirs) do
_p(5,'<Add directory="%s" />', premake.esc(v))
end
_p(4,'</Compiler>')
-- end compiler block --
-- begin linker block --
_p(4,'<Linker>')
_p(5,'<Add option="-Wl,--start-group" />')
for _,v in ipairs(premake.getlinks(cfg, "siblings", "fullpath")) do
_p(5,'<Add option="%s" />', premake.esc(v))
end
_p(5,'<Add option="-Wl,--end-group" />')
for _,flag in ipairs(table.join(cc.getldflags(cfg), cfg.linkoptions)) do
_p(5,'<Add option="%s" />', premake.esc(flag))
end
for _,v in ipairs(premake.getlinks(cfg, "all", "directory")) do
_p(5,'<Add directory="%s" />', premake.esc(v))
end
for _,v in ipairs(premake.getlinks(cfg, "system", "basename")) do
_p(5,'<Add library="%s" />', premake.esc(v))
end
_p(4,'</Linker>')
-- end linker block --
-- begin resource compiler block --
if premake.findfile(cfg, ".rc") then
_p(4,'<ResourceCompiler>')
for _,v in ipairs(cfg.includedirs) do
_p(5,'<Add directory="%s" />', premake.esc(v))
end
for _,v in ipairs(cfg.resincludedirs) do
_p(5,'<Add directory="%s" />', premake.esc(v))
end
_p(4,'</ResourceCompiler>')
end
-- end resource compiler block --
-- begin build steps --
if #cfg.prebuildcommands > 0 or #cfg.postbuildcommands > 0 then
_p(4,'<ExtraCommands>')
for _,v in ipairs(cfg.prebuildcommands) do
_p(5,'<Add before="%s" />', premake.esc(v))
end
for _,v in ipairs(cfg.postbuildcommands) do
_p(5,'<Add after="%s" />', premake.esc(v))
end
_p(4,'</ExtraCommands>')
end
-- end build steps --
_p(3,'</Target>')
end
end
_p(2,'</Build>')
-- begin files block --
local pchheader
if (prj.pchheader) then
pchheader = path.getrelative(prj.location, prj.pchheader)
end
for _,fname in ipairs(prj.files) do
_p(2,'<Unit filename="%s">', premake.esc(fname))
if path.isresourcefile(fname) then
_p(3,'<Option compilerVar="WINDRES" />')
elseif path.iscfile(fname) and prj.language == "C++" then
_p(3,'<Option compilerVar="CC" />')
end
if not prj.flags.NoPCH and fname == pchheader then
_p(3,'<Option compilerVar="%s" />', iif(prj.language == "C", "CC", "CPP"))
_p(3,'<Option compile="1" />')
_p(3,'<Option weight="0" />')
_p(3,'<Add option="-x c++-header" />')
end
_p(2,'</Unit>')
end
-- end files block --
_p(2,'<Extensions />')
_p(1,'</Project>')
_p('</CodeBlocks_project_file>')
_p('')
end

View File

@ -1,27 +0,0 @@
--
-- codeblocks_workspace.lua
-- Generate a Code::Blocks workspace.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.codeblocks_workspace(sln)
_p('<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>')
_p('<CodeBlocks_workspace_file>')
_p(1,'<Workspace title="%s">', sln.name)
for prj in premake.solution.eachproject(sln) do
local fname = path.join(path.getrelative(sln.location, prj.location), prj.name)
local active = iif(prj.project == sln.projects[1], ' active="1"', '')
_p(2,'<Project filename="%s.cbp"%s>', fname, active)
for _,dep in ipairs(premake.getdependencies(prj)) do
_p(3,'<Depends filename="%s.cbp" />', path.join(path.getrelative(sln.location, dep.location), dep.name))
end
_p(2,'</Project>')
end
_p(1,'</Workspace>')
_p('</CodeBlocks_workspace_file>')
end

View File

@ -1,40 +0,0 @@
--
-- _codelite.lua
-- Define the CodeLite action(s).
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
--
newaction {
trigger = "codelite",
shortname = "CodeLite",
description = "Generate CodeLite project files",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "gcc" },
},
onsolution = function(sln)
premake.generate(sln, "%%.workspace", premake.codelite_workspace)
end,
onproject = function(prj)
premake.generate(prj, "%%.project", premake.codelite_project)
end,
oncleansolution = function(sln)
premake.clean.file(sln, "%%.workspace")
premake.clean.file(sln, "%%_wsp.mk")
premake.clean.file(sln, "%%.tags")
end,
oncleanproject = function(prj)
premake.clean.file(prj, "%%.project")
premake.clean.file(prj, "%%.mk")
premake.clean.file(prj, "%%.list")
premake.clean.file(prj, "%%.out")
end
}

View File

@ -1,146 +0,0 @@
--
-- codelite_project.lua
-- Generate a CodeLite C/C++ project file.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.codelite_project(prj)
_p('<?xml version="1.0" encoding="utf-8"?>')
_p('<CodeLite_Project Name="%s">', premake.esc(prj.name))
premake.walksources(prj, premake.codelite_files)
local types = {
ConsoleApp = "Executable",
WindowedApp = "Executable",
StaticLib = "Static Library",
SharedLib = "Dynamic Library",
}
_p(' <Settings Type="%s">', types[prj.kind])
-- build a list of supported target platforms; I don't support cross-compiling yet
local platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms, "Native")
for i = #platforms, 1, -1 do
if premake.platforms[platforms[i]].iscrosscompiler then
table.remove(platforms, i)
end
end
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
local name = premake.esc(cfg.longname)
local compiler = iif(cfg.language == "C", "gcc", "g++")
_p(' <Configuration Name="%s" CompilerType="gnu %s" DebuggerType="GNU gdb debugger" Type="%s">', name, compiler, types[cfg.kind])
local fname = premake.esc(cfg.buildtarget.fullpath)
local objdir = premake.esc(cfg.objectsdir)
local runcmd = cfg.buildtarget.name
local rundir = cfg.buildtarget.directory
local pause = iif(cfg.kind == "WindowedApp", "no", "yes")
_p(' <General OutputFile="%s" IntermediateDirectory="%s" Command="./%s" CommandArguments="" WorkingDirectory="%s" PauseExecWhenProcTerminates="%s"/>', fname, objdir, runcmd, rundir, pause)
-- begin compiler block --
local flags = premake.esc(table.join(premake.gcc.getcflags(cfg), premake.gcc.getcxxflags(cfg), cfg.buildoptions))
_p(' <Compiler Required="yes" Options="%s">', table.concat(flags, ";"))
for _,v in ipairs(cfg.includedirs) do
_p(' <IncludePath Value="%s"/>', premake.esc(v))
end
for _,v in ipairs(cfg.defines) do
_p(' <Preprocessor Value="%s"/>', premake.esc(v))
end
_p(' </Compiler>')
-- end compiler block --
-- begin linker block --
flags = premake.esc(table.join(premake.gcc.getldflags(cfg), cfg.linkoptions))
_p(' <Linker Required="yes" Options="%s">', table.concat(flags, ";"))
for _,v in ipairs(premake.getlinks(cfg, "all", "directory")) do
_p(' <LibraryPath Value="%s" />', premake.esc(v))
end
for _,v in ipairs(premake.getlinks(cfg, "all", "basename")) do
_p(' <Library Value="%s" />', premake.esc(v))
end
_p(' </Linker>')
-- end linker block --
-- begin resource compiler block --
if premake.findfile(cfg, ".rc") then
local defines = table.implode(table.join(cfg.defines, cfg.resdefines), "-D", ";", "")
local options = table.concat(cfg.resoptions, ";")
_p(' <ResourceCompiler Required="yes" Options="%s%s">', defines, options)
for _,v in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do
_p(' <IncludePath Value="%s"/>', premake.esc(v))
end
_p(' </ResourceCompiler>')
else
_p(' <ResourceCompiler Required="no" Options=""/>')
end
-- end resource compiler block --
-- begin build steps --
if #cfg.prebuildcommands > 0 then
_p(' <PreBuild>')
for _,v in ipairs(cfg.prebuildcommands) do
_p(' <Command Enabled="yes">%s</Command>', premake.esc(v))
end
_p(' </PreBuild>')
end
if #cfg.postbuildcommands > 0 then
_p(' <PostBuild>')
for _,v in ipairs(cfg.postbuildcommands) do
_p(' <Command Enabled="yes">%s</Command>', premake.esc(v))
end
_p(' </PostBuild>')
end
-- end build steps --
_p(' <CustomBuild Enabled="no">')
_p(' <CleanCommand></CleanCommand>')
_p(' <BuildCommand></BuildCommand>')
_p(' <SingleFileCommand></SingleFileCommand>')
_p(' <MakefileGenerationCommand></MakefileGenerationCommand>')
_p(' <ThirdPartyToolName>None</ThirdPartyToolName>')
_p(' <WorkingDirectory></WorkingDirectory>')
_p(' </CustomBuild>')
_p(' <AdditionalRules>')
_p(' <CustomPostBuild></CustomPostBuild>')
_p(' <CustomPreBuild></CustomPreBuild>')
_p(' </AdditionalRules>')
_p(' </Configuration>')
end
end
_p(' </Settings>')
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
_p(' <Dependencies name="%s">', cfg.longname)
for _,dep in ipairs(premake.getdependencies(prj)) do
_p(' <Project Name="%s"/>', dep.name)
end
_p(' </Dependencies>')
end
end
_p('</CodeLite_Project>')
end
--
-- Write out entries for the files element; called from premake.walksources().
--
function premake.codelite_files(prj, fname, state, nestlevel)
local indent = string.rep(" ", nestlevel + 1)
if (state == "GroupStart") then
io.write(indent .. '<VirtualDirectory Name="' .. path.getname(fname) .. '">\n')
elseif (state == "GroupEnd") then
io.write(indent .. '</VirtualDirectory>\n')
else
io.write(indent .. '<File Name="' .. fname .. '"/>\n')
end
end

View File

@ -1,40 +0,0 @@
--
-- codelite_workspace.lua
-- Generate a CodeLite workspace file.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.codelite_workspace(sln)
_p('<?xml version="1.0" encoding="utf-8"?>')
_p('<CodeLite_Workspace Name="%s" Database="./%s.tags">', premake.esc(sln.name), premake.esc(sln.name))
for i,prj in ipairs(sln.projects) do
local name = premake.esc(prj.name)
local fname = path.join(path.getrelative(sln.location, prj.location), prj.name)
local active = iif(i==1, "Yes", "No")
_p(' <Project Name="%s" Path="%s.project" Active="%s" />', name, fname, active)
end
-- build a list of supported target platforms; I don't support cross-compiling yet
local platforms = premake.filterplatforms(sln, premake[_OPTIONS.cc].platforms, "Native")
for i = #platforms, 1, -1 do
if premake.platforms[platforms[i]].iscrosscompiler then
table.remove(platforms, i)
end
end
_p(' <BuildMatrix>')
for _, platform in ipairs(platforms) do
for _, cfgname in ipairs(sln.configurations) do
local name = premake.getconfigname(cfgname, platform)
_p(' <WorkspaceConfiguration Name="%s" Selected="yes">', name)
for _,prj in ipairs(sln.projects) do
_p(' <Project Name="%s" ConfigName="%s"/>', prj.name, name)
end
_p(' </WorkspaceConfiguration>')
end
end
_p(' </BuildMatrix>')
_p('</CodeLite_Workspace>')
end

View File

@ -1,99 +0,0 @@
-- Define a namespace for my new action. The second line defines an alias that I
-- can use in this file, saving myself some typing. It will not be visible outside
-- of this file (though I can always define it again).
premake.example = { }
local example = premake.example
-- The description of the action. Note that only the first three fields are required;
-- you can remove any of the additional fields that are not required by your action.
newaction
{
-- The trigger is what needs to be typed on the command line to cause
-- this action this run (premake4 example)
trigger = "example",
-- The short name is used when this toolset name needs to be shown to
-- the user, such as in status or error messages
shortname = "Super Studio 3000",
-- The description is shown in the help text (premake4 /help)
description = "An example action that prints simple text files",
-- Some actions imply a particular operating system: Visual Studio only
-- runs on Windows, and Xcode only on Mac OS X. If this is the case,
-- uncomment this line and set it to one of "windows", "linux" or "macosx".
-- Otherwise, this action will target the current operating system.
-- os = "macosx",
-- Which kinds of targets this action supports; remove those you don't.
valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" },
-- Which programming languages this actions supports; remove those you don't.
valid_languages = { "C", "C++", "C#" },
-- Which compiler sets this action supports; remove those you don't. The set
-- is specified with the /cc and /dotnet command-line options. You can find
-- the tool interfaces at src/tools.
valid_tools = {
cc = { "msc", "gcc", "ow" },
dotnet = { "mono", "msnet", "pnet" },
},
-- This function is called during state validation. If your action has some
-- special requirements you can check them here and error if necessary.
oncheckproject = function(prj)
-- if this_project_is_no_good(prj) then
-- error("Project " .. prj.name .. " is no good", 0)
-- end
end,
-- These functions will get called for each solution and project. The function
-- premake.generate() creates a file for you in the correct place, taking into
-- account any location information specified in the script. The sequence "%%"
-- will be replaced by the solution/project name. The last parameter is the
-- function that will actually do the work of generating the file contents.
onsolution = function(sln)
premake.generate(sln, "%%.sln.txt", premake.example.solution)
end,
onproject = function(prj)
if premake.isdotnetproject(prj) then
premake.generate(prj, "%%.csprj.txt", premake.example.project)
else
premake.generate(prj, "%%.cprj.txt", premake.example.project)
end
end,
-- These functions are called for each solution, project, and target as part
-- of the "clean" action. They should remove any files generated by the tools.
-- premake.clean.file() and premake.clean.directory() are convenience functions
-- that use the same pattern matching as premake.generate() above.
oncleansolution = function(sln)
premake.clean.file(sln, "%%.sln.txt")
end,
oncleanproject = function(prj)
if premake.isdotnetproject(prj) then
premake.clean.file(prj, "%%.csprj.txt")
else
premake.clean.file(prj, "%%.cprj.txt")
end
end,
oncleantarget = function(trg)
-- 'trg' is the path and base name of the target being cleaned,
-- like 'bin/debug/MyApplication'. So you might do something like:
-- os.remove(trg .. ".exe")
end,
}

View File

@ -1,91 +0,0 @@
-- An example project generator; see _example.lua for action description
--
-- The project generation function, attached to the action in _example.lua.
-- By now, premake.generate() has created the project file using the name
-- provided in _example.lua, and redirected input to this new file.
--
function premake.example.project(prj)
-- If necessary, set an explicit line ending sequence
-- io.eol = '\r\n'
-- Let's start with a header
_p('-- Example project file version 1.0')
_p('Name: %s', prj.name)
_p('Kind: %s', prj.kind)
_p('Language: %s', prj.language)
_p('ID: {%s}', prj.uuid)
_p('')
-- List the build configurations, and the settings for each
for cfg in premake.eachconfig(prj) do
_p('Configuration %s:', cfg.name)
_p(1, 'Objects directory: %s', cfg.objectsdir)
_p(1, 'Build target:')
_p(2, 'Full path: %s', cfg.buildtarget.fullpath)
_p(2, 'Directory: %s', cfg.buildtarget.directory)
_p(2, 'Name: %s', cfg.buildtarget.name)
_p(2, 'Base name: %s', cfg.buildtarget.basename)
_p(2, 'Prefix: %s', cfg.buildtarget.prefix)
_p(2, 'Suffix: %s', cfg.buildtarget.suffix)
_p('')
_p(1, 'Compiling:')
_p(2, 'Defines: %s', table.concat(cfg.defines, ";"))
_p(2, 'Include paths: %s', table.concat(cfg.includedirs, ";"))
_p(2, 'Flags: %s', table.concat(cfg.flags, ", "))
if not cfg.flags.NoPCH and cfg.pchheader then
_p(2, 'Precompiled header: %s (%s)', cfg.pchheader, cfg.pchsource)
end
_p(2, 'Options: %s', table.concat(cfg.buildoptions, " "))
_p('')
_p(1, 'Linking:')
_p(2, 'Library paths: %s', table.concat(cfg.libdirs, ";"))
_p(2, 'Options: %s', table.concat(cfg.linkoptions, " "))
_p(2, 'Libraries: %s', table.concat(premake.getlinks(cfg, "all", "fullpath")))
_p('')
if #cfg.prebuildcommands > 0 then
_p(1, 'Prebuild commands:')
for _, cmd in ipairs(cfg.prebuildcommands) do
_p(2, cmd)
end
_p('')
end
if #cfg.prelinkcommands > 0 then
_p(1, 'Prelink commands:')
for _, cmd in ipairs(cfg.prelinkcommands) do
_p(2, cmd)
end
_p('')
end
if #cfg.postbuildcommands > 0 then
_p(1, 'Postbuild commands:')
for _, cmd in ipairs(cfg.postbuildcommands) do
_p(2, cmd)
end
_p('')
end
end
-- List out the folders and files that make up the build
local tr = premake.project.buildsourcetree(prj)
premake.tree.sort(tr)
premake.tree.traverse(tr, {
onbranch = function(node, depth)
_p(depth, path.getname(node.name) .. "/")
end,
onleaf = function(node, depth)
_p(depth, path.getname(node.name))
end
})
end

View File

@ -1,46 +0,0 @@
-- An example solution generator; see _example.lua for action description
--
-- The solution generation function, attached to the action in _example.lua.
-- By now, premake.generate() has created the solution file using the name
-- provided in _example.lua, and redirected input to this new file.
--
function premake.example.solution(sln)
-- If necessary, set an explicit line ending sequence
-- io.eol = '\r\n'
-- Let's start with a header
_p('-- Example solution file version 1.0')
_p('Name: %s', sln.name)
_p('')
-- List the build configurations
for _, cfgname in ipairs(sln.configurations) do
_p('Config: %s', cfgname)
end
_p('')
-- List the projects contained by the solution, with some info on each
for prj in premake.solution.eachproject(sln) do
_p('Project: %s', prj.name)
_p(1, 'Kind: %s', prj.kind)
_p(1, 'Language: %s', prj.language)
_p(1, 'ID: {%s}', prj.uuid)
_p(1, 'Relative path: %s', path.getrelative(sln.location, prj.location))
-- List dependencies, if there are any
local deps = premake.getdependencies(prj)
if #deps > 0 then
_p(1, 'Dependencies:')
for _, depprj in ipairs(deps) do
_p(2, '%s {%s}', depprj.name, depprj.uuid)
end
end
_p('')
end
end

View File

@ -1,141 +0,0 @@
--
-- _make.lua
-- Define the makefile action(s).
-- Copyright (c) 2002-2010 Jason Perkins and the Premake project
--
_MAKE = { }
premake.make = { }
--
-- Escape a string so it can be written to a makefile.
--
function _MAKE.esc(value)
local result
if (type(value) == "table") then
result = { }
for _,v in ipairs(value) do
table.insert(result, _MAKE.esc(v))
end
return result
else
-- handle simple replacements
result = value:gsub("\\", "\\\\")
result = result:gsub(" ", "\\ ")
result = result:gsub("%(", "\\%(")
result = result:gsub("%)", "\\%)")
-- leave $(...) shell replacement sequences alone
result = result:gsub("$\\%((.-)\\%)", "$%(%1%)")
return result
end
end
--
-- Rules for file ops based on the shell type. Can't use defines and $@ because
-- it screws up the escaping of spaces and parethesis (anyone know a solution?)
--
function premake.make_copyrule(source, target)
_p('%s: %s', target, source)
_p('\t@echo Copying $(notdir %s)', target)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) cp -fR %s %s', source, target)
_p('else')
_p('\t$(SILENT) copy /Y $(subst /,\\\\,%s) $(subst /,\\\\,%s)', source, target)
_p('endif')
end
function premake.make_mkdirrule(var)
_p('\t@echo Creating %s', var)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) mkdir -p %s', var)
_p('else')
_p('\t$(SILENT) mkdir $(subst /,\\\\,%s)', var)
_p('endif')
_p('')
end
--
-- Get the makefile file name for a solution or a project. If this object is the
-- only one writing to a location then I can use "Makefile". If more than one object
-- writes to the same location I use name + ".make" to keep it unique.
--
function _MAKE.getmakefilename(this, searchprjs)
-- how many projects/solutions use this location?
local count = 0
for sln in premake.solution.each() do
if (sln.location == this.location) then count = count + 1 end
if (searchprjs) then
for _,prj in ipairs(sln.projects) do
if (prj.location == this.location) then count = count + 1 end
end
end
end
if (count == 1) then
return "Makefile"
else
return this.name .. ".make"
end
end
--
-- Returns a list of object names, properly escaped to be included in the makefile.
--
function _MAKE.getnames(tbl)
local result = table.extract(tbl, "name")
for k,v in pairs(result) do
result[k] = _MAKE.esc(v)
end
return result
end
--
-- Register the "gmake" action
--
newaction {
trigger = "gmake",
shortname = "GNU Make",
description = "Generate GNU makefiles for POSIX, MinGW, and Cygwin",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "gcc" },
dotnet = { "mono", "msnet", "pnet" },
},
onsolution = function(sln)
premake.generate(sln, _MAKE.getmakefilename(sln, false), premake.make_solution)
end,
onproject = function(prj)
local makefile = _MAKE.getmakefilename(prj, true)
if premake.isdotnetproject(prj) then
premake.generate(prj, makefile, premake.make_csharp)
else
premake.generate(prj, makefile, premake.make_cpp)
end
end,
oncleansolution = function(sln)
premake.clean.file(sln, _MAKE.getmakefilename(sln, false))
end,
oncleanproject = function(prj)
premake.clean.file(prj, _MAKE.getmakefilename(prj, true))
end
}

View File

@ -1,338 +0,0 @@
--
-- make_cpp.lua
-- Generate a C/C++ project makefile.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.make.cpp = { }
local _ = premake.make.cpp
function premake.make_cpp(prj)
-- create a shortcut to the compiler interface
local cc = premake.gettool(prj)
-- build a list of supported target platforms that also includes a generic build
local platforms = premake.filterplatforms(prj.solution, cc.platforms, "Native")
premake.gmake_cpp_header(prj, cc, platforms)
for _, platform in ipairs(platforms) do
for cfg in premake.eachconfig(prj, platform) do
premake.gmake_cpp_config(cfg, cc)
end
end
-- list intermediate files
_p('OBJECTS := \\')
for _, file in ipairs(prj.files) do
if path.iscppfile(file) or path.getextension(file) == ".asm" then
_p('\t$(OBJDIR)/%s.o \\', _MAKE.esc(path.getbasename(file)))
end
end
_p('')
_p('RESOURCES := \\')
for _, file in ipairs(prj.files) do
if path.isresourcefile(file) then
_p('\t$(OBJDIR)/%s.res \\', _MAKE.esc(path.getbasename(file)))
end
end
_p('')
-- identify the shell type
_p('SHELLTYPE := msdos')
_p('ifeq (,$(ComSpec)$(COMSPEC))')
_p(' SHELLTYPE := posix')
_p('endif')
_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
_p(' SHELLTYPE := posix')
_p('endif')
_p('')
-- main build rule(s)
_p('.PHONY: clean prebuild prelink')
_p('')
if os.is("MacOSX") and prj.kind == "WindowedApp" then
_p('all: $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')
else
_p('all: $(TARGET)')
end
_p('\t@:')
_p('')
-- target build rule
_p('$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES) | prelink')
_p('\t@echo Linking %s', prj.name)
_p('\t$(SILENT) $(LINKCMD)')
_p('\t$(POSTBUILDCMDS)')
_p('')
-- Create destination directories. Can't use $@ for this because it loses the
-- escaping, causing issues with spaces and parenthesis
_p('$(TARGETDIR):')
premake.make_mkdirrule("$(TARGETDIR)")
_p('$(OBJDIR):')
premake.make_mkdirrule("$(OBJDIR)")
-- Mac OS X specific targets
if os.is("MacOSX") and prj.kind == "WindowedApp" then
_p('$(dir $(TARGETDIR))PkgInfo:')
_p('$(dir $(TARGETDIR))Info.plist:')
_p('')
end
-- clean target
_p('clean:')
_p('\t@echo Cleaning %s', prj.name)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) rm -f $(TARGET)')
_p('\t$(SILENT) rm -rf $(OBJDIR)')
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGET)) del $(subst /,\\\\,$(TARGET))')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))')
_p('endif')
_p('')
-- custom build step targets
_p('prebuild: $(TARGETDIR) $(OBJDIR)')
_p('\t$(PREBUILDCMDS)')
_p('')
_p('prelink:')
_p('\t$(PRELINKCMDS)')
_p('')
-- precompiler header rule
_.pchrules(prj)
-- per-file rules
for _, file in ipairs(prj.files) do
if path.iscppfile(file) then
-- Don't use PCH for Obj-C/C++ files (we could but we'd have to compile them separately
-- and there's no advantage to that yet)
local gchobj = '$(GCH)'
local pchincludes = '$(PCHINCLUDES)'
if (path.getextension(file) == ".mm" or path.getextension(file) == ".m") then
gchobj = ''
pchincludes = ''
end
_p('$(OBJDIR)/%s.o: %s %s | prebuild', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file), gchobj)
_p('\t@echo $(notdir $<)')
if (path.iscfile(file)) then
_p('\t$(SILENT) $(CC) %s $(CFLAGS) -MF $(OBJDIR)/%s.d -MT "$@" -o "$@" -c "$<"', pchincludes, _MAKE.esc(path.getbasename(file)))
else
_p('\t$(SILENT) $(CXX) %s $(CXXFLAGS) -MF $(OBJDIR)/%s.d -MT "$@" -o "$@" -c "$<"', pchincludes, _MAKE.esc(path.getbasename(file)))
end
elseif (path.getextension(file) == ".rc") then
_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))
_p('\t@echo $(notdir $<)')
_p('\t$(SILENT) windres $< -O coff -o "$@" $(RESFLAGS)')
elseif (path.getextension(file) == ".asm") then
_p('$(OBJDIR)/%s.o: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))
_p('\t@echo $(notdir $<)')
local opts = ''
if os.is('windows') then
opts = ''
elseif os.is('macosx') then
opts = '-D OS_UNIX=1'
else
opts = '-D DONT_USE_UNDERLINE=1 -D OS_UNIX=1'
end
if not (prj.solution.nasmpath) then
prj.solution.nasmpath = 'nasm'
end
_p('\t$(SILENT)'.._MAKE.esc(prj.solution.nasmpath)..' '..opts..' -i'.._MAKE.esc(path.getdirectory(file))..'/'..' -f '..
_MAKE.esc(prj.solution.nasmformat)..' -o $@ $<\n\t')
_p('\t$(SILENT)'.._MAKE.esc(prj.solution.nasmpath)..' '..opts..' -i'.._MAKE.esc(path.getdirectory(file))..'/'..
' -M -o $@ $< >$(OBJDIR)/$(<F:%%.asm=%%.d)\n')
end
end
_p('')
-- output for test-generation
-- test generation only works if all required parameters are set!
if(prj.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then
if not(prj.cxxtestrootoptions) then
prj.cxxtestrootoptions = ''
end
if not(prj.cxxtestoptions) then
prj.cxxtestoptions = ''
end
_p(prj.cxxtestrootfile..': ')
_p('\t@echo $(notdir $<)')
_p('\t$(SILENT)'.._MAKE.esc(prj.cxxtestpath)..' --root '..prj.cxxtestrootoptions..' -o '.._MAKE.esc(prj.cxxtestrootfile))
_p('')
for i, file in ipairs(prj.cxxtesthdrfiles) do
_p('%s: %s', _MAKE.esc(prj.cxxtestsrcfiles[i]), _MAKE.esc(file))
_p('\t@echo $(notdir $<)')
_p('\t$(SILENT)'.._MAKE.esc(prj.cxxtestpath)..' --part '..prj.cxxtestoptions..' -o ' .._MAKE.esc(prj.cxxtestsrcfiles[i])..' '.._MAKE.esc(file))
end
_p('')
end
-- include the dependencies, built by GCC (with the -MMD flag)
_p('-include $(OBJECTS:%%.o=%%.d)')
_p('-include $(GCH:%%.h.gch=%%.h.d)')
end
--
-- Write the makefile header
--
function premake.gmake_cpp_header(prj, cc, platforms)
_p('# %s project makefile autogenerated by Premake', premake.action.current().shortname)
-- set up the environment
_p('ifndef config')
_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))
_p('endif')
_p('')
_p('ifndef verbose')
_p(' SILENT = @')
_p('endif')
_p('')
_p('ifndef CC')
_p(' CC = %s', cc.cc)
_p('endif')
_p('')
_p('ifndef CXX')
_p(' CXX = %s', cc.cxx)
_p('endif')
_p('')
_p('ifndef AR')
_p(' AR = %s', cc.ar)
_p('endif')
_p('')
end
--
-- Write a block of configuration settings.
--
function premake.gmake_cpp_config(cfg, cc)
_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))
-- if this platform requires a special compiler or linker, list it now
local platform = cc.platforms[cfg.platform]
if platform.cc then
_p(' CC = %s', platform.cc)
end
if platform.cxx then
_p(' CXX = %s', platform.cxx)
end
if platform.ar then
_p(' AR = %s', platform.ar)
end
if not(cfg.gnuexternals) then
cfg.gnuexternal = { }
end
_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))
_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))
_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))
_p(' DEFINES += %s', table.concat(cc.getdefines(cfg.defines), " "))
_p(' INCLUDES += %s', table.concat(cc.getincludedirs(cfg.includedirs), " "))
_p(' CPPFLAGS += %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " "))
-- set up precompiled headers
_.pchconfig(cfg)
_p(' CFLAGS += $(CPPFLAGS) %s', table.concat(table.join(cc.getcflags(cfg), cfg.buildoptions), " "))
_p(' CXXFLAGS += $(CPPFLAGS) %s', table.concat(table.join(cc.getcxxflags(cfg), cfg.buildoptions), " "))
_p(' LDFLAGS += %s', table.concat(table.join(cc.getldflags(cfg), cfg.linkoptions, cc.getlibdirflags(cfg)), " "))
_p(' LIBS += %s %s', table.concat(cc.getlinkflags(cfg), " "), table.concat(cfg.gnuexternals, " "))
_p(' RESFLAGS += $(DEFINES) $(INCLUDES) %s', table.concat(table.join(cc.getdefines(cfg.resdefines), cc.getincludedirs(cfg.resincludedirs), cfg.resoptions), " "))
_p(' LDDEPS += %s', table.concat(_MAKE.esc(premake.getlinks(cfg, "static", "fullpath")), " "))
if cfg.kind == "StaticLib" then
if cfg.platform:startswith("Universal") then
_p(' LINKCMD = libtool -o $(TARGET) $(OBJECTS)')
else
_p(' LINKCMD = $(AR) -rcs $(TARGET) $(OBJECTS)')
end
else
-- this was $(TARGET) $(LDFLAGS) $(OBJECTS) ... but was having trouble linking to certain
-- static libraries so $(OBJECTS) was moved up
local lddeps = ''
-- on osx, --start-group and --end-group aren't supported by ld
if os.is('macosx') then
lddeps = '$(LDDEPS)'
else
lddeps = '-Xlinker --start-group $(LDDEPS) -Xlinker --end-group'
end
_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) %s $(LIBS)',
iif(cfg.language == "C", "CC", "CXX"), lddeps)
end
_p(' define PREBUILDCMDS')
if #cfg.prebuildcommands > 0 then
_p('\t@echo Running pre-build commands')
_p('\t%s', table.implode(cfg.prebuildcommands, "", "", "\n\t"))
end
_p(' endef')
_p(' define PRELINKCMDS')
if #cfg.prelinkcommands > 0 then
_p('\t@echo Running pre-link commands')
_p('\t%s', table.implode(cfg.prelinkcommands, "", "", "\n\t"))
end
_p(' endef')
_p(' define POSTBUILDCMDS')
if #cfg.postbuildcommands > 0 then
_p('\t@echo Running post-build commands')
_p('\t%s', table.implode(cfg.postbuildcommands, "", "", "\n\t"))
end
_p(' endef')
_p('endif')
_p('')
end
--
-- Precompiled header support
--
function _.pchconfig(cfg)
if not cfg.flags.NoPCH and cfg.pchheader then
_p(' PCH = %s', _MAKE.esc(cfg.pchheader))
_p(' GCH = $(OBJDIR)/%s.gch', _MAKE.esc(path.getname(cfg.pchheader)))
_p(' PCHINCLUDES = -I$(OBJDIR) -include $(OBJDIR)/%s', _MAKE.esc(path.getname(cfg.pchheader)))
end
end
function _.pchrules(prj)
_p('ifneq (,$(PCH))')
_p('$(GCH): $(PCH) | $(OBJDIR)')
_p('\t@echo $(notdir $<)')
_p('\t-$(SILENT) cp $< $(OBJDIR)')
if prj.language == "C" then
_p('\t$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"')
else
_p('\t$(SILENT) $(CXX) $(CXXFLAGS) -x c++-header -o "$@" -c "$<"')
end
_p('endif')
_p('')
end

View File

@ -1,271 +0,0 @@
--
-- make_csharp.lua
-- Generate a C# project makefile.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
--
-- Given a .resx resource file, builds the path to corresponding .resource
-- file, matching the behavior and naming of Visual Studio.
--
local function getresourcefilename(cfg, fname)
if path.getextension(fname) == ".resx" then
local name = cfg.buildtarget.basename .. "."
local dir = path.getdirectory(fname)
if dir ~= "." then
name = name .. path.translate(dir, ".") .. "."
end
return "$(OBJDIR)/" .. _MAKE.esc(name .. path.getbasename(fname)) .. ".resources"
else
return fname
end
end
--
-- Main function
--
function premake.make_csharp(prj)
local csc = premake.dotnet
-- Do some processing up front: build a list of configuration-dependent libraries.
-- Libraries that are built to a location other than $(TARGETDIR) will need to
-- be copied so they can be found at runtime.
local cfglibs = { }
local cfgpairs = { }
local anycfg
for cfg in premake.eachconfig(prj) do
anycfg = cfg
cfglibs[cfg] = premake.getlinks(cfg, "siblings", "fullpath")
cfgpairs[cfg] = { }
for _, fname in ipairs(cfglibs[cfg]) do
if path.getdirectory(fname) ~= cfg.buildtarget.directory then
cfgpairs[cfg]["$(TARGETDIR)/" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)
end
end
end
-- sort the files into categories, based on their build action
local sources = {}
local embedded = { }
local copypairs = { }
for fcfg in premake.eachfile(prj) do
local action = csc.getbuildaction(fcfg)
if action == "Compile" then
table.insert(sources, fcfg.name)
elseif action == "EmbeddedResource" then
table.insert(embedded, fcfg.name)
elseif action == "Content" then
copypairs["$(TARGETDIR)/" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)
elseif path.getname(fcfg.name):lower() == "app.config" then
copypairs["$(TARGET).config"] = _MAKE.esc(fcfg.name)
end
end
-- Any assemblies that are on the library search paths should be copied
-- to $(TARGETDIR) so they can be found at runtime
local paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)
paths = table.join({prj.basedir}, paths)
for _, libname in ipairs(premake.getlinks(prj, "system", "fullpath")) do
local libdir = os.pathsearch(libname..".dll", unpack(paths))
if (libdir) then
local target = "$(TARGETDIR)/" .. _MAKE.esc(path.getname(libname))
local source = path.getrelative(prj.basedir, path.join(libdir, libname))..".dll"
copypairs[target] = _MAKE.esc(source)
end
end
-- end of preprocessing --
-- set up the environment
_p('# %s project makefile autogenerated by Premake', premake.action.current().shortname)
_p('')
_p('ifndef config')
_p(' config=%s', _MAKE.esc(prj.configurations[1]:lower()))
_p('endif')
_p('')
_p('ifndef verbose')
_p(' SILENT = @')
_p('endif')
_p('')
_p('ifndef CSC')
_p(' CSC=%s', csc.getcompilervar(prj))
_p('endif')
_p('')
_p('ifndef RESGEN')
_p(' RESGEN=resgen')
_p('endif')
_p('')
-- Platforms aren't support for .NET projects, but I need the ability to match
-- the buildcfg:platform identifiers with a block of settings. So enumerate the
-- pairs the same way I do for C/C++ projects, but always use the generic settings
local platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)
table.insert(platforms, 1, "")
-- write the configuration blocks
for cfg in premake.eachconfig(prj) do
premake.gmake_cs_config(cfg, csc, cfglibs)
end
-- set project level values
_p('# To maintain compatibility with VS.NET, these values must be set at the project level')
_p('TARGET := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))
_p('FLAGS += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), "/lib:", "", " "))
_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, "system", "basename")), "/r:", ".dll", " "))
_p('')
-- list source files
_p('SOURCES := \\')
for _, fname in ipairs(sources) do
_p('\t%s \\', _MAKE.esc(path.translate(fname)))
end
_p('')
_p('EMBEDFILES := \\')
for _, fname in ipairs(embedded) do
_p('\t%s \\', getresourcefilename(prj, fname))
end
_p('')
_p('COPYFILES += \\')
for target, source in pairs(cfgpairs[anycfg]) do
_p('\t%s \\', target)
end
for target, source in pairs(copypairs) do
_p('\t%s \\', target)
end
_p('')
-- identify the shell type
_p('SHELLTYPE := msdos')
_p('ifeq (,$(ComSpec)$(COMSPEC))')
_p(' SHELLTYPE := posix')
_p('endif')
_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
_p(' SHELLTYPE := posix')
_p('endif')
_p('')
-- main build rule(s)
_p('.PHONY: clean prebuild prelink')
_p('')
_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')
_p('')
_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')
_p('\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')
_p('\t$(POSTBUILDCMDS)')
_p('')
-- Create destination directories. Can't use $@ for this because it loses the
-- escaping, causing issues with spaces and parenthesis
_p('$(TARGETDIR):')
premake.make_mkdirrule("$(TARGETDIR)")
_p('$(OBJDIR):')
premake.make_mkdirrule("$(OBJDIR)")
-- clean target
_p('clean:')
_p('\t@echo Cleaning %s', prj.name)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)
_p('\t$(SILENT) rm -rf $(OBJDIR)')
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)
for target, source in pairs(cfgpairs[anycfg]) do
_p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
end
for target, source in pairs(copypairs) do
_p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
end
_p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))')
_p('endif')
_p('')
-- custom build step targets
_p('prebuild:')
_p('\t$(PREBUILDCMDS)')
_p('')
_p('prelink:')
_p('\t$(PRELINKCMDS)')
_p('')
-- per-file rules
_p('# Per-configuration copied file rules')
for cfg in premake.eachconfig(prj) do
_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))
for target, source in pairs(cfgpairs[cfg]) do
premake.make_copyrule(source, target)
end
_p('endif')
_p('')
end
_p('# Copied file rules')
for target, source in pairs(copypairs) do
premake.make_copyrule(source, target)
end
_p('# Embedded file rules')
for _, fname in ipairs(embedded) do
if path.getextension(fname) == ".resx" then
_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))
_p('\t$(SILENT) $(RESGEN) $^ $@')
end
_p('')
end
end
--
-- Write a block of configuration settings.
--
function premake.gmake_cs_config(cfg, csc, cfglibs)
_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))
_p(' TARGETDIR := %s', _MAKE.esc(cfg.buildtarget.directory))
_p(' OBJDIR := %s', _MAKE.esc(cfg.objectsdir))
_p(' DEPENDS := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, "dependencies", "fullpath")), " "))
_p(' REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), "/r:", "", " "))
_p(' FLAGS += %s %s', table.implode(cfg.defines, "/d:", "", " "), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), " "))
_p(' define PREBUILDCMDS')
if #cfg.prebuildcommands > 0 then
_p('\t@echo Running pre-build commands')
_p('\t%s', table.implode(cfg.prebuildcommands, "", "", "\n\t"))
end
_p(' endef')
_p(' define PRELINKCMDS')
if #cfg.prelinkcommands > 0 then
_p('\t@echo Running pre-link commands')
_p('\t%s', table.implode(cfg.prelinkcommands, "", "", "\n\t"))
end
_p(' endef')
_p(' define POSTBUILDCMDS')
if #cfg.postbuildcommands > 0 then
_p('\t@echo Running post-build commands')
_p('\t%s', table.implode(cfg.postbuildcommands, "", "", "\n\t"))
end
_p(' endef')
_p('endif')
_p('')
end

View File

@ -1,74 +0,0 @@
--
-- make_solution.lua
-- Generate a solution-level makefile.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
function premake.make_solution(sln)
-- create a shortcut to the compiler interface
local cc = premake[_OPTIONS.cc]
-- build a list of supported target platforms that also includes a generic build
local platforms = premake.filterplatforms(sln, cc.platforms, "Native")
-- write a header showing the build options
_p('# %s solution makefile autogenerated by Premake', premake.action.current().shortname)
_p('# Type "make help" for usage help')
_p('')
-- set a default configuration
_p('ifndef config')
_p(' config=%s', _MAKE.esc(premake.getconfigname(sln.configurations[1], platforms[1], true)))
_p('endif')
_p('export config')
_p('')
-- list the projects included in the solution
_p('PROJECTS := %s', table.concat(_MAKE.esc(table.extract(sln.projects, "name")), " "))
_p('')
_p('.PHONY: all clean help $(PROJECTS)')
_p('')
_p('all: $(PROJECTS)')
_p('')
-- write the project build rules
for _, prj in ipairs(sln.projects) do
_p('%s: %s', _MAKE.esc(prj.name), table.concat(_MAKE.esc(table.extract(premake.getdependencies(prj), "name")), " "))
_p('\t@echo "==== Building %s ($(config)) ===="', prj.name)
_p('\t@${MAKE} --no-print-directory -C %s -f %s', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))
_p('')
end
-- clean rules
_p('clean:')
for _ ,prj in ipairs(sln.projects) do
_p('\t@${MAKE} --no-print-directory -C %s -f %s clean', _MAKE.esc(path.getrelative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))
end
_p('')
-- help rule
_p('help:')
_p(1,'@echo "Usage: make [config=name] [target]"')
_p(1,'@echo ""')
_p(1,'@echo "CONFIGURATIONS:"')
local cfgpairs = { }
for _, platform in ipairs(platforms) do
for _, cfgname in ipairs(sln.configurations) do
_p(1,'@echo " %s"', premake.getconfigname(cfgname, platform, true))
end
end
_p(1,'@echo ""')
_p(1,'@echo "TARGETS:"')
_p(1,'@echo " all (default)"')
_p(1,'@echo " clean"')
for _, prj in ipairs(sln.projects) do
_p(1,'@echo " %s"', prj.name)
end
_p(1,'@echo ""')
_p(1,'@echo "For more information, see http://industriousone.com/premake/quick-start"')
end

View File

@ -1,551 +0,0 @@
--
-- _vstudio.lua
-- Define the Visual Studio 200x actions.
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
_VS = { } -- deprecated, will remove eventually
premake.vstudio = { }
local vstudio = premake.vstudio
--
-- Map Premake platform identifiers to the Visual Studio versions. Adds the Visual
-- Studio specific "any" and "mixed" to make solution generation easier.
--
premake.vstudio_platforms = {
any = "Any CPU",
mixed = "Mixed Platforms",
Native = "Win32",
x32 = "Win32",
x64 = "x64",
PS3 = "PS3",
Xbox360 = "Xbox 360",
}
--
-- Returns the architecture identifier for a project.
--
function _VS.arch(prj)
if (prj.language == "C#") then
if (_ACTION < "vs2005") then
return ".NET"
else
return "Any CPU"
end
else
return "Win32"
end
end
--
-- Return the version-specific text for a boolean value.
-- (this should probably go in vs200x_vcproj.lua)
--
function _VS.bool(value)
if (_ACTION < "vs2005") then
return iif(value, "TRUE", "FALSE")
else
return iif(value, "true", "false")
end
end
--
-- Process the solution's list of configurations and platforms, creates a list
-- of build configuration/platform pairs in a Visual Studio compatible format.
--
-- @param sln
-- The solution containing the configuration and platform lists.
-- @param with_pseudo
-- If true, Visual Studio's "Any CPU" and "Mixed Platforms" platforms will
-- be added for .NET and mixed mode solutions.
--
--
-- Process the solution's list of configurations and platforms, creates a list
-- of build configuration/platform pairs in a Visual Studio compatible format.
--
-- @param sln
-- The solution containing the configuration and platform lists.
--
function premake.vstudio_buildconfigs(sln)
local cfgs = { }
local platforms = premake.filterplatforms(sln, premake.vstudio_platforms, "Native")
-- .NET projects add "Any CPU", mixed mode solutions add "Mixed Platforms"
local hascpp = premake.hascppproject(sln)
local hasdotnet = premake.hasdotnetproject(sln)
if hasdotnet then
table.insert(platforms, 1, "any")
end
if hasdotnet and hascpp then
table.insert(platforms, 2, "mixed")
end
for _, buildcfg in ipairs(sln.configurations) do
for _, platform in ipairs(platforms) do
local entry = { }
entry.src_buildcfg = buildcfg
entry.src_platform = platform
-- PS3 is funky and needs special handling; it's more of a build
-- configuration than a platform from Visual Studio's point of view
if platform ~= "PS3" then
entry.buildcfg = buildcfg
entry.platform = premake.vstudio_platforms[platform]
else
entry.buildcfg = platform .. " " .. buildcfg
entry.platform = "Win32"
end
-- create a name the way VS likes it
entry.name = entry.buildcfg .. "|" .. entry.platform
-- flag the "fake" platforms added for .NET
entry.isreal = (platform ~= "any" and platform ~= "mixed")
table.insert(cfgs, entry)
end
end
return cfgs
end
--
-- Return a configuration type index.
-- (this should probably go in vs200x_vcproj.lua)
--
function _VS.cfgtype(cfg)
if (cfg.kind == "SharedLib") then
return 2
elseif (cfg.kind == "StaticLib") then
return 4
else
return 1
end
end
--
-- Clean Visual Studio files
--
function premake.vstudio.cleansolution(sln)
premake.clean.file(sln, "%%.sln")
premake.clean.file(sln, "%%.suo")
premake.clean.file(sln, "%%.ncb")
-- MonoDevelop files
premake.clean.file(sln, "%%.userprefs")
premake.clean.file(sln, "%%.usertasks")
end
function premake.vstudio.cleanproject(prj)
local fname = premake.project.getfilename(prj, "%%")
os.remove(fname .. ".vcproj")
os.remove(fname .. ".vcproj.user")
os.remove(fname .. ".vcxproj")
os.remove(fname .. ".vcxproj.user")
os.remove(fname .. ".vcxproj.filters")
os.remove(fname .. ".csproj")
os.remove(fname .. ".csproj.user")
os.remove(fname .. ".pidb")
os.remove(fname .. ".sdf")
end
function premake.vstudio.cleantarget(name)
os.remove(name .. ".pdb")
os.remove(name .. ".idb")
os.remove(name .. ".ilk")
os.remove(name .. ".vshost.exe")
os.remove(name .. ".exe.manifest")
end
--
-- Write out entries for the files element; called from premake.walksources().
-- (this should probably go in vs200x_vcproj.lua)
--
local function output(indent, value)
-- io.write(indent .. value .. "\r\n")
_p(indent .. value)
end
local function attrib(indent, name, value)
-- io.write(indent .. "\t" .. name .. '="' .. value .. '"\r\n')
_p(indent .. "\t" .. name .. '="' .. value .. '"')
end
function _VS.files(prj, fname, state, nestlevel)
local indent = string.rep("\t", nestlevel + 2)
if (state == "GroupStart") then
output(indent, "<Filter")
attrib(indent, "Name", path.getname(fname))
attrib(indent, "Filter", "")
output(indent, "\t>")
elseif (state == "GroupEnd") then
output(indent, "</Filter>")
else
output(indent, "<File")
attrib(indent, "RelativePath", path.translate(fname, "\\"))
output(indent, "\t>")
if (not prj.flags.NoPCH and prj.pchsource == fname) then
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
if cfginfo.isreal then
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
output(indent, "\t<FileConfiguration")
attrib(indent, "\tName", cfginfo.name)
output(indent, "\t\t>")
output(indent, "\t\t<Tool")
attrib(indent, "\t\tName", iif(cfg.system == "Xbox360", "VCCLX360CompilerTool", "VCCLCompilerTool"))
attrib(indent, "\t\tUsePrecompiledHeader", "1")
output(indent, "\t\t/>")
output(indent, "\t</FileConfiguration>")
end
end
end
if (path.getextension(fname) == ".asm") then
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
if cfginfo.isreal then
-- set defaults if required parameters are not set
if not (prj.solution.nasmformat) then
prj.solution.nasmformat = 'win32'
end
if not (prj.solution.nasmpath) then
prj.solution.nasmpath = 'nasm'
end
local nasmpath = path.translate(path.getrelative(prj.location, prj.solution.nasmpath), "\\")
local command = nasmpath.." -i "..path.translate(path.getdirectory(fname), "\\").."\\ -f "..prj.solution.nasmformat..
" &quot;$(InputPath)&quot; -o &quot;$(IntDir)\\$(InputName).obj&quot;"
output(indent, "\t<FileConfiguration")
attrib(indent, "\tName", cfginfo.name)
output(indent, "\t\t>")
output(indent, "\t\t<Tool")
attrib(indent, "\t\tName", "VCCustomBuildTool")
attrib(indent, "\t\tDescription", "Assembling $(InputPath)")
attrib(indent, "\t\tCommandLine", command)
attrib(indent, "\t\tOutputs", "$(IntDir)\\$(InputName).obj")
output(indent, "\t\t/>")
output(indent, "\t</FileConfiguration>")
end
end
end
output(indent, "</File>")
end
end
--
-- Return the optimization code.
-- (this should probably go in vs200x_vcproj.lua)
--
function _VS.optimization(cfg)
local result = 0
for _, value in ipairs(cfg.flags) do
if (value == "Optimize") then
result = 3
elseif (value == "OptimizeSize") then
result = 1
elseif (value == "OptimizeSpeed") then
result = 2
end
end
return result
end
--
-- Assemble the project file name.
--
function _VS.projectfile(prj)
local extension
if (prj.language == "C#") then
extension = ".csproj"
elseif (_ACTION == "vs2010" or _ACTION == "vs2012" or _ACTION == "vs2013") then
extension = ".vcxproj"
else
extension = ".vcproj"
end
local fname = path.join(prj.location, prj.name)
return fname..extension
end
--
-- Returns the Visual Studio tool ID for a given project type.
--
function _VS.tool(prj)
if (prj.language == "C#") then
return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC"
else
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942"
end
end
--
-- Register the Visual Studio command line actions
--
newaction {
trigger = "vs2002",
shortname = "Visual Studio 2002",
description = "Generate Microsoft Visual Studio 2002 project files",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "msc" },
dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs2002_solution)
end,
onproject = function(prj)
if premake.isdotnetproject(prj) then
premake.generate(prj, "%%.csproj", premake.vs2002_csproj)
premake.generate(prj, "%%.csproj.user", premake.vs2002_csproj_user)
else
premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj)
end
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction {
trigger = "vs2003",
shortname = "Visual Studio 2003",
description = "Generate Microsoft Visual Studio 2003 project files",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "msc" },
dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs2003_solution)
end,
onproject = function(prj)
if premake.isdotnetproject(prj) then
premake.generate(prj, "%%.csproj", premake.vs2002_csproj)
premake.generate(prj, "%%.csproj.user", premake.vs2002_csproj_user)
else
premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj)
end
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction {
trigger = "vs2005",
shortname = "Visual Studio 2005",
description = "Generate Microsoft Visual Studio 2005 project files",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "msc" },
dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs2005_solution)
end,
onproject = function(prj)
if premake.isdotnetproject(prj) then
premake.generate(prj, "%%.csproj", premake.vs2005_csproj)
premake.generate(prj, "%%.csproj.user", premake.vs2005_csproj_user)
else
premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj)
end
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction {
trigger = "vs2008",
shortname = "Visual Studio 2008",
description = "Generate Microsoft Visual Studio 2008 project files",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++", "C#" },
valid_tools = {
cc = { "msc" },
dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs2005_solution)
end,
onproject = function(prj)
if premake.isdotnetproject(prj) then
premake.generate(prj, "%%.csproj", premake.vs2005_csproj)
premake.generate(prj, "%%.csproj.user", premake.vs2005_csproj_user)
else
premake.generate(prj, "%%.vcproj", premake.vs200x_vcproj)
end
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction
{
trigger = "vs2010",
shortname = "Visual Studio 2010",
description = "Generate Visual Studio 2010 project files (experimental)",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C++","C"},
valid_tools = {
cc = { "msc" },
--dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs_generic_solution)
end,
onproject = function(prj)
premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj)
premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user)
premake.generate(prj, "%%.vcxproj.filters", premake.vs2010_vcxproj_filters)
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction
{
trigger = "vs2012",
shortname = "Visual Studio 2012",
description = "Generate Visual Studio 2012 project files (experimental)",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C++","C"},
valid_tools = {
cc = { "msc" },
--dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs_generic_solution)
end,
onproject = function(prj)
premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj)
premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user)
premake.generate(prj, "%%.vcxproj.filters", premake.vs2010_vcxproj_filters)
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}
newaction
{
trigger = "vs2013",
shortname = "Visual Studio 2013",
description = "Generate Visual Studio 2013 project files (experimental)",
os = "windows",
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
valid_languages = { "C++","C"},
valid_tools = {
cc = { "msc" },
--dotnet = { "msnet" },
},
onsolution = function(sln)
premake.generate(sln, "%%.sln", premake.vs_generic_solution)
end,
onproject = function(prj)
premake.generate(prj, "%%.vcxproj", premake.vs2010_vcxproj)
premake.generate(prj, "%%.vcxproj.user", premake.vs2010_vcxproj_user)
premake.generate(prj, "%%.vcxproj.filters", premake.vs2010_vcxproj_filters)
end,
oncleansolution = premake.vstudio.cleansolution,
oncleanproject = premake.vstudio.cleanproject,
oncleantarget = premake.vstudio.cleantarget
}

View File

@ -1,143 +0,0 @@
--
-- vs2002_csproj.lua
-- Generate a Visual Studio 2002/2003 C# project.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
--
-- Figure out what elements a particular file need in its item block,
-- based on its build action and any related files in the project.
--
local function getelements(prj, action, fname)
if action == "Compile" and fname:endswith(".cs") then
return "SubTypeCode"
end
if action == "EmbeddedResource" and fname:endswith(".resx") then
-- is there a matching *.cs file?
local basename = fname:sub(1, -6)
local testname = path.getname(basename .. ".cs")
if premake.findfile(prj, testname) then
return "Dependency", testname
end
end
return "None"
end
function premake.vs2002_csproj(prj)
io.eol = "\r\n"
_p('<VisualStudioProject>')
_p(1,'<CSHARP')
_p(2,'ProjectType = "Local"')
_p(2,'ProductVersion = "%s"', iif(_ACTION == "vs2002", "7.0.9254", "7.10.3077"))
_p(2,'SchemaVersion = "%s"', iif(_ACTION == "vs2002", "1.0", "2.0"))
_p(2,'ProjectGuid = "{%s}"', prj.uuid)
_p(1,'>')
_p(2,'<Build>')
-- Write out project-wide settings
_p(3,'<Settings')
_p(4,'ApplicationIcon = ""')
_p(4,'AssemblyKeyContainerName = ""')
_p(4,'AssemblyName = "%s"', prj.buildtarget.basename)
_p(4,'AssemblyOriginatorKeyFile = ""')
_p(4,'DefaultClientScript = "JScript"')
_p(4,'DefaultHTMLPageLayout = "Grid"')
_p(4,'DefaultTargetSchema = "IE50"')
_p(4,'DelaySign = "false"')
if _ACTION == "vs2002" then
_p(4,'NoStandardLibraries = "false"')
end
_p(4,'OutputType = "%s"', premake.dotnet.getkind(prj))
if _ACTION == "vs2003" then
_p(4,'PreBuildEvent = ""')
_p(4,'PostBuildEvent = ""')
end
_p(4,'RootNamespace = "%s"', prj.buildtarget.basename)
if _ACTION == "vs2003" then
_p(4,'RunPostBuildEvent = "OnBuildSuccess"')
end
_p(4,'StartupObject = ""')
_p(3,'>')
-- Write out configuration blocks
for cfg in premake.eachconfig(prj) do
_p(4,'<Config')
_p(5,'Name = "%s"', premake.esc(cfg.name))
_p(5,'AllowUnsafeBlocks = "%s"', iif(cfg.flags.Unsafe, "true", "false"))
_p(5,'BaseAddress = "285212672"')
_p(5,'CheckForOverflowUnderflow = "false"')
_p(5,'ConfigurationOverrideFile = ""')
_p(5,'DefineConstants = "%s"', premake.esc(table.concat(cfg.defines, ";")))
_p(5,'DocumentationFile = ""')
_p(5,'DebugSymbols = "%s"', iif(cfg.flags.Symbols, "true", "false"))
_p(5,'FileAlignment = "4096"')
_p(5,'IncrementalBuild = "false"')
if _ACTION == "vs2003" then
_p(5,'NoStdLib = "false"')
_p(5,'NoWarn = ""')
end
_p(5,'Optimize = "%s"', iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, "true", "false"))
_p(5,'OutputPath = "%s"', premake.esc(cfg.buildtarget.directory))
_p(5,'RegisterForComInterop = "false"')
_p(5,'RemoveIntegerChecks = "false"')
_p(5,'TreatWarningsAsErrors = "%s"', iif(cfg.flags.FatalWarnings, "true", "false"))
_p(5,'WarningLevel = "4"')
_p(4,'/>')
end
_p(3,'</Settings>')
-- List assembly references
_p(3,'<References>')
for _, ref in ipairs(premake.getlinks(prj, "siblings", "object")) do
_p(4,'<Reference')
_p(5,'Name = "%s"', ref.buildtarget.basename)
_p(5,'Project = "{%s}"', ref.uuid)
_p(5,'Package = "{%s}"', _VS.tool(ref))
_p(4,'/>')
end
for _, linkname in ipairs(premake.getlinks(prj, "system", "fullpath")) do
_p(4,'<Reference')
_p(5,'Name = "%s"', path.getbasename(linkname))
_p(5,'AssemblyName = "%s"', path.getname(linkname))
if path.getdirectory(linkname) ~= "." then
_p(5,'HintPath = "%s"', path.translate(linkname, "\\"))
end
_p(4,'/>')
end
_p(3,'</References>')
_p(2,'</Build>')
-- List source files
_p(2,'<Files>')
_p(3,'<Include>')
for fcfg in premake.eachfile(prj) do
local action = premake.dotnet.getbuildaction(fcfg)
local fname = path.translate(premake.esc(fcfg.name), "\\")
local elements, dependency = getelements(prj, action, fcfg.name)
_p(4,'<File')
_p(5,'RelPath = "%s"', premake.esc(fname))
_p(5,'BuildAction = "%s"', action)
if dependency then
_p(5,'DependentUpon = "%s"', premake.esc(path.translate(dependency, "\\")))
end
if elements == "SubTypeCode" then
_p(5,'SubType = "Code"')
end
_p(4,'/>')
end
_p(3,'</Include>')
_p(2,'</Files>')
_p(1,'</CSHARP>')
_p('</VisualStudioProject>')
end

View File

@ -1,50 +0,0 @@
--
-- vs2002_csproj_user.lua
-- Generate a Visual Studio 2002/2003 C# .user file.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.vs2002_csproj_user(prj)
io.eol = "\r\n"
_p('<VisualStudioProject>')
_p(1,'<CSHARP>')
_p(2,'<Build>')
-- Visual Studio wants absolute paths
local refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. "/" .. v) end)
_p(3,'<Settings ReferencePath = "%s">', path.translate(table.concat(refpaths, ";"), "\\"))
for cfg in premake.eachconfig(prj) do
_p(4,'<Config')
_p(5,'Name = "%s"', premake.esc(cfg.name))
_p(5,'EnableASPDebugging = "false"')
_p(5,'EnableASPXDebugging = "false"')
_p(5,'EnableUnmanagedDebugging = "false"')
_p(5,'EnableSQLServerDebugging = "false"')
_p(5,'RemoteDebugEnabled = "false"')
_p(5,'RemoteDebugMachine = ""')
_p(5,'StartAction = "Project"')
_p(5,'StartArguments = ""')
_p(5,'StartPage = ""')
_p(5,'StartProgram = ""')
_p(5,'StartURL = ""')
_p(5,'StartWorkingDirectory = ""')
_p(5,'StartWithIE = "false"')
_p(4,'/>')
end
_p(3,'</Settings>')
_p(2,'</Build>')
_p(2,'<OtherProjectSettings')
_p(3,'CopyProjectDestinationFolder = ""')
_p(3,'CopyProjectUncPath = ""')
_p(3,'CopyProjectOption = "0"')
_p(3,'ProjectView = "ProjectFiles"')
_p(3,'ProjectTrust = "0"')
_p(2,'/>')
_p(1,'</CSHARP>')
_p('</VisualStudioProject>')
end

View File

@ -1,47 +0,0 @@
--
-- vs2002_solution.lua
-- Generate a Visual Studio 2002 solution.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.vs2002_solution(sln)
io.eol = '\r\n'
-- Precompute Visual Studio configurations
sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
_p('Microsoft Visual Studio Solution File, Format Version 7.00')
-- Write out the list of project entries
for prj in premake.solution.eachproject(sln) do
local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))
_p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid)
_p('EndProject')
end
_p('Global')
_p(1,'GlobalSection(SolutionConfiguration) = preSolution')
for i, cfgname in ipairs(sln.configurations) do
_p(2,'ConfigName.%d = %s', i - 1, cfgname)
end
_p(1,'EndGlobalSection')
_p(1,'GlobalSection(ProjectDependencies) = postSolution')
_p(1,'EndGlobalSection')
_p(1,'GlobalSection(ProjectConfiguration) = postSolution')
for prj in premake.solution.eachproject(sln) do
for _, cfgname in ipairs(sln.configurations) do
_p(2,'{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))
_p(2,'{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))
end
end
_p(1,'EndGlobalSection')
_p(1,'GlobalSection(ExtensibilityGlobals) = postSolution')
_p(1,'EndGlobalSection')
_p(1,'GlobalSection(ExtensibilityAddIns) = postSolution')
_p(1,'EndGlobalSection')
_p('EndGlobal')
end

View File

@ -1,57 +0,0 @@
--
-- vs2003_solution.lua
-- Generate a Visual Studio 2003 solution.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.vs2003_solution(sln)
io.eol = '\r\n'
-- Precompute Visual Studio configurations
sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
_p('Microsoft Visual Studio Solution File, Format Version 8.00')
-- Write out the list of project entries
for prj in premake.solution.eachproject(sln) do
local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)))
_p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid)
local deps = premake.getdependencies(prj)
if #deps > 0 then
_p('\tProjectSection(ProjectDependencies) = postProject')
for _, dep in ipairs(deps) do
_p('\t\t{%s} = {%s}', dep.uuid, dep.uuid)
end
_p('\tEndProjectSection')
end
_p('EndProject')
end
_p('Global')
_p('\tGlobalSection(SolutionConfiguration) = preSolution')
for _, cfgname in ipairs(sln.configurations) do
_p('\t\t%s = %s', cfgname, cfgname)
end
_p('\tEndGlobalSection')
_p('\tGlobalSection(ProjectDependencies) = postSolution')
_p('\tEndGlobalSection')
_p('\tGlobalSection(ProjectConfiguration) = postSolution')
for prj in premake.solution.eachproject(sln) do
for _, cfgname in ipairs(sln.configurations) do
_p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))
_p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfgname, cfgname, _VS.arch(prj))
end
end
_p('\tEndGlobalSection')
_p('\tGlobalSection(ExtensibilityGlobals) = postSolution')
_p('\tEndGlobalSection')
_p('\tGlobalSection(ExtensibilityAddIns) = postSolution')
_p('\tEndGlobalSection')
_p('EndGlobal')
end

View File

@ -1,208 +0,0 @@
--
-- vs2005_csproj.lua
-- Generate a Visual Studio 2005/2008 C# project.
-- Copyright (c) 2009-2010 Jason Perkins and the Premake project
--
--
-- Set up namespaces
--
premake.vstudio.cs2005 = { }
local vstudio = premake.vstudio
local cs2005 = premake.vstudio.cs2005
--
-- Figure out what elements a particular source code file need in its item
-- block, based on its build action and any related files in the project.
--
local function getelements(prj, action, fname)
if action == "Compile" and fname:endswith(".cs") then
if fname:endswith(".Designer.cs") then
-- is there a matching *.cs file?
local basename = fname:sub(1, -13)
local testname = basename .. ".cs"
if premake.findfile(prj, testname) then
return "Dependency", testname
end
-- is there a matching *.resx file?
testname = basename .. ".resx"
if premake.findfile(prj, testname) then
return "AutoGen", testname
end
else
-- is there a *.Designer.cs file?
local basename = fname:sub(1, -4)
local testname = basename .. ".Designer.cs"
if premake.findfile(prj, testname) then
return "SubTypeForm"
end
end
end
if action == "EmbeddedResource" and fname:endswith(".resx") then
-- is there a matching *.cs file?
local basename = fname:sub(1, -6)
local testname = path.getname(basename .. ".cs")
if premake.findfile(prj, testname) then
if premake.findfile(prj, basename .. ".Designer.cs") then
return "DesignerType", testname
else
return "Dependency", testname
end
else
-- is there a matching *.Designer.cs?
testname = path.getname(basename .. ".Designer.cs")
if premake.findfile(prj, testname) then
return "AutoGenerated"
end
end
end
if action == "Content" then
return "CopyNewest"
end
return "None"
end
--
-- Write the opening <Project> element and project level <PropertyGroup> block.
--
function cs2005.projectelement(prj)
_p('<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"%s>', iif(_ACTION == 'vs2005', '', ' ToolsVersion="3.5"'))
end
function cs2005.projectsettings(prj)
_p(' <PropertyGroup>')
_p(' <Configuration Condition=" \'$(Configuration)\' == \'\' ">%s</Configuration>', premake.esc(prj.solution.configurations[1]))
_p(' <Platform Condition=" \'$(Platform)\' == \'\' ">AnyCPU</Platform>')
_p(' <ProductVersion>%s</ProductVersion>', iif(_ACTION == "vs2005", "8.0.50727", "9.0.21022"))
_p(' <SchemaVersion>2.0</SchemaVersion>')
_p(' <ProjectGuid>{%s}</ProjectGuid>', prj.uuid)
_p(' <OutputType>%s</OutputType>', premake.dotnet.getkind(prj))
_p(' <AppDesignerFolder>Properties</AppDesignerFolder>')
_p(' <RootNamespace>%s</RootNamespace>', prj.buildtarget.basename)
_p(' <AssemblyName>%s</AssemblyName>', prj.buildtarget.basename)
if prj.framework then
_p(' <TargetFrameworkVersion>v%s</TargetFrameworkVersion>', prj.framework)
end
_p(' </PropertyGroup>')
end
--
-- The main function: write the project file.
--
function premake.vs2005_csproj(prj)
io.eol = "\r\n"
local vsversion, toolversion
if _ACTION == "vs2005" then
vsversion = "8.0.50727"
toolversion = nil
elseif _ACTION == "vs2008" then
vsversion = "9.0.21022"
toolversion = "3.5"
end
if toolversion then
_p('<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="%s">', toolversion)
else
_p('<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">')
end
_p(' <PropertyGroup>')
_p(' <Configuration Condition=" \'$(Configuration)\' == \'\' ">%s</Configuration>', premake.esc(prj.solution.configurations[1]))
_p(' <Platform Condition=" \'$(Platform)\' == \'\' ">AnyCPU</Platform>')
_p(' <ProductVersion>%s</ProductVersion>', vsversion)
_p(' <SchemaVersion>2.0</SchemaVersion>')
_p(' <ProjectGuid>{%s}</ProjectGuid>', prj.uuid)
_p(' <OutputType>%s</OutputType>', premake.dotnet.getkind(prj))
_p(' <AppDesignerFolder>Properties</AppDesignerFolder>')
_p(' <RootNamespace>%s</RootNamespace>', prj.buildtarget.basename)
_p(' <AssemblyName>%s</AssemblyName>', prj.buildtarget.basename)
_p(' </PropertyGroup>')
for cfg in premake.eachconfig(prj) do
_p(' <PropertyGroup Condition=" \'$(Configuration)|$(Platform)\' == \'%s|AnyCPU\' ">', premake.esc(cfg.name))
if cfg.flags.Symbols then
_p(' <DebugSymbols>true</DebugSymbols>')
_p(' <DebugType>full</DebugType>')
else
_p(' <DebugType>pdbonly</DebugType>')
end
_p(' <Optimize>%s</Optimize>', iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, "true", "false"))
_p(' <OutputPath>%s</OutputPath>', cfg.buildtarget.directory)
_p(' <DefineConstants>%s</DefineConstants>', table.concat(premake.esc(cfg.defines), ";"))
_p(' <ErrorReport>prompt</ErrorReport>')
_p(' <WarningLevel>4</WarningLevel>')
if cfg.flags.Unsafe then
_p(' <AllowUnsafeBlocks>true</AllowUnsafeBlocks>')
end
if cfg.flags.FatalWarnings then
_p(' <TreatWarningsAsErrors>true</TreatWarningsAsErrors>')
end
_p(' </PropertyGroup>')
end
_p(' <ItemGroup>')
for _, ref in ipairs(premake.getlinks(prj, "siblings", "object")) do
_p(' <ProjectReference Include="%s">', path.translate(path.getrelative(prj.location, _VS.projectfile(ref)), "\\"))
_p(' <Project>{%s}</Project>', ref.uuid)
_p(' <Name>%s</Name>', premake.esc(ref.name))
_p(' </ProjectReference>')
end
for _, linkname in ipairs(premake.getlinks(prj, "system", "basename")) do
_p(' <Reference Include="%s" />', premake.esc(linkname))
end
_p(' </ItemGroup>')
_p(' <ItemGroup>')
for fcfg in premake.eachfile(prj) do
local action = premake.dotnet.getbuildaction(fcfg)
local fname = path.translate(premake.esc(fcfg.name), "\\")
local elements, dependency = getelements(prj, action, fcfg.name)
if elements == "None" then
_p(' <%s Include="%s" />', action, fname)
else
_p(' <%s Include="%s">', action, fname)
if elements == "AutoGen" then
_p(' <AutoGen>True</AutoGen>')
elseif elements == "AutoGenerated" then
_p(' <SubType>Designer</SubType>')
_p(' <Generator>ResXFileCodeGenerator</Generator>')
_p(' <LastGenOutput>%s.Designer.cs</LastGenOutput>', premake.esc(path.getbasename(fcfg.name)))
elseif elements == "SubTypeDesigner" then
_p(' <SubType>Designer</SubType>')
elseif elements == "SubTypeForm" then
_p(' <SubType>Form</SubType>')
elseif elements == "PreserveNewest" then
_p(' <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>')
end
if dependency then
_p(' <DependentUpon>%s</DependentUpon>', path.translate(premake.esc(dependency), "\\"))
end
_p(' </%s>', action)
end
end
_p(' </ItemGroup>')
_p(' <Import Project="$(MSBuildBinPath)\\Microsoft.CSharp.targets" />')
_p(' <!-- To modify your build process, add your task inside one of the targets below and uncomment it.')
_p(' Other similar extension points exist, see Microsoft.Common.targets.')
_p(' <Target Name="BeforeBuild">')
_p(' </Target>')
_p(' <Target Name="AfterBuild">')
_p(' </Target>')
_p(' -->')
_p('</Project>')
end

View File

@ -1,18 +0,0 @@
--
-- vs2005_csproj_user.lua
-- Generate a Visual Studio 2005/2008 C# .user file.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.vs2005_csproj_user(prj)
io.eol = "\r\n"
_p('<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">')
_p(' <PropertyGroup>')
local refpaths = table.translate(prj.libdirs, function(v) return path.getabsolute(prj.location .. "/" .. v) end)
_p(' <ReferencePath>%s</ReferencePath>', path.translate(table.concat(refpaths, ";"), "\\"))
_p(' </PropertyGroup>')
_p('</Project>')
end

View File

@ -1,105 +0,0 @@
--
-- vs2005_solution.lua
-- Generate a Visual Studio 2005 or 2008 solution.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
function premake.vs2005_solution(sln)
io.eol = '\r\n'
-- Precompute Visual Studio configurations
sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
-- Mark the file as Unicode
_p('\239\187\191')
-- Write the solution file version header
_p('Microsoft Visual Studio Solution File, Format Version %s', iif(_ACTION == 'vs2005', '9.00', '10.00'))
_p('# Visual Studio %s', iif(_ACTION == 'vs2005', '2005', '2008'))
-- Write out the list of project entries
for prj in premake.solution.eachproject(sln) do
-- Build a relative path from the solution file to the project file
local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), "\\")
_p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid)
local deps = premake.getdependencies(prj)
if #deps > 0 then
_p('\tProjectSection(ProjectDependencies) = postProject')
for _, dep in ipairs(deps) do
_p('\t\t{%s} = {%s}', dep.uuid, dep.uuid)
end
_p('\tEndProjectSection')
end
_p('EndProject')
end
_p('Global')
premake.vs2005_solution_platforms(sln)
premake.vs2005_solution_project_platforms(sln)
premake.vs2005_solution_properties(sln)
_p('EndGlobal')
end
--
-- Write out the contents of the SolutionConfigurationPlatforms section, which
-- lists all of the configuration/platform pairs that exist in the solution.
--
function premake.vs2005_solution_platforms(sln)
_p('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution')
for _, cfg in ipairs(sln.vstudio_configs) do
_p('\t\t%s = %s', cfg.name, cfg.name)
end
_p('\tEndGlobalSection')
end
--
-- Write out the contents of the ProjectConfigurationPlatforms section, which maps
-- the configuration/platform pairs into each project of the solution.
--
function premake.vs2005_solution_project_platforms(sln)
_p('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution')
for prj in premake.solution.eachproject(sln) do
for _, cfg in ipairs(sln.vstudio_configs) do
-- .NET projects always map to the "Any CPU" platform (for now, at
-- least). For C++, "Any CPU" and "Mixed Platforms" map to the first
-- C++ compatible target platform in the solution list.
local mapped
if premake.isdotnetproject(prj) then
mapped = "Any CPU"
else
if cfg.platform == "Any CPU" or cfg.platform == "Mixed Platforms" then
mapped = sln.vstudio_configs[3].platform
else
mapped = cfg.platform
end
end
_p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)
if mapped == cfg.platform or cfg.platform == "Mixed Platforms" then
_p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped)
end
end
end
_p('\tEndGlobalSection')
end
--
-- Write out contents of the SolutionProperties section; currently unused.
--
function premake.vs2005_solution_properties(sln)
_p('\tGlobalSection(SolutionProperties) = preSolution')
_p('\t\tHideSolutionNode = FALSE')
_p('\tEndGlobalSection')
end

View File

@ -1,654 +0,0 @@
--
-- vs200x_vcproj.lua
-- Generate a Visual Studio 2002-2008 C/C++ project.
-- Copyright (c) 2009, 2010 Jason Perkins and the Premake project
--
premake.vstudio.vcproj = { }
local vcproj = premake.vstudio.vcproj
--
-- Write out the <Configuration> element.
--
function vcproj.Configuration(name, cfg)
_p(2,'<Configuration')
_p(3,'Name="%s"', premake.esc(name))
_p(3,'OutputDirectory="%s"', premake.esc(cfg.buildtarget.directory))
_p(3,'IntermediateDirectory="%s"', premake.esc(cfg.objectsdir))
_p(3,'ConfigurationType="%s"', _VS.cfgtype(cfg))
if (cfg.flags.MFC) then
_p(3, 'UseOfMFC="2"')
end
_p(3,'CharacterSet="%s"', iif(cfg.flags.Unicode, 1, 2))
if cfg.flags.Managed then
_p(3,'ManagedExtensions="1"')
end
_p(3,'>')
end
--
-- Write out the <Platforms> element; ensures that each target platform
-- is listed only once. Skips over .NET's pseudo-platforms (like "Any CPU").
--
function premake.vs200x_vcproj_platforms(prj)
local used = { }
_p(1,'<Platforms>')
for _, cfg in ipairs(prj.solution.vstudio_configs) do
if cfg.isreal and not table.contains(used, cfg.platform) then
table.insert(used, cfg.platform)
_p(2,'<Platform')
_p(3,'Name="%s"', cfg.platform)
_p(2,'/>')
end
end
_p(1,'</Platforms>')
end
--
-- Return the debugging symbols level for a configuration.
--
function premake.vs200x_vcproj_symbols(cfg)
if (not cfg.flags.Symbols) then
return 0
else
-- Edit-and-continue does't work for some configurations
if cfg.flags.NoEditAndContinue or
_VS.optimization(cfg) ~= 0 or
cfg.flags.Managed or
cfg.platform == "x64" then
return 3
else
return 4
end
end
end
--
-- Compiler block for Windows and XBox360 platforms.
--
function premake.vs200x_vcproj_VCCLCompilerTool(cfg)
_p(3,'<Tool')
_p(4,'Name="%s"', iif(cfg.platform ~= "Xbox360", "VCCLCompilerTool", "VCCLX360CompilerTool"))
if #cfg.buildoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.buildoptions), " "))
end
_p(4,'Optimization="%s"', _VS.optimization(cfg))
if cfg.flags.NoFramePointer then
_p(4,'OmitFramePointers="%s"', _VS.bool(true))
end
if #cfg.includedirs > 0 then
_p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\')))
end
if #cfg.defines > 0 then
_p(4,'PreprocessorDefinitions="%s"', premake.esc(table.concat(cfg.defines, ";")))
end
if premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild and not cfg.flags.Managed then
_p(4,'MinimalRebuild="%s"', _VS.bool(true))
end
if cfg.flags.NoExceptions then
_p(4,'ExceptionHandling="%s"', iif(_ACTION < "vs2005", "FALSE", 0))
elseif cfg.flags.SEH and _ACTION > "vs2003" then
_p(4,'ExceptionHandling="2"')
end
if _VS.optimization(cfg) == 0 and not cfg.flags.Managed then
_p(4,'BasicRuntimeChecks="3"')
end
if _VS.optimization(cfg) ~= 0 then
_p(4,'StringPooling="%s"', _VS.bool(true))
end
local runtime
if premake.config.isdebugbuild(cfg) then
runtime = iif(cfg.flags.StaticRuntime, 1, 3)
else
runtime = iif(cfg.flags.StaticRuntime, 0, 2)
end
-- if cfg.flags.StaticRuntime then
-- runtime = iif(cfg.flags.Symbols, 1, 0)
-- else
-- runtime = iif(cfg.flags.Symbols, 3, 2)
-- end
_p(4,'RuntimeLibrary="%s"', runtime)
_p(4,'EnableFunctionLevelLinking="%s"', _VS.bool(true))
if _ACTION > "vs2003" and cfg.platform ~= "Xbox360" and cfg.platform ~= "x64" then
if cfg.flags.EnableSSE then
_p(4,'EnableEnhancedInstructionSet="1"')
elseif cfg.flags.EnableSSE2 then
_p(4,'EnableEnhancedInstructionSet="2"')
end
end
if _ACTION < "vs2005" then
if cfg.flags.FloatFast then
_p(4,'ImproveFloatingPointConsistency="%s"', _VS.bool(false))
elseif cfg.flags.FloatStrict then
_p(4,'ImproveFloatingPointConsistency="%s"', _VS.bool(true))
end
else
if cfg.flags.FloatFast then
_p(4,'FloatingPointModel="2"')
elseif cfg.flags.FloatStrict then
_p(4,'FloatingPointModel="1"')
end
end
if _ACTION < "vs2005" and not cfg.flags.NoRTTI then
_p(4,'RuntimeTypeInfo="%s"', _VS.bool(true))
elseif _ACTION > "vs2003" and cfg.flags.NoRTTI then
_p(4,'RuntimeTypeInfo="%s"', _VS.bool(false))
end
if cfg.flags.NativeWChar then
_p(4,'TreatWChar_tAsBuiltInType="%s"', _VS.bool(true))
elseif cfg.flags.NoNativeWChar then
_p(4,'TreatWChar_tAsBuiltInType="%s"', _VS.bool(false))
end
if not cfg.flags.NoPCH and cfg.pchheader then
_p(4,'UsePrecompiledHeader="%s"', iif(_ACTION < "vs2005", 3, 2))
_p(4,'PrecompiledHeaderThrough="%s"', path.getname(cfg.pchheader))
else
_p(4,'UsePrecompiledHeader="%s"', iif(_ACTION > "vs2003" or cfg.flags.NoPCH, 0, 2))
end
_p(4,'WarningLevel="%s"', iif(cfg.flags.ExtraWarnings, 4, 3))
if cfg.flags.FatalWarnings then
_p(4,'WarnAsError="%s"', _VS.bool(true))
end
if _ACTION < "vs2008" and not cfg.flags.Managed then
_p(4,'Detect64BitPortabilityProblems="%s"', _VS.bool(not cfg.flags.No64BitChecks))
end
_p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name))
_p(4,'DebugInformationFormat="%s"', premake.vs200x_vcproj_symbols(cfg))
if cfg.language == "C" then
_p(4, 'CompileAs="1"')
end
_p(3,'/>')
end
--
-- Linker block for Windows and Xbox 360 platforms.
--
function premake.vs200x_vcproj_VCLinkerTool(cfg)
_p(3,'<Tool')
if cfg.kind ~= "StaticLib" then
_p(4,'Name="%s"', iif(cfg.platform ~= "Xbox360", "VCLinkerTool", "VCX360LinkerTool"))
if cfg.flags.NoImportLib then
_p(4,'IgnoreImportLibrary="%s"', _VS.bool(true))
end
if #cfg.linkoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.linkoptions), " "))
end
if #cfg.links > 0 then
_p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " "))
end
_p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name)
_p(4,'LinkIncremental="%s"', iif(_VS.optimization(cfg) == 0, 2, 1))
_p(4,'AdditionalLibraryDirectories="%s"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";"))
local deffile = premake.findfile(cfg, ".def")
if deffile then
_p(4,'ModuleDefinitionFile="%s"', deffile)
end
if cfg.flags.NoManifest then
_p(4,'GenerateManifest="%s"', _VS.bool(false))
end
_p(4,'GenerateDebugInformation="%s"', _VS.bool(premake.vs200x_vcproj_symbols(cfg) ~= 0))
if premake.vs200x_vcproj_symbols(cfg) ~= 0 then
_p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name))
end
_p(4,'SubSystem="%s"', iif(cfg.kind == "ConsoleApp", 1, 2))
if _VS.optimization(cfg) ~= 0 then
_p(4,'OptimizeReferences="2"')
_p(4,'EnableCOMDATFolding="2"')
end
if (cfg.kind == "ConsoleApp" or cfg.kind == "WindowedApp") and not cfg.flags.WinMain then
_p(4,'EntryPointSymbol="mainCRTStartup"')
end
if cfg.kind == "SharedLib" then
local implibname = cfg.linktarget.fullpath
_p(4,'ImportLibrary="%s"', iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname))
end
_p(4,'TargetMachine="%d"', iif(cfg.platform == "x64", 17, 1))
else
_p(4,'Name="VCLibrarianTool"')
if #cfg.links > 0 then
_p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " "))
end
_p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name)
if #cfg.libdirs > 0 then
_p(4,'AdditionalLibraryDirectories="%s"', premake.esc(path.translate(table.concat(cfg.libdirs , ";"))))
end
if #cfg.linkoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.linkoptions), " "))
end
end
_p(3,'/>')
end
--
-- Compiler and linker blocks for the PS3 platform, which uses GCC.
--
function premake.vs200x_vcproj_VCCLCompilerTool_GCC(cfg)
_p(3,'<Tool')
_p(4,'Name="VCCLCompilerTool"')
local buildoptions = table.join(premake.gcc.getcflags(cfg), premake.gcc.getcxxflags(cfg), cfg.buildoptions)
if #buildoptions > 0 then
_p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " ")))
end
if #cfg.includedirs > 0 then
_p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\')))
end
if #cfg.defines > 0 then
_p(4,'PreprocessorDefinitions="%s"', table.concat(premake.esc(cfg.defines), ";"))
end
_p(4,'ProgramDataBaseFileName="$(OutDir)\\%s.pdb"', path.getbasename(cfg.buildtarget.name))
_p(4,'DebugInformationFormat="0"')
_p(4,'CompileAs="0"')
_p(3,'/>')
end
function premake.vs200x_vcproj_VCLinkerTool_GCC(cfg)
_p(3,'<Tool')
if cfg.kind ~= "StaticLib" then
_p(4,'Name="VCLinkerTool"')
local buildoptions = table.join(premake.gcc.getldflags(cfg), cfg.linkoptions)
if #buildoptions > 0 then
_p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " ")))
end
if #cfg.links > 0 then
_p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " "))
end
_p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name)
_p(4,'LinkIncremental="0"')
_p(4,'AdditionalLibraryDirectories="%s"', table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";"))
_p(4,'GenerateManifest="%s"', _VS.bool(false))
_p(4,'ProgramDatabaseFile=""')
_p(4,'RandomizedBaseAddress="1"')
_p(4,'DataExecutionPrevention="0"')
else
_p(4,'Name="VCLibrarianTool"')
local buildoptions = table.join(premake.gcc.getldflags(cfg), cfg.linkoptions)
if #buildoptions > 0 then
_p(4,'AdditionalOptions="%s"', premake.esc(table.concat(buildoptions, " ")))
end
if #cfg.links > 0 then
_p(4,'AdditionalDependencies="%s"', table.concat(premake.getlinks(cfg, "all", "fullpath"), " "))
end
_p(4,'OutputFile="$(OutDir)\\%s"', cfg.buildtarget.name)
if #cfg.libdirs > 0 then
_p(4,'AdditionalLibraryDirectories="%s"', premake.esc(path.translate(table.concat(cfg.libdirs , ";"))))
end
end
_p(3,'/>')
end
--
-- Resource compiler block.
--
function premake.vs200x_vcproj_VCResourceCompilerTool(cfg)
_p(3,'<Tool')
_p(4,'Name="VCResourceCompilerTool"')
if #cfg.resoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.resoptions), " "))
end
if #cfg.defines > 0 or #cfg.resdefines > 0 then
_p(4,'PreprocessorDefinitions="%s"', table.concat(premake.esc(table.join(cfg.defines, cfg.resdefines)), ";"))
end
if #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then
local dirs = table.join(cfg.includedirs, cfg.resincludedirs)
_p(4,'AdditionalIncludeDirectories="%s"', premake.esc(path.translate(table.concat(dirs, ";"), '\\')))
end
_p(3,'/>')
end
--
-- Manifest block.
--
function premake.vs200x_vcproj_VCManifestTool(cfg)
-- locate all manifest files
local manifests = { }
for _, fname in ipairs(cfg.files) do
if path.getextension(fname) == ".manifest" then
table.insert(manifests, fname)
end
end
_p(3,'<Tool')
_p(4,'Name="VCManifestTool"')
if #manifests > 0 then
_p(4,'AdditionalManifestFiles="%s"', premake.esc(table.concat(manifests, ";")))
end
_p(3,'/>')
end
--
-- VCMIDLTool block
--
function premake.vs200x_vcproj_VCMIDLTool(cfg)
_p(3,'<Tool')
_p(4,'Name="VCMIDLTool"')
if cfg.platform == "x64" then
_p(4,'TargetEnvironment="3"')
end
_p(3,'/>')
end
--
-- Write out a custom build steps block.
--
function premake.vs200x_vcproj_buildstepsblock(name, steps)
_p(3,'<Tool')
_p(4,'Name="%s"', name)
if #steps > 0 then
_p(4,'CommandLine="%s"', premake.esc(table.implode(steps, "", "", "\r\n")))
end
_p(3,'/>')
end
--
-- Map project tool blocks to handler functions. Unmapped blocks will output
-- an empty <Tool> element.
--
local blockmap =
{
VCCLCompilerTool = premake.vs200x_vcproj_VCCLCompilerTool,
VCCLCompilerTool_GCC = premake.vs200x_vcproj_VCCLCompilerTool_GCC,
VCLinkerTool = premake.vs200x_vcproj_VCLinkerTool,
VCLinkerTool_GCC = premake.vs200x_vcproj_VCLinkerTool_GCC,
VCManifestTool = premake.vs200x_vcproj_VCManifestTool,
VCMIDLTool = premake.vs200x_vcproj_VCMIDLTool,
VCResourceCompilerTool = premake.vs200x_vcproj_VCResourceCompilerTool,
}
--
-- Return a list of sections for a particular Visual Studio version and target platform.
--
local function getsections(version, platform)
if version == "vs2002" then
return {
"VCCLCompilerTool",
"VCCustomBuildTool",
"VCLinkerTool",
"VCMIDLTool",
"VCPostBuildEventTool",
"VCPreBuildEventTool",
"VCPreLinkEventTool",
"VCResourceCompilerTool",
"VCWebServiceProxyGeneratorTool",
"VCWebDeploymentTool"
}
end
if version == "vs2003" then
return {
"VCCLCompilerTool",
"VCCustomBuildTool",
"VCLinkerTool",
"VCMIDLTool",
"VCPostBuildEventTool",
"VCPreBuildEventTool",
"VCPreLinkEventTool",
"VCResourceCompilerTool",
"VCWebServiceProxyGeneratorTool",
"VCXMLDataGeneratorTool",
"VCWebDeploymentTool",
"VCManagedWrapperGeneratorTool",
"VCAuxiliaryManagedWrapperGeneratorTool"
}
end
if platform == "Xbox360" then
return {
"VCPreBuildEventTool",
"VCCustomBuildTool",
"VCXMLDataGeneratorTool",
"VCWebServiceProxyGeneratorTool",
"VCMIDLTool",
"VCCLCompilerTool",
"VCManagedResourceCompilerTool",
"VCResourceCompilerTool",
"VCPreLinkEventTool",
"VCLinkerTool",
"VCALinkTool",
"VCX360ImageTool",
"VCBscMakeTool",
"VCX360DeploymentTool",
"VCPostBuildEventTool",
"DebuggerTool",
}
end
if platform == "PS3" then
return {
"VCPreBuildEventTool",
"VCCustomBuildTool",
"VCXMLDataGeneratorTool",
"VCWebServiceProxyGeneratorTool",
"VCMIDLTool",
"VCCLCompilerTool_GCC",
"VCManagedResourceCompilerTool",
"VCResourceCompilerTool",
"VCPreLinkEventTool",
"VCLinkerTool_GCC",
"VCALinkTool",
"VCManifestTool",
"VCXDCMakeTool",
"VCBscMakeTool",
"VCFxCopTool",
"VCAppVerifierTool",
"VCWebDeploymentTool",
"VCPostBuildEventTool"
}
else
return {
"VCPreBuildEventTool",
"VCCustomBuildTool",
"VCXMLDataGeneratorTool",
"VCWebServiceProxyGeneratorTool",
"VCMIDLTool",
"VCCLCompilerTool",
"VCManagedResourceCompilerTool",
"VCResourceCompilerTool",
"VCPreLinkEventTool",
"VCLinkerTool",
"VCALinkTool",
"VCManifestTool",
"VCXDCMakeTool",
"VCBscMakeTool",
"VCFxCopTool",
"VCAppVerifierTool",
"VCWebDeploymentTool",
"VCPostBuildEventTool"
}
end
end
--
-- The main function: write the project file.
--
function premake.vs200x_vcproj(prj)
io.eol = "\r\n"
_p('<?xml version="1.0" encoding="Windows-1252"?>')
-- Write opening project block
_p('<VisualStudioProject')
_p(1,'ProjectType="Visual C++"')
if _ACTION == "vs2002" then
_p(1,'Version="7.00"')
elseif _ACTION == "vs2003" then
_p(1,'Version="7.10"')
elseif _ACTION == "vs2005" then
_p(1,'Version="8.00"')
elseif _ACTION == "vs2008" then
_p(1,'Version="9.00"')
end
_p(1,'Name="%s"', premake.esc(prj.name))
_p(1,'ProjectGUID="{%s}"', prj.uuid)
if _ACTION > "vs2003" then
_p(1,'RootNamespace="%s"', prj.name)
end
_p(1,'Keyword="%s"', iif(prj.flags.Managed, "ManagedCProj", "Win32Proj"))
_p(1,'>')
-- list the target platforms
premake.vs200x_vcproj_platforms(prj)
if _ACTION > "vs2003" then
_p(1,'<ToolFiles>')
_p(1,'</ToolFiles>')
end
_p(1,'<Configurations>')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
if cfginfo.isreal then
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
-- Start a configuration
vcproj.Configuration(cfginfo.name, cfg)
for _, block in ipairs(getsections(_ACTION, cfginfo.src_platform)) do
if blockmap[block] then
blockmap[block](cfg)
-- Build event blocks --
elseif block == "VCPreBuildEventTool" then
premake.vs200x_vcproj_buildstepsblock("VCPreBuildEventTool", cfg.prebuildcommands)
elseif block == "VCPreLinkEventTool" then
premake.vs200x_vcproj_buildstepsblock("VCPreLinkEventTool", cfg.prelinkcommands)
elseif block == "VCPostBuildEventTool" then
premake.vs200x_vcproj_buildstepsblock("VCPostBuildEventTool", cfg.postbuildcommands)
-- End build event blocks --
-- Xbox 360 custom sections --
elseif block == "VCX360DeploymentTool" then
_p(3,'<Tool')
_p(4,'Name="VCX360DeploymentTool"')
_p(4,'DeploymentType="0"')
if #cfg.deploymentoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.deploymentoptions), " "))
end
_p(3,'/>')
elseif block == "VCX360ImageTool" then
_p(3,'<Tool')
_p(4,'Name="VCX360ImageTool"')
if #cfg.imageoptions > 0 then
_p(4,'AdditionalOptions="%s"', table.concat(premake.esc(cfg.imageoptions), " "))
end
if cfg.imagepath ~= nil then
_p(4,'OutputFileName="%s"', premake.esc(path.translate(cfg.imagepath)))
end
_p(3,'/>')
elseif block == "DebuggerTool" then
_p(3,'<DebuggerTool')
_p(3,'/>')
-- End Xbox 360 custom sections --
else
_p(3,'<Tool')
_p(4,'Name="%s"', block)
_p(3,'/>')
end
end
_p(2,'</Configuration>')
end
end
_p(1,'</Configurations>')
_p(1,'<References>')
_p(1,'</References>')
_p(1,'<Files>')
premake.walksources(prj, _VS.files)
_p(1,'</Files>')
_p(1,'<Globals>')
_p(1,'</Globals>')
_p('</VisualStudioProject>')
end

View File

@ -1,762 +0,0 @@
premake.vstudio.vs10_helpers = { }
local vs10_helpers = premake.vstudio.vs10_helpers
function vs10_helpers.remove_relative_path(file)
file = file:gsub("%.%./",'')
file = file:gsub("%./",'')
file = file:gsub("^source/",'')
return file
end
function vs10_helpers.file_path(file)
file = vs10_helpers.remove_relative_path(file)
local path = string.find(file,'/[%w%.%_%-]+$')
if path then
return string.sub(file,1,path-1)
else
return nil
end
end
function vs10_helpers.list_of_directories_in_path(path)
local list={}
path = vs10_helpers.remove_relative_path(path)
if path then
for dir in string.gmatch(path,"[%w%-%_%.]+/")do
if #list == 0 then
list[1] = dir:sub(1,#dir-1)
else
list[#list +1] = list[#list] .."/" ..dir:sub(1,#dir-1)
end
end
end
return list
end
function vs10_helpers.table_of_file_filters(files)
local filters ={}
for _, valueTable in pairs(files) do
for _, entry in ipairs(valueTable) do
local result = vs10_helpers.list_of_directories_in_path(entry)
for __,dir in ipairs(result) do
if table.contains(filters,dir) ~= true then
filters[#filters +1] = dir
end
end
end
end
return filters
end
function vs10_helpers.get_file_extension(file)
local ext_start,ext_end = string.find(file,"%.[%w_%-]+$")
if ext_start then
return string.sub(file,ext_start+1,ext_end)
end
end
function vs10_helpers.sort_input_files(files,sorted_container)
local types =
{
h = "ClInclude",
hpp = "ClInclude",
hxx = "ClInclude",
c = "ClCompile",
cpp = "ClCompile",
cxx = "ClCompile",
cc = "ClCompile",
rc = "ResourceCompile",
asm = "ClASM"
}
for _, current_file in ipairs(files) do
local ext = vs10_helpers.get_file_extension(current_file)
if ext then
local type = types[ext]
if type then
table.insert(sorted_container[type],current_file)
else
table.insert(sorted_container.None,current_file)
end
end
end
end
local function vs2010_config(prj)
_p(1,'<ItemGroup Label="ProjectConfigurations">')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
_p(2,'<ProjectConfiguration Include="%s">', premake.esc(cfginfo.name))
_p(3,'<Configuration>%s</Configuration>',cfginfo.buildcfg)
_p(3,'<Platform>%s</Platform>',cfginfo.platform)
_p(2,'</ProjectConfiguration>')
end
_p(1,'</ItemGroup>')
end
local function vs2010_globals(prj)
_p(1,'<PropertyGroup Label="Globals">')
_p(2,'<ProjectGuid>{%s}</ProjectGuid>',prj.uuid)
_p(2,'<RootNamespace>%s</RootNamespace>',prj.name)
_p(2,'<Keyword>Win32Proj</Keyword>')
if _ACTION == "vs2012" then
_p(2,[[<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>]])
end
_p(1,'</PropertyGroup>')
end
function vs10_helpers.config_type(config)
local t =
{
SharedLib = "DynamicLibrary",
StaticLib = "StaticLibrary",
ConsoleApp = "Application",
WindowedApp = "Application"
}
return t[config.kind]
end
local function if_config_and_platform()
return 'Condition="\'$(Configuration)|$(Platform)\'==\'%s\'"'
end
local function optimisation(cfg)
local result = "Disabled"
for _, value in ipairs(cfg.flags) do
if (value == "Optimize") then
result = "Full"
elseif (value == "OptimizeSize") then
result = "MinSpace"
elseif (value == "OptimizeSpeed") then
result = "MaxSpeed"
end
end
return result
end
local function config_type_block(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
_p(1,'<PropertyGroup '..if_config_and_platform() ..' Label="Configuration">'
, premake.esc(cfginfo.name))
_p(2,'<ConfigurationType>%s</ConfigurationType>',vs10_helpers.config_type(cfg))
_p(2,'<CharacterSet>%s</CharacterSet>',iif(cfg.flags.Unicode,"Unicode","MultiByte"))
_p(2,'<UseDebugLibraries>%s</UseDebugLibraries>'
,iif(optimisation(cfg) == "Disabled","true","false"))
if _ACTION == "vs2012" then
_p(2, '<PlatformToolset>v110_xp</PlatformToolset>')
elseif _ACTION == "vs2013" then
_p(2, '<PlatformToolset>v120_xp</PlatformToolset>')
end
if cfg.flags.MFC then
_p(2,'<UseOfMfc>Dynamic</UseOfMfc>')
end
_p(1,'</PropertyGroup>')
end
end
local function import_props(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
_p(1,'<ImportGroup '..if_config_and_platform() ..' Label="PropertySheets">'
,premake.esc(cfginfo.name))
_p(2,'<Import Project="$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" Condition="exists(\'$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\')" Label="LocalAppDataPlatform" />')
_p(1,'</ImportGroup>')
end
end
local function incremental_link(cfg,cfginfo)
if cfg.kind ~= "StaticLib" then
ShoudLinkIncrementally = 'false'
if optimisation(cfg) == "Disabled" then
ShoudLinkIncrementally = 'true'
end
_p(2,'<LinkIncremental '..if_config_and_platform() ..'>%s</LinkIncremental>'
,premake.esc(cfginfo.name),ShoudLinkIncrementally)
end
end
local function ignore_import_lib(cfg,cfginfo)
if cfg.kind == "SharedLib" then
local shouldIgnore = "false"
if cfg.flags.NoImportLib then shouldIgnore = "true" end
_p(2,'<IgnoreImportLibrary '..if_config_and_platform() ..'>%s</IgnoreImportLibrary>'
,premake.esc(cfginfo.name),shouldIgnore)
end
end
local function intermediate_and_out_dirs(prj)
_p(1,'<PropertyGroup>')
_p(2,'<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
_p(2,'<OutDir '..if_config_and_platform() ..'>%s\\</OutDir>'
, premake.esc(cfginfo.name),premake.esc(cfg.buildtarget.directory) )
_p(2,'<IntDir '..if_config_and_platform() ..'>%s\\</IntDir>'
, premake.esc(cfginfo.name), premake.esc(cfg.objectsdir))
_p(2,'<TargetName '..if_config_and_platform() ..'>%s</TargetName>'
,premake.esc(cfginfo.name),path.getbasename(cfg.buildtarget.name))
ignore_import_lib(cfg,cfginfo)
incremental_link(cfg,cfginfo)
if cfg.flags.NoManifest then
_p(2,'<GenerateManifest '..if_config_and_platform() ..'>false</GenerateManifest>'
,premake.esc(cfginfo.name))
end
end
_p(1,'</PropertyGroup>')
end
local function runtime(cfg)
local runtime
if premake.config.isdebugbuild(cfg) then
runtime = iif(cfg.flags.StaticRuntime,"MultiThreadedDebug", "MultiThreadedDebugDLL")
else
runtime = iif(cfg.flags.StaticRuntime, "MultiThreaded", "MultiThreadedDLL")
end
return runtime
end
local function precompiled_header(cfg)
if not cfg.flags.NoPCH and cfg.pchheader then
_p(3,'<PrecompiledHeader>Use</PrecompiledHeader>')
_p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', path.getname(cfg.pchheader))
else
_p(3,'<PrecompiledHeader></PrecompiledHeader>')
end
end
local function preprocessor(indent,cfg)
if #cfg.defines > 0 then
_p(indent,'<PreprocessorDefinitions>%s;%%(PreprocessorDefinitions)</PreprocessorDefinitions>'
,premake.esc(table.concat(cfg.defines, ";")))
else
_p(indent,'<PreprocessorDefinitions></PreprocessorDefinitions>')
end
end
local function include_dirs(indent,cfg)
if #cfg.includedirs > 0 then
_p(indent,'<AdditionalIncludeDirectories>%s;%%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>'
,premake.esc(path.translate(table.concat(cfg.includedirs, ";"), '\\')))
end
end
local function resource_compile(cfg)
_p(2,'<ResourceCompile>')
preprocessor(3,cfg)
include_dirs(3,cfg)
_p(2,'</ResourceCompile>')
end
local function exceptions(cfg)
if cfg.flags.NoExceptions then
_p(2,'<ExceptionHandling>false</ExceptionHandling>')
elseif cfg.flags.SEH then
_p(2,'<ExceptionHandling>Async</ExceptionHandling>')
end
end
local function rtti(cfg)
if cfg.flags.NoRTTI then
_p(3,'<RuntimeTypeInfo>false</RuntimeTypeInfo>')
end
end
local function wchar_t_buildin(cfg)
if cfg.flags.NativeWChar then
_p(3,'<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>')
elseif cfg.flags.NoNativeWChar then
_p(3,'<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>')
end
end
local function sse(cfg)
if cfg.flags.EnableSSE then
_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>')
elseif cfg.flags.EnableSSE2 then
_p(3,'<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>')
end
end
local function floating_point(cfg)
if cfg.flags.FloatFast then
_p(3,'<FloatingPointModel>Fast</FloatingPointModel>')
elseif cfg.flags.FloatStrict then
_p(3,'<FloatingPointModel>Strict</FloatingPointModel>')
end
end
local function debug_info(cfg)
--
-- EditAndContinue /ZI
-- ProgramDatabase /Zi
-- OldStyle C7 Compatable /Z7
--
local debug_info = ''
if cfg.flags.Symbols then
if optimisation(cfg) ~= "Disabled" or cfg.flags.NoEditAndContinue then
debug_info = "ProgramDatabase"
elseif cfg.platform ~= "x64" then
debug_info = "EditAndContinue"
else
debug_info = "OldStyle"
end
end
_p(3,'<DebugInformationFormat>%s</DebugInformationFormat>',debug_info)
end
local function minimal_build(cfg)
if premake.config.isdebugbuild(cfg) and not cfg.flags.NoMinimalRebuild then
_p(3,'<MinimalRebuild>true</MinimalRebuild>')
else
_p(3,'<MinimalRebuild>false</MinimalRebuild>')
end
end
local function compile_language(cfg)
if cfg.language == "C" then
_p(3,'<CompileAs>CompileAsC</CompileAs>')
end
end
local function vs10_clcompile(cfg)
_p(2,'<ClCompile>')
if #cfg.buildoptions > 0 then
_p(3,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',
table.concat(premake.esc(cfg.buildoptions), " "))
end
_p(3,'<Optimization>%s</Optimization>',optimisation(cfg))
include_dirs(3,cfg)
preprocessor(3,cfg)
minimal_build(cfg)
if optimisation(cfg) == "Disabled" then
_p(3,'<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>')
if cfg.flags.ExtraWarnings then
_p(3,'<SmallerTypeCheck>true</SmallerTypeCheck>')
end
else
_p(3,'<StringPooling>true</StringPooling>')
end
_p(3,'<RuntimeLibrary>%s</RuntimeLibrary>', runtime(cfg))
_p(3,'<FunctionLevelLinking>true</FunctionLevelLinking>')
precompiled_header(cfg)
if cfg.flags.ExtraWarnings then
_p(3,'<WarningLevel>Level4</WarningLevel>')
else
_p(3,'<WarningLevel>Level3</WarningLevel>')
end
if cfg.flags.FatalWarnings then
_p(3,'<TreatWarningAsError>true</TreatWarningAsError>')
end
exceptions(cfg)
rtti(cfg)
wchar_t_buildin(cfg)
sse(cfg)
floating_point(cfg)
debug_info(cfg)
if cfg.flags.NoFramePointer then
_p(3,'<OmitFramePointers>true</OmitFramePointers>')
end
compile_language(cfg)
_p(2,'</ClCompile>')
end
local function event_hooks(cfg, prj)
if #cfg.postbuildcommands> 0 then
_p(2,'<PostBuildEvent>')
_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, "", "", "\r\n")))
_p(2,'</PostBuildEvent>')
end
if #cfg.prebuildcommands> 0 or prj.cxxtestrootfile then
_p(2,'<PreBuildEvent>')
_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, "", "", "\r\n")))
-- test generation only works if all required parameters are set!
if(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then
local cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),"\\")
local cxxtestrootfile = path.translate(prj.cxxtestrootfile,"\\")
_p(3,'<Command>%s --root %s &gt; %s</Command>', cxxtestpath, prj.cxxtestrootoptions, cxxtestrootfile)
end
_p(2,'</PreBuildEvent>')
end
if #cfg.prelinkcommands> 0 then
_p(2,'<PreLinkEvent>')
_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, "", "", "\r\n")))
_p(2,'</PreLinkEvent>')
end
end
local function additional_options(indent,cfg)
if #cfg.linkoptions > 0 then
_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',
table.concat(premake.esc(cfg.linkoptions), " "))
end
end
local function item_def_lib(cfg)
if cfg.kind == 'StaticLib' then
_p(1,'<Lib>')
_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)
additional_options(2,cfg)
_p(1,'</Lib>')
end
end
local function link_target_machine(cfg)
local target
if cfg.platform == nil or cfg.platform == "x32" then target ="MachineX86"
elseif cfg.platform == "x64" then target ="MachineX64"
end
_p(3,'<TargetMachine>%s</TargetMachine>', target)
end
local function import_lib(cfg)
--Prevent the generation of an import library for a Windows DLL.
if cfg.kind == "SharedLib" then
local implibname = cfg.linktarget.fullpath
_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. "\\" .. path.getname(implibname), implibname))
end
end
local function common_link_section(cfg)
_p(3,'<SubSystem>%s</SubSystem>',iif(cfg.kind == "ConsoleApp","Console", "Windows"))
if cfg.flags.Symbols then
_p(3,'<GenerateDebugInformation>true</GenerateDebugInformation>')
else
_p(3,'<GenerateDebugInformation>false</GenerateDebugInformation>')
end
if optimisation(cfg) ~= "Disabled" then
_p(3,'<OptimizeReferences>true</OptimizeReferences>')
_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')
end
if cfg.flags.Symbols then
_p(3,'<ProgramDataBaseFileName>$(OutDir)%s.pdb</ProgramDataBaseFileName>'
, path.getbasename(cfg.buildtarget.name))
end
end
local function item_link(cfg)
_p(2,'<Link>')
if cfg.kind ~= 'StaticLib' then
if #cfg.links > 0 then
_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',
table.concat(premake.getlinks(cfg, "all", "fullpath"), ";"))
end
_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)
_p(3,'<AdditionalLibraryDirectories>%s%s%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',
table.concat(premake.esc(path.translate(cfg.libdirs, '\\')) , ";"),
iif(cfg.libdirs and #cfg.libdirs >0,';',''))
common_link_section(cfg)
if vs10_helpers.config_type(cfg) == 'Application' and not cfg.flags.WinMain then
_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')
end
import_lib(cfg)
_p(3,'<TargetMachine>%s</TargetMachine>', iif(cfg.platform == "x64", "MachineX64", "MachineX86"))
additional_options(3,cfg)
else
common_link_section(cfg)
end
_p(2,'</Link>')
end
local function item_definitions(prj)
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'
,premake.esc(cfginfo.name))
vs10_clcompile(cfg)
resource_compile(cfg)
item_def_lib(cfg)
item_link(cfg)
event_hooks(cfg, prj)
_p(1,'</ItemDefinitionGroup>')
end
end
--
-- <ItemGroup>
-- <ProjectReference Include="zlibvc.vcxproj">
-- <Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
-- </ProjectReference>
-- </ItemGroup>
local function write_cxxtestgen_block(prj)
-- test generation only works if all required parameters are set!
if(prj.solution.cxxtestpath and prj.cxxtestrootfile and prj.cxxtesthdrfiles and prj.cxxtestsrcfiles) then
local cxxtestpath = path.translate(path.getrelative(prj.location, prj.solution.cxxtestpath),"\\")
_p(1,'<ItemGroup>')
for i, file in ipairs(prj.cxxtesthdrfiles) do
local cxxtesthdrfile = path.translate(file,"\\")
local cxxtestsrcfile = path.translate(prj.cxxtestsrcfiles[i],"\\")
_p(2,'<CustomBuild Include=\"%s\">', cxxtesthdrfile)
_p(3,'<Message>Generating %s</Message>', path.getname(prj.cxxtestsrcfiles[i]))
_p(3,'<Command>%s --part %s -o \"%s\" \"%s\"</Command>',
cxxtestpath, prj.cxxtestoptions, cxxtestsrcfile, cxxtesthdrfile)
_p(3,'<Outputs>%s;%%(Outputs)</Outputs>', cxxtestsrcfile)
_p(2,'</CustomBuild>')
end
_p(1,'</ItemGroup>')
end
end
local function write_file_type_block(files,group_type)
if #files > 0 then
_p(1,'<ItemGroup>')
for _, current_file in ipairs(files) do
_p(2,'<%s Include=\"%s\" />', group_type,path.translate(current_file,"\\"))
end
_p(1,'</ItemGroup>')
end
end
local function write_file_compile_block(files,prj,configs)
if #files > 0 then
local config_mappings = {}
for _, cfginfo in ipairs(configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
if cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then
config_mappings[cfginfo] = cfg.pchsource
end
end
_p(1,'<ItemGroup>')
for _, current_file in ipairs(files) do
_p(2,'<ClCompile Include=\"%s\">', path.translate(current_file, "\\"))
for _, cfginfo in ipairs(configs) do
if config_mappings[cfginfo] and current_file == config_mappings[cfginfo] then
_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>'
,premake.esc(cfginfo.name))
--only one source file per pch
config_mappings[cfginfo] = nil
end
end
_p(2,'</ClCompile>')
end
_p(1,'</ItemGroup>')
end
end
local function write_nasm_asm_block(files, prj, configs)
-- set defaults if required parameters are not set
if not (prj.solution.nasmformat) then
prj.solution.nasmformat = 'win32'
end
if not (prj.solution.nasmpath) then
prj.solution.nasmpath = 'nasm'
end
if #files > 0 then
_p(1,'<ItemGroup>')
local nasmpath = path.translate(path.getrelative(prj.location, prj.solution.nasmpath),"\\")
for _, current_file in ipairs(files) do
_p(2,'<CustomBuild Include=\"%s\">', path.translate(current_file,"\\"))
_p(3,'<Message>Assembling %%(FullPath)</Message>')
_p(3,'<Command>%s -i %s -f %s \"%%(FullPath)\" -o \"$(IntDir)%%(Filename).obj\"</Command>',
nasmpath,
path.translate(path.getdirectory(current_file),"\\").."\\",
prj.solution.nasmformat)
_p(3,'<Outputs>$(IntDir)%%(Filename).obj;%%(Outputs)</Outputs>')
_p(2,'</CustomBuild>')
end
_p(1,'</ItemGroup>')
end
end
local function vcxproj_files(prj)
local sorted =
{
ClCompile ={},
ClInclude ={},
ClASM ={},
None ={},
ResourceCompile ={}
}
cfg = premake.getconfig(prj)
vs10_helpers.sort_input_files(cfg.files,sorted)
write_cxxtestgen_block(prj)
write_file_type_block(sorted.ClInclude,"ClInclude")
write_file_compile_block(sorted.ClCompile,prj,prj.solution.vstudio_configs)
write_nasm_asm_block(sorted.ClASM, prj, prj.solution.vstudion_configs)
write_file_type_block(sorted.None,'None')
write_file_type_block(sorted.ResourceCompile,'ResourceCompile')
end
local function write_filter_includes(sorted_table)
local directories = vs10_helpers.table_of_file_filters(sorted_table)
--I am going to take a punt here that the ItemGroup is missing if no files!!!!
--there is a test for this see
--vs10_filters.noInputFiles_bufferDoesNotContainTagItemGroup
if #directories >0 then
_p(1,'<ItemGroup>')
for _, dir in pairs(directories) do
_p(2,'<Filter Include="%s">',path.translate(dir,"\\"))
_p(3,'<UniqueIdentifier>{%s}</UniqueIdentifier>',os.uuid())
_p(2,'</Filter>')
end
_p(1,'</ItemGroup>')
end
end
local function write_file_filter_block(files,group_type)
if #files > 0 then
_p(1,'<ItemGroup>')
for _, current_file in ipairs(files) do
local path_to_file = vs10_helpers.file_path(current_file)
if path_to_file then
_p(2,'<%s Include=\"%s\">', group_type,path.translate(current_file, "\\"))
_p(3,'<Filter>%s</Filter>',path.translate(path_to_file,"\\"))
_p(2,'</%s>',group_type)
else
_p(2,'<%s Include=\"%s\" />', group_type,path.translate(current_file, "\\"))
end
end
_p(1,'</ItemGroup>')
end
end
local tool_version_and_xmlns = 'ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"'
local xml_version_and_encoding = '<?xml version="1.0" encoding="utf-8"?>'
local function vcxproj_filter_files(prj)
local sorted =
{
ClCompile ={},
ClInclude ={},
ClASM ={},
None ={},
ResourceCompile ={}
}
cfg = premake.getconfig(prj)
vs10_helpers.sort_input_files(cfg.files,sorted)
io.eol = "\r\n"
_p(xml_version_and_encoding)
_p('<Project ' ..tool_version_and_xmlns ..'>')
write_filter_includes(sorted)
write_file_filter_block(sorted.ClInclude,"ClInclude")
write_file_filter_block(sorted.ClCompile,"ClCompile")
write_file_filter_block(prj.cxxtesthdrfiles,"CustomBuild")
write_file_filter_block(sorted.ClASM,"ClASM")
write_file_filter_block(sorted.None,"None")
write_file_filter_block(sorted.ResourceCompile,"ResourceCompile")
_p('</Project>')
end
function premake.vs2010_vcxproj(prj)
io.eol = "\r\n"
_p(xml_version_and_encoding)
_p('<Project DefaultTargets="Build" ' ..tool_version_and_xmlns ..'>')
vs2010_config(prj)
vs2010_globals(prj)
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.Default.props" />')
config_type_block(prj)
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props" />')
--check what this section is doing
_p(1,'<ImportGroup Label="ExtensionSettings">')
_p(1,'</ImportGroup>')
import_props(prj)
--what type of macros are these?
_p(1,'<PropertyGroup Label="UserMacros" />')
intermediate_and_out_dirs(prj)
item_definitions(prj)
vcxproj_files(prj)
_p(1,'<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />')
_p(1,'<ImportGroup Label="ExtensionTargets">')
_p(1,'</ImportGroup>')
_p('</Project>')
end
function premake.vs2010_vcxproj_user(prj)
_p(xml_version_and_encoding)
_p('<Project ' ..tool_version_and_xmlns ..'>')
for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
if cfg.flags.NoDebugHeap then
_p(1,'<PropertyGroup Condition="\'$(Configuration)|$(Platform)\'==\'%s\'">', premake.esc(cfginfo.name))
_p(2,'<LocalDebuggerEnvironment>_NO_DEBUG_HEAP=1</LocalDebuggerEnvironment>')
_p(1,'</PropertyGroup>')
end
end
_p('</Project>')
end
function premake.vs2010_vcxproj_filters(prj)
vcxproj_filter_files(prj)
end

View File

@ -1,70 +0,0 @@
local vs_format_version = function()
local t =
{
vs2005 = '9.00',
vs2008 = '10.00',
vs2010 = '11.00',
vs2012 = '12.00',
vs2013 = '13.00'
}
return t[_ACTION]
end
local vs_version = function()
local t =
{
vs2005 = '2005',
vs2008 = '2008',
vs2010 = '2010',
vs2012 = '2012',
vs2013 = '2013'
}
return t[_ACTION]
end
local vs_write_version_info = function()
_p('Microsoft Visual Studio Solution File, Format Version %s', vs_format_version())
_p('# Visual Studio %s', vs_version() )
end
local vs_write_projects = function(sln)
-- Write out the list of project entries
for prj in premake.solution.eachproject(sln) do
-- Build a relative path from the solution file to the project file
local projpath = path.translate(path.getrelative(sln.location, _VS.projectfile(prj)), "\\")
_p('Project("{%s}") = "%s", "%s", "{%s}"', _VS.tool(prj), prj.name, projpath, prj.uuid)
local deps = premake.getdependencies(prj)
if #deps > 0 then
_p('\tProjectSection(ProjectDependencies) = postProject')
for _, dep in ipairs(deps) do
_p('\t\t{%s} = {%s}', dep.uuid, dep.uuid)
end
_p('\tEndProjectSection')
end
_p('EndProject')
end
end
local vs_write_pre_version = function(sln)
io.eol = '\r\n'
sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
-- Mark the file as Unicode
_p('\239\187\191')
end
function premake.vs_generic_solution(sln)
vs_write_pre_version(sln)
vs_write_version_info()
vs_write_projects(sln)
_p('Global')
premake.vs2005_solution_platforms(sln)
premake.vs2005_solution_project_platforms(sln)
premake.vs2005_solution_properties(sln)
_p('EndGlobal')
end

View File

@ -1,111 +0,0 @@
--
-- _xcode.lua
-- Define the Apple XCode action and support functions.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
premake.xcode = { }
newaction
{
trigger = "xcode3",
shortname = "Xcode 3",
description = "Generate Apple Xcode 3 project files (experimental)",
os = "macosx",
valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "gcc" },
},
valid_platforms = {
Native = "Native",
x32 = "Native 32-bit",
x64 = "Native 64-bit",
Universal32 = "32-bit Universal",
Universal64 = "64-bit Universal",
Universal = "Universal",
},
default_platform = "Universal",
onsolution = function(sln)
-- Assign IDs needed for inter-project dependencies
premake.xcode.preparesolution(sln)
end,
onproject = function(prj)
premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project)
end,
oncleanproject = function(prj)
premake.clean.directory(prj, "%%.xcodeproj")
end,
oncheckproject = function(prj)
-- Xcode can't mix target kinds within a project
local last
for cfg in premake.eachconfig(prj) do
if last and last ~= cfg.kind then
error("Project '" .. prj.name .. "' uses more than one target kind; not supported by Xcode", 0)
end
last = cfg.kind
end
end,
}
newaction
{
trigger = "xcode4",
shortname = "Xcode 4",
description = "Generate Apple Xcode 4 project files (experimental)",
os = "macosx",
valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" },
valid_languages = { "C", "C++" },
valid_tools = {
cc = { "gcc" },
},
valid_platforms = {
Native = "Native",
x32 = "Native 32-bit",
x64 = "Native 64-bit",
Universal32 = "32-bit Universal",
Universal64 = "64-bit Universal",
Universal = "Universal",
},
default_platform = "Universal",
onsolution = function(sln)
premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", premake.xcode4.workspace_generate)
end,
onproject = function(prj)
premake.generate(prj, "%%.xcodeproj/project.pbxproj", premake.xcode.project)
end,
oncleanproject = function(prj)
premake.clean.directory(prj, "%%.xcodeproj")
premake.clean.directory(prj, "%%.xcworkspace")
end,
oncheckproject = function(prj)
-- Xcode can't mix target kinds within a project
local last
for cfg in premake.eachconfig(prj) do
if last and last ~= cfg.kind then
error("Project '" .. prj.name .. "' uses more than one target kind; not supported by Xcode", 0)
end
last = cfg.kind
end
end,
}

View File

@ -1,40 +0,0 @@
premake.xcode4 = {}
local xcode4 = premake.xcode4
function xcode4.workspace_head()
_p('<?xml version="1.0" encoding="UTF-8"?>')
_p('<Workspace')
_p(1,'version = "1.0">')
end
function xcode4.workspace_tail()
_p('</Workspace>')
end
function xcode4.workspace_file_ref(prj)
local projpath = path.getrelative(prj.solution.location, prj.location)
if projpath == '.' then projpath = ''
else projpath = projpath ..'/'
end
_p(1,'<FileRef')
_p(2,'location = "group:%s">',projpath .. prj.name .. '.xcodeproj')
_p(1,'</FileRef>')
end
function xcode4.workspace_generate(sln)
premake.xcode.preparesolution(sln)
xcode4.workspace_head()
for prj in premake.solution.eachproject(sln) do
xcode4.workspace_file_ref(prj)
end
xcode4.workspace_tail()
end

View File

@ -1,885 +0,0 @@
--
-- xcode_common.lua
-- Functions to generate the different sections of an Xcode project.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
local xcode = premake.xcode
local tree = premake.tree
--
-- Return the Xcode build category for a given file, based on the file extension.
--
-- @param node
-- The node to identify.
-- @returns
-- An Xcode build category, one of "Sources", "Resources", "Frameworks", or nil.
--
function xcode.getbuildcategory(node)
local categories = {
[".a"] = "Frameworks",
[".c"] = "Sources",
[".cc"] = "Sources",
[".cpp"] = "Sources",
[".cxx"] = "Sources",
[".dylib"] = "Frameworks",
[".framework"] = "Frameworks",
[".m"] = "Sources",
[".mm"] = "Sources",
[".strings"] = "Resources",
[".nib"] = "Resources",
[".xib"] = "Resources",
[".icns"] = "Resources",
}
return categories[path.getextension(node.name)]
end
--
-- Return the displayed name for a build configuration, taking into account the
-- configuration and platform, i.e. "Debug 32-bit Universal".
--
-- @param cfg
-- The configuration being identified.
-- @returns
-- A build configuration name.
--
function xcode.getconfigname(cfg)
local name = cfg.name
if #cfg.project.solution.xcode.platforms > 1 then
name = name .. " " .. premake.action.current().valid_platforms[cfg.platform]
end
return name
end
--
-- Return the Xcode type for a given file, based on the file extension.
--
-- @param fname
-- The file name to identify.
-- @returns
-- An Xcode file type, string.
--
function xcode.getfiletype(node)
local types = {
[".c"] = "sourcecode.c.c",
[".cc"] = "sourcecode.cpp.cpp",
[".cpp"] = "sourcecode.cpp.cpp",
[".css"] = "text.css",
[".cxx"] = "sourcecode.cpp.cpp",
[".framework"] = "wrapper.framework",
[".gif"] = "image.gif",
[".h"] = "sourcecode.c.h",
[".html"] = "text.html",
[".lua"] = "sourcecode.lua",
[".m"] = "sourcecode.c.objc",
[".mm"] = "sourcecode.cpp.objc",
[".nib"] = "wrapper.nib",
[".pch"] = "sourcecode.c.h",
[".plist"] = "text.plist.xml",
[".strings"] = "text.plist.strings",
[".xib"] = "file.xib",
[".icns"] = "image.icns",
}
return types[path.getextension(node.path)] or "text"
end
--
-- Return the Xcode product type, based target kind.
--
-- @param node
-- The product node to identify.
-- @returns
-- An Xcode product type, string.
--
function xcode.getproducttype(node)
local types = {
ConsoleApp = "com.apple.product-type.tool",
WindowedApp = "com.apple.product-type.application",
StaticLib = "com.apple.product-type.library.static",
SharedLib = "com.apple.product-type.library.dynamic",
}
return types[node.cfg.kind]
end
--
-- Return the Xcode target type, based on the target file extension.
--
-- @param node
-- The product node to identify.
-- @returns
-- An Xcode target type, string.
--
function xcode.gettargettype(node)
local types = {
ConsoleApp = "\"compiled.mach-o.executable\"",
WindowedApp = "wrapper.application",
StaticLib = "archive.ar",
SharedLib = "\"compiled.mach-o.dylib\"",
}
return types[node.cfg.kind]
end
--
-- Return a unique file name for a project. Since Xcode uses .xcodeproj's to
-- represent both solutions and projects there is a likely change of a name
-- collision. Tack on a number to differentiate them.
--
-- @param prj
-- The project being queried.
-- @returns
-- A uniqued file name
--
function xcode.getxcodeprojname(prj)
-- if there is a solution with matching name, then use "projectname1.xcodeproj"
-- just get something working for now
local fname = premake.project.getfilename(prj, "%%.xcodeproj")
return fname
end
--
-- Returns true if the file name represents a framework.
--
-- @param fname
-- The name of the file to test.
--
function xcode.isframework(fname)
return (path.getextension(fname) == ".framework")
end
--
-- Retrieves a unique 12 byte ID for an object. This function accepts and ignores two
-- parameters 'node' and 'usage', which are used by an alternative implementation of
-- this function for testing.
--
-- @returns
-- A 24-character string representing the 12 byte ID.
--
function xcode.newid()
return string.format("%04X%04X%04X%04X%04X%04X",
math.random(0, 32767),
math.random(0, 32767),
math.random(0, 32767),
math.random(0, 32767),
math.random(0, 32767),
math.random(0, 32767))
end
--
-- Create a product tree node and all projects in a solution; assigning IDs
-- that are needed for inter-project dependencies.
--
-- @param sln
-- The solution to prepare.
--
function xcode.preparesolution(sln)
-- create and cache a list of supported platforms
sln.xcode = { }
sln.xcode.platforms = premake.filterplatforms(sln, premake.action.current().valid_platforms, "Universal")
for prj in premake.solution.eachproject(sln) do
-- need a configuration to get the target information
local cfg = premake.getconfig(prj, prj.configurations[1], sln.xcode.platforms[1])
-- build the product tree node
local node = premake.tree.new(path.getname(cfg.buildtarget.bundlepath))
node.cfg = cfg
node.id = premake.xcode.newid(node, "product")
node.targetid = premake.xcode.newid(node, "target")
-- attach it to the project
prj.xcode = {}
prj.xcode.projectnode = node
end
end
--
-- Print out a list value in the Xcode format.
--
-- @param list
-- The list of values to be printed.
-- @param tag
-- The Xcode specific list tag.
--
function xcode.printlist(list, tag)
if #list > 0 then
_p(4,'%s = (', tag)
for _, item in ipairs(list) do
_p(5, '"%s",', item)
end
_p(4,');')
end
end
---------------------------------------------------------------------------
-- Section generator functions, in the same order in which they appear
-- in the .pbxproj file
---------------------------------------------------------------------------
function xcode.Header()
_p('// !$*UTF8*$!')
_p('{')
_p(1,'archiveVersion = 1;')
_p(1,'classes = {')
_p(1,'};')
_p(1,'objectVersion = 45;')
_p(1,'objects = {')
_p('')
end
function xcode.PBXBuildFile(tr)
_p('/* Begin PBXBuildFile section */')
tree.traverse(tr, {
onnode = function(node)
if node.buildid then
_p(2,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',
node.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)
end
end
})
_p('/* End PBXBuildFile section */')
_p('')
end
function xcode.PBXContainerItemProxy(tr)
if #tr.projects.children > 0 then
_p('/* Begin PBXContainerItemProxy section */')
for _, node in ipairs(tr.projects.children) do
_p(2,'%s /* PBXContainerItemProxy */ = {', node.productproxyid)
_p(3,'isa = PBXContainerItemProxy;')
_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))
_p(3,'proxyType = 2;')
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)
_p(3,'remoteInfo = "%s";', node.project.xcode.projectnode.name)
_p(2,'};')
_p(2,'%s /* PBXContainerItemProxy */ = {', node.targetproxyid)
_p(3,'isa = PBXContainerItemProxy;')
_p(3,'containerPortal = %s /* %s */;', node.id, path.getname(node.path))
_p(3,'proxyType = 1;')
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)
_p(3,'remoteInfo = "%s";', node.project.xcode.projectnode.name)
_p(2,'};')
end
_p('/* End PBXContainerItemProxy section */')
_p('')
end
end
function xcode.PBXFileReference(tr)
_p('/* Begin PBXFileReference section */')
tree.traverse(tr, {
onleaf = function(node)
-- I'm only listing files here, so ignore anything without a path
if not node.path then
return
end
-- is this the product node, describing the output target?
if node.kind == "product" then
_p(2,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = "%s"; path = "%s"; sourceTree = BUILT_PRODUCTS_DIR; };',
node.id, node.name, xcode.gettargettype(node), node.name, path.getname(node.cfg.buildtarget.bundlepath))
-- is this a project dependency?
elseif node.parent.parent == tr.projects then
local relpath = path.getrelative(tr.project.location, node.parent.project.location)
_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "%s"; path = "%s"; sourceTree = SOURCE_ROOT; };',
node.parent.id, node.parent.name, node.parent.name, path.join(relpath, node.parent.name))
-- something else
else
local pth, src
if xcode.isframework(node.path) then
--respect user supplied paths
if string.find(node.path,'/') then
if string.find(node.path,'^%.')then
error('relative paths are not currently supported for frameworks')
end
pth = node.path
else
pth = "/System/Library/Frameworks/" .. node.path
end
src = "absolute"
else
-- something else; probably a source code file
src = "group"
-- if the parent node is virtual, it won't have a local path
-- of its own; need to use full relative path from project
if node.parent.isvpath then
pth = node.cfg.name
else
pth = tree.getlocalpath(node)
end
end
_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = "%s"; path = "%s"; sourceTree = "<%s>"; };',
node.id, node.name, xcode.getfiletype(node), node.name, pth, src)
end
end
})
_p('/* End PBXFileReference section */')
_p('')
end
function xcode.PBXFrameworksBuildPhase(tr)
_p('/* Begin PBXFrameworksBuildPhase section */')
_p(2,'%s /* Frameworks */ = {', tr.products.children[1].fxstageid)
_p(3,'isa = PBXFrameworksBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
-- write out library dependencies
tree.traverse(tr.frameworks, {
onleaf = function(node)
_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)
end
})
-- write out project dependencies
tree.traverse(tr.projects, {
onleaf = function(node)
_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)
end
})
_p(3,');')
_p(3,'runOnlyForDeploymentPostprocessing = 0;')
_p(2,'};')
_p('/* End PBXFrameworksBuildPhase section */')
_p('')
end
function xcode.PBXGroup(tr)
_p('/* Begin PBXGroup section */')
tree.traverse(tr, {
onnode = function(node)
-- Skip over anything that isn't a proper group
if (node.path and #node.children == 0) or node.kind == "vgroup" then
return
end
-- project references get special treatment
if node.parent == tr.projects then
_p(2,'%s /* Products */ = {', node.productgroupid)
else
_p(2,'%s /* %s */ = {', node.id, node.name)
end
_p(3,'isa = PBXGroup;')
_p(3,'children = (')
for _, childnode in ipairs(node.children) do
_p(4,'%s /* %s */,', childnode.id, childnode.name)
end
_p(3,');')
if node.parent == tr.projects then
_p(3,'name = Products;')
else
_p(3,'name = "%s";', node.name)
if node.path and not node.isvpath then
local p = node.path
if node.parent.path then
p = path.getrelative(node.parent.path, node.path)
end
_p(3,'path = "%s";', p)
end
end
_p(3,'sourceTree = "<group>";')
_p(2,'};')
end
}, true)
_p('/* End PBXGroup section */')
_p('')
end
function xcode.PBXNativeTarget(tr)
_p('/* Begin PBXNativeTarget section */')
for _, node in ipairs(tr.products.children) do
local name = tr.project.name
_p(2,'%s /* %s */ = {', node.targetid, name)
_p(3,'isa = PBXNativeTarget;')
_p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;', node.cfgsection, name)
_p(3,'buildPhases = (')
if #tr.project.prebuildcommands > 0 then
_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')
end
_p(4,'%s /* Resources */,', node.resstageid)
_p(4,'%s /* Sources */,', node.sourcesid)
if #tr.project.prelinkcommands > 0 then
_p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,')
end
_p(4,'%s /* Frameworks */,', node.fxstageid)
if #tr.project.postbuildcommands > 0 then
_p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,')
end
_p(3,');')
_p(3,'buildRules = (')
_p(3,');')
_p(3,'dependencies = (')
for _, node in ipairs(tr.projects.children) do
_p(4,'%s /* PBXTargetDependency */,', node.targetdependid)
end
_p(3,');')
_p(3,'name = "%s";', name)
local p
if node.cfg.kind == "ConsoleApp" then
p = "$(HOME)/bin"
elseif node.cfg.kind == "WindowedApp" then
p = "$(HOME)/Applications"
end
if p then
_p(3,'productInstallPath = "%s";', p)
end
_p(3,'productName = "%s";', name)
_p(3,'productReference = %s /* %s */;', node.id, node.name)
_p(3,'productType = "%s";', xcode.getproducttype(node))
_p(2,'};')
end
_p('/* End PBXNativeTarget section */')
_p('')
end
function xcode.PBXProject(tr)
_p('/* Begin PBXProject section */')
_p(2,'08FB7793FE84155DC02AAC07 /* Project object */ = {')
_p(3,'isa = PBXProject;')
_p(3,'buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "%s" */;', tr.name)
_p(3,'compatibilityVersion = "Xcode 3.2";')
_p(3,'hasScannedForEncodings = 1;')
_p(3,'mainGroup = %s /* %s */;', tr.id, tr.name)
_p(3,'projectDirPath = "";')
if #tr.projects.children > 0 then
_p(3,'projectReferences = (')
for _, node in ipairs(tr.projects.children) do
_p(4,'{')
_p(5,'ProductGroup = %s /* Products */;', node.productgroupid)
_p(5,'ProjectRef = %s /* %s */;', node.id, path.getname(node.path))
_p(4,'},')
end
_p(3,');')
end
_p(3,'projectRoot = "";')
_p(3,'targets = (')
for _, node in ipairs(tr.products.children) do
_p(4,'%s /* %s */,', node.targetid, node.name)
end
_p(3,');')
_p(2,'};')
_p('/* End PBXProject section */')
_p('')
end
function xcode.PBXReferenceProxy(tr)
if #tr.projects.children > 0 then
_p('/* Begin PBXReferenceProxy section */')
tree.traverse(tr.projects, {
onleaf = function(node)
_p(2,'%s /* %s */ = {', node.id, node.name)
_p(3,'isa = PBXReferenceProxy;')
_p(3,'fileType = %s;', xcode.gettargettype(node))
_p(3,'path = "%s";', node.path)
_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)
_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')
_p(2,'};')
end
})
_p('/* End PBXReferenceProxy section */')
_p('')
end
end
function xcode.PBXResourcesBuildPhase(tr)
_p('/* Begin PBXResourcesBuildPhase section */')
for _, target in ipairs(tr.products.children) do
_p(2,'%s /* Resources */ = {', target.resstageid)
_p(3,'isa = PBXResourcesBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
tree.traverse(tr, {
onnode = function(node)
if xcode.getbuildcategory(node) == "Resources" then
_p(4,'%s /* %s in Resources */,', node.buildid, node.name)
end
end
})
_p(3,');')
_p(3,'runOnlyForDeploymentPostprocessing = 0;')
_p(2,'};')
end
_p('/* End PBXResourcesBuildPhase section */')
_p('')
end
function xcode.PBXShellScriptBuildPhase(tr)
local wrapperWritten = false
local function doblock(id, name, which)
-- start with the project-level commands (most common)
local prjcmds = tr.project[which]
local commands = table.join(prjcmds, {})
-- see if there are any config-specific commands to add
for _, cfg in ipairs(tr.configs) do
local cfgcmds = cfg[which]
if #cfgcmds > #prjcmds then
table.insert(commands, 'if [ "${CONFIGURATION}" = "' .. xcode.getconfigname(cfg) .. '" ]; then')
for i = #prjcmds + 1, #cfgcmds do
table.insert(commands, cfgcmds[i])
end
table.insert(commands, 'fi')
end
end
if #commands > 0 then
if not wrapperWritten then
_p('/* Begin PBXShellScriptBuildPhase section */')
wrapperWritten = true
end
_p(2,'%s /* %s */ = {', id, name)
_p(3,'isa = PBXShellScriptBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
_p(3,');')
_p(3,'inputPaths = (');
_p(3,');');
_p(3,'name = %s;', name);
_p(3,'outputPaths = (');
_p(3,');');
_p(3,'runOnlyForDeploymentPostprocessing = 0;');
_p(3,'shellPath = /bin/sh;');
_p(3,'shellScript = "%s";', table.concat(commands, "\\n"):gsub('"', '\\"'))
_p(2,'};')
end
end
doblock("9607AE1010C857E500CD1376", "Prebuild", "prebuildcommands")
doblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands")
doblock("9607AE3710C85E8F00CD1376", "Postbuild", "postbuildcommands")
if wrapperWritten then
_p('/* End PBXShellScriptBuildPhase section */')
end
end
function xcode.PBXSourcesBuildPhase(tr)
_p('/* Begin PBXSourcesBuildPhase section */')
for _, target in ipairs(tr.products.children) do
_p(2,'%s /* Sources */ = {', target.sourcesid)
_p(3,'isa = PBXSourcesBuildPhase;')
_p(3,'buildActionMask = 2147483647;')
_p(3,'files = (')
tree.traverse(tr, {
onleaf = function(node)
if xcode.getbuildcategory(node) == "Sources" then
_p(4,'%s /* %s in Sources */,', node.buildid, node.name)
end
end
})
_p(3,');')
_p(3,'runOnlyForDeploymentPostprocessing = 0;')
_p(2,'};')
end
_p('/* End PBXSourcesBuildPhase section */')
_p('')
end
function xcode.PBXVariantGroup(tr)
_p('/* Begin PBXVariantGroup section */')
tree.traverse(tr, {
onbranch = function(node)
if node.kind == "vgroup" then
_p(2,'%s /* %s */ = {', node.id, node.name)
_p(3,'isa = PBXVariantGroup;')
_p(3,'children = (')
for _, lang in ipairs(node.children) do
_p(4,'%s /* %s */,', lang.id, lang.name)
end
_p(3,');')
_p(3,'name = %s;', node.name)
_p(3,'sourceTree = "<group>";')
_p(2,'};')
end
end
})
_p('/* End PBXVariantGroup section */')
_p('')
end
function xcode.PBXTargetDependency(tr)
if #tr.projects.children > 0 then
_p('/* Begin PBXTargetDependency section */')
tree.traverse(tr.projects, {
onleaf = function(node)
_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)
_p(3,'isa = PBXTargetDependency;')
_p(3,'name = "%s";', node.name)
_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)
_p(2,'};')
end
})
_p('/* End PBXTargetDependency section */')
_p('')
end
end
function xcode.XCBuildConfiguration_Target(tr, target, cfg)
local cfgname = xcode.getconfigname(cfg)
_p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfgname)
_p(3,'isa = XCBuildConfiguration;')
_p(3,'buildSettings = {')
_p(4,'ALWAYS_SEARCH_USER_PATHS = NO;')
if not cfg.flags.Symbols then
_p(4,'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";')
end
if cfg.kind ~= "StaticLib" and cfg.buildtarget.prefix ~= "" then
_p(4,'EXECUTABLE_PREFIX = %s;', cfg.buildtarget.prefix)
end
local outdir = path.getdirectory(cfg.buildtarget.bundlepath)
if outdir ~= "." then
_p(4,'CONFIGURATION_BUILD_DIR = %s;', outdir)
end
_p(4,'GCC_DYNAMIC_NO_PIC = NO;')
_p(4,'GCC_MODEL_TUNING = G5;')
if tr.infoplist then
_p(4,'INFOPLIST_FILE = "%s";', tr.infoplist.path)
end
installpaths = {
ConsoleApp = '/usr/local/bin',
WindowedApp = '"$(HOME)/Applications"',
SharedLib = '/usr/local/lib',
StaticLib = '/usr/local/lib',
}
_p(4,'INSTALL_PATH = %s;', installpaths[cfg.kind])
_p(4,'PRODUCT_NAME = "%s";', cfg.buildtarget.basename)
_p(3,'};')
_p(3,'name = "%s";', cfgname)
_p(2,'};')
end
function xcode.XCBuildConfiguration_Project(tr, cfg)
local cfgname = xcode.getconfigname(cfg)
_p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfgname)
_p(3,'isa = XCBuildConfiguration;')
_p(3,'buildSettings = {')
local archs = {
Native = "$(NATIVE_ARCH_ACTUAL)",
x32 = "i386",
x64 = "x86_64",
Universal32 = "$(ARCHS_STANDARD_32_BIT)",
Universal64 = "$(ARCHS_STANDARD_64_BIT)",
Universal = "$(ARCHS_STANDARD_32_64_BIT)",
}
_p(4,'ARCHS = "%s";', archs[cfg.platform])
local targetdir = path.getdirectory(cfg.buildtarget.bundlepath)
if targetdir ~= "." then
_p(4,'CONFIGURATION_BUILD_DIR = "$(SYMROOT)";');
end
_p(4,'CONFIGURATION_TEMP_DIR = "$(OBJROOT)";')
if cfg.flags.Symbols then
_p(4,'COPY_PHASE_STRIP = NO;')
end
_p(4,'GCC_C_LANGUAGE_STANDARD = gnu99;')
if cfg.flags.NoExceptions then
_p(4,'GCC_ENABLE_CPP_EXCEPTIONS = NO;')
end
if cfg.flags.NoRTTI then
_p(4,'GCC_ENABLE_CPP_RTTI = NO;')
end
if _ACTION ~= "xcode4" and cfg.flags.Symbols and not cfg.flags.NoEditAndContinue then
_p(4,'GCC_ENABLE_FIX_AND_CONTINUE = YES;')
end
if cfg.flags.NoExceptions then
_p(4,'GCC_ENABLE_OBJC_EXCEPTIONS = NO;')
end
if cfg.flags.Optimize or cfg.flags.OptimizeSize then
_p(4,'GCC_OPTIMIZATION_LEVEL = s;')
elseif cfg.flags.OptimizeSpeed then
_p(4,'GCC_OPTIMIZATION_LEVEL = 3;')
else
_p(4,'GCC_OPTIMIZATION_LEVEL = 0;')
end
if cfg.pchheader and not cfg.flags.NoPCH then
_p(4,'GCC_PRECOMPILE_PREFIX_HEADER = YES;')
_p(4,'GCC_PREFIX_HEADER = "%s";', cfg.pchheader)
end
xcode.printlist(cfg.defines, 'GCC_PREPROCESSOR_DEFINITIONS')
_p(4,'GCC_SYMBOLS_PRIVATE_EXTERN = NO;')
if cfg.flags.FatalWarnings then
_p(4,'GCC_TREAT_WARNINGS_AS_ERRORS = YES;')
end
_p(4,'GCC_WARN_ABOUT_RETURN_TYPE = YES;')
_p(4,'GCC_WARN_UNUSED_VARIABLE = YES;')
xcode.printlist(cfg.includedirs, 'HEADER_SEARCH_PATHS')
xcode.printlist(cfg.libdirs, 'LIBRARY_SEARCH_PATHS')
_p(4,'OBJROOT = "%s";', cfg.objectsdir)
_p(4,'ONLY_ACTIVE_ARCH = %s;',iif(premake.config.isdebugbuild(cfg),'YES','NO'))
-- build list of "other" C/C++ flags
local checks = {
["-ffast-math"] = cfg.flags.FloatFast,
["-ffloat-store"] = cfg.flags.FloatStrict,
["-fomit-frame-pointer"] = cfg.flags.NoFramePointer,
}
local flags = { }
for flag, check in pairs(checks) do
if check then
table.insert(flags, flag)
end
end
xcode.printlist(table.join(flags, cfg.buildoptions), 'OTHER_CFLAGS')
-- build list of "other" linked flags. All libraries that aren't frameworks
-- are listed here, so I don't have to try and figure out if they are ".a"
-- or ".dylib", which Xcode requires to list in the Frameworks section
flags = { }
for _, lib in ipairs(premake.getlinks(cfg, "system")) do
if not xcode.isframework(lib) then
table.insert(flags, "-l" .. lib)
end
end
flags = table.join(flags, cfg.linkoptions)
xcode.printlist(flags, 'OTHER_LDFLAGS')
if cfg.flags.StaticRuntime then
_p(4,'STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;')
end
if targetdir ~= "." then
_p(4,'SYMROOT = "%s";', targetdir)
end
if cfg.flags.ExtraWarnings then
_p(4,'WARNING_CFLAGS = "-Wall";')
end
_p(3,'};')
_p(3,'name = "%s";', cfgname)
_p(2,'};')
end
function xcode.XCBuildConfiguration(tr)
_p('/* Begin XCBuildConfiguration section */')
for _, target in ipairs(tr.products.children) do
for _, cfg in ipairs(tr.configs) do
xcode.XCBuildConfiguration_Target(tr, target, cfg)
end
end
for _, cfg in ipairs(tr.configs) do
xcode.XCBuildConfiguration_Project(tr, cfg)
end
_p('/* End XCBuildConfiguration section */')
_p('')
end
function xcode.XCBuildConfigurationList(tr)
local sln = tr.project.solution
_p('/* Begin XCConfigurationList section */')
for _, target in ipairs(tr.products.children) do
_p(2,'%s /* Build configuration list for PBXNativeTarget "%s" */ = {', target.cfgsection, target.name)
_p(3,'isa = XCConfigurationList;')
_p(3,'buildConfigurations = (')
for _, cfg in ipairs(tr.configs) do
_p(4,'%s /* %s */,', cfg.xcode.targetid, xcode.getconfigname(cfg))
end
_p(3,');')
_p(3,'defaultConfigurationIsVisible = 0;')
_p(3,'defaultConfigurationName = "%s";', xcode.getconfigname(tr.configs[1]))
_p(2,'};')
end
_p(2,'1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "%s" */ = {', tr.name)
_p(3,'isa = XCConfigurationList;')
_p(3,'buildConfigurations = (')
for _, cfg in ipairs(tr.configs) do
_p(4,'%s /* %s */,', cfg.xcode.projectid, xcode.getconfigname(cfg))
end
_p(3,');')
_p(3,'defaultConfigurationIsVisible = 0;')
_p(3,'defaultConfigurationName = "%s";', xcode.getconfigname(tr.configs[1]))
_p(2,'};')
_p('/* End XCConfigurationList section */')
_p('')
end
function xcode.Footer()
_p(1,'};')
_p('\trootObject = 08FB7793FE84155DC02AAC07 /* Project object */;')
_p('}')
end

View File

@ -1,165 +0,0 @@
--
-- xcode_project.lua
-- Generate an Xcode C/C++ project.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
local xcode = premake.xcode
local tree = premake.tree
--
-- Create a tree corresponding to what is shown in the Xcode project browser
-- pane, with nodes for files and folders, resources, frameworks, and products.
--
-- @param prj
-- The project being generated.
-- @returns
-- A tree, loaded with metadata, which mirrors Xcode's view of the project.
--
function xcode.buildprjtree(prj)
local tr = premake.project.buildsourcetree(prj)
-- create a list of build configurations and assign IDs
tr.configs = {}
for _, cfgname in ipairs(prj.solution.configurations) do
for _, platform in ipairs(prj.solution.xcode.platforms) do
local cfg = premake.getconfig(prj, cfgname, platform)
cfg.xcode = {}
cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode, cfgname)
cfg.xcode.projectid = xcode.newid(tr, cfgname)
table.insert(tr.configs, cfg)
end
end
-- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
-- to Xcode's display layout (MainMenu.xib/English).
tree.traverse(tr, {
onbranch = function(node)
if path.getextension(node.name) == ".lproj" then
local lang = path.getbasename(node.name) -- "English", "French", etc.
-- create a new language group for each file it contains
for _, filenode in ipairs(node.children) do
local grpnode = node.parent.children[filenode.name]
if not grpnode then
grpnode = tree.insert(node.parent, tree.new(filenode.name))
grpnode.kind = "vgroup"
end
-- convert the file node to a language node and add to the group
filenode.name = path.getbasename(lang)
tree.insert(grpnode, filenode)
end
-- remove this directory from the tree
tree.remove(node)
end
end
})
-- the special folder "Frameworks" lists all linked frameworks
tr.frameworks = tree.new("Frameworks")
for cfg in premake.eachconfig(prj) do
for _, link in ipairs(premake.getlinks(cfg, "system", "fullpath")) do
local name = path.getname(link)
if xcode.isframework(name) and not tr.frameworks.children[name] then
node = tree.insert(tr.frameworks, tree.new(name))
node.path = link
end
end
end
-- only add it to the tree if there are frameworks to link
if #tr.frameworks.children > 0 then
tree.insert(tr, tr.frameworks)
end
-- the special folder "Products" holds the target produced by the project; this
-- is populated below
tr.products = tree.insert(tr, tree.new("Products"))
-- the special folder "Projects" lists sibling project dependencies
tr.projects = tree.new("Projects")
for _, dep in ipairs(premake.getdependencies(prj, "sibling", "object")) do
-- create a child node for the dependency's xcodeproj
local xcpath = xcode.getxcodeprojname(dep)
local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))
xcnode.path = xcpath
xcnode.project = dep
xcnode.productgroupid = xcode.newid(xcnode, "prodgrp")
xcnode.productproxyid = xcode.newid(xcnode, "prodprox")
xcnode.targetproxyid = xcode.newid(xcnode, "targprox")
xcnode.targetdependid = xcode.newid(xcnode, "targdep")
-- create a grandchild node for the dependency's link target
local cfg = premake.getconfig(dep, prj.configurations[1])
node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
node.path = cfg.linktarget.fullpath
node.cfg = cfg
end
if #tr.projects.children > 0 then
tree.insert(tr, tr.projects)
end
-- Final setup
tree.traverse(tr, {
onnode = function(node)
-- assign IDs to every node in the tree
node.id = xcode.newid(node)
-- assign build IDs to buildable files
if xcode.getbuildcategory(node) then
node.buildid = xcode.newid(node, "build")
end
-- remember key files that are needed elsewhere
if string.endswith(node.name, "Info.plist") then
tr.infoplist = node
end
end
}, true)
-- Plug in the product node into the Products folder in the tree. The node
-- was built in xcode.preparesolution() in xcode_common.lua; it contains IDs
-- that are necessary for inter-project dependencies
node = tree.insert(tr.products, prj.xcode.projectnode)
node.kind = "product"
node.path = node.cfg.buildtarget.fullpath
node.cfgsection = xcode.newid(node, "cfg")
node.resstageid = xcode.newid(node, "rez")
node.sourcesid = xcode.newid(node, "src")
node.fxstageid = xcode.newid(node, "fxs")
return tr
end
--
-- Generate an Xcode .xcodeproj for a Premake project.
--
-- @param prj
-- The Premake project to generate.
--
function premake.xcode.project(prj)
local tr = xcode.buildprjtree(prj)
xcode.Header(tr)
xcode.PBXBuildFile(tr)
xcode.PBXContainerItemProxy(tr)
xcode.PBXFileReference(tr)
xcode.PBXFrameworksBuildPhase(tr)
xcode.PBXGroup(tr)
xcode.PBXNativeTarget(tr)
xcode.PBXProject(tr)
xcode.PBXReferenceProxy(tr)
xcode.PBXResourcesBuildPhase(tr)
xcode.PBXShellScriptBuildPhase(tr)
xcode.PBXSourcesBuildPhase(tr)
xcode.PBXVariantGroup(tr)
xcode.PBXTargetDependency(tr)
xcode.XCBuildConfiguration(tr)
xcode.XCBuildConfigurationList(tr)
xcode.Footer(tr)
end

View File

@ -1,159 +0,0 @@
--
-- action.lua
-- Work with the list of registered actions.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.action = { }
--
-- The list of registered actions.
--
premake.action.list = { }
--
-- Register a new action.
--
-- @param a
-- The new action object.
--
function premake.action.add(a)
-- validate the action object, at least a little bit
local missing
for _, field in ipairs({"description", "trigger"}) do
if (not a[field]) then
missing = field
end
end
if (missing) then
error("action needs a " .. missing, 3)
end
-- add it to the master list
premake.action.list[a.trigger] = a
end
--
-- Trigger an action.
--
-- @param name
-- The name of the action to be triggered.
-- @returns
-- None.
--
function premake.action.call(name)
local a = premake.action.list[name]
for sln in premake.solution.each() do
if a.onsolution then
a.onsolution(sln)
end
for prj in premake.solution.eachproject(sln) do
if a.onproject then
a.onproject(prj)
end
end
end
if a.execute then
a.execute()
end
end
--
-- Retrieve the current action, as determined by _ACTION.
--
-- @return
-- The current action, or nil if _ACTION is nil or does not match any action.
--
function premake.action.current()
return premake.action.get(_ACTION)
end
--
-- Retrieve an action by name.
--
-- @param name
-- The name of the action to retrieve.
-- @returns
-- The requested action, or nil if the action does not exist.
--
function premake.action.get(name)
return premake.action.list[name]
end
--
-- Iterator for the list of actions.
--
function premake.action.each()
-- sort the list by trigger
local keys = { }
for _, action in pairs(premake.action.list) do
table.insert(keys, action.trigger)
end
table.sort(keys)
local i = 0
return function()
i = i + 1
return premake.action.list[keys[i]]
end
end
--
-- Activates a particular action.
--
-- @param name
-- The name of the action to activate.
--
function premake.action.set(name)
_ACTION = name
-- Some actions imply a particular operating system
local action = premake.action.get(name)
if action then
_OS = action.os or _OS
end
end
--
-- Determines if an action supports a particular language or target type.
--
-- @param action
-- The action to test.
-- @param feature
-- The feature to check, either a programming language or a target type.
-- @returns
-- True if the feature is supported, false otherwise.
--
function premake.action.supports(action, feature)
if not action then
return false
end
if action.valid_languages then
if table.contains(action.valid_languages, feature) then
return true
end
end
if action.valid_kinds then
if table.contains(action.valid_kinds, feature) then
return true
end
end
return false
end

View File

@ -1,745 +0,0 @@
--
-- api.lua
-- Implementation of the solution, project, and configuration APIs.
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
--
--
-- Here I define all of the getter/setter functions as metadata. The actual
-- functions are built programmatically below.
--
premake.fields =
{
basedir =
{
kind = "path",
scope = "container",
},
buildaction =
{
kind = "string",
scope = "config",
allowed = {
"Compile",
"Copy",
"Embed",
"None"
}
},
buildoptions =
{
kind = "list",
scope = "config",
},
configurations =
{
kind = "list",
scope = "solution",
},
cxxtesthdrfiles =
{
kind = "filelist",
scope = "config",
},
cxxtestsrcfiles =
{
kind = "filelist",
scope = "config",
},
cxxtestoptions =
{
kind = "string",
scope = "config",
},
cxxtestpath =
{
kind = "path",
scope = "solution",
},
cxxtestrootfile =
{
kind = "path",
scope = "config",
},
cxxtestrootoptions =
{
kind = "string",
scope = "config",
},
defines =
{
kind = "list",
scope = "config",
},
deploymentoptions =
{
kind = "list",
scope = "config",
},
excludes =
{
kind = "filelist",
scope = "config",
},
files =
{
kind = "filelist",
scope = "config",
},
flags =
{
kind = "list",
scope = "config",
isflags = true,
allowed = {
"EnableSSE",
"EnableSSE2",
"ExtraWarnings",
"FatalWarnings",
"FloatFast",
"FloatStrict",
"Managed",
"MFC",
"NativeWChar",
"No64BitChecks",
"NoDebugHeap",
"NoEditAndContinue",
"NoExceptions",
"NoFramePointer",
"NoImportLib",
"NoManifest",
"NoMinimalRebuild",
"NoNativeWChar",
"NoPCH",
"NoRTTI",
"Optimize",
"OptimizeSize",
"OptimizeSpeed",
"SEH",
"StaticRuntime",
"Symbols",
"Unicode",
"Unsafe",
"WinMain"
}
},
framework =
{
kind = "string",
scope = "container",
allowed = {
"1.0",
"1.1",
"2.0",
"3.0",
"3.5",
"4.0"
}
},
gnuexternals =
{
kind = "list",
scope = "config",
},
imagepath =
{
kind = "path",
scope = "config",
},
imageoptions =
{
kind = "list",
scope = "config",
},
implibdir =
{
kind = "path",
scope = "config",
},
implibextension =
{
kind = "string",
scope = "config",
},
implibname =
{
kind = "string",
scope = "config",
},
implibprefix =
{
kind = "string",
scope = "config",
},
implibsuffix =
{
kind = "string",
scope = "config",
},
includedirs =
{
kind = "dirlist",
scope = "config",
},
kind =
{
kind = "string",
scope = "config",
allowed = {
"ConsoleApp",
"WindowedApp",
"StaticLib",
"SharedLib"
}
},
language =
{
kind = "string",
scope = "container",
allowed = {
"C",
"C++",
"C#"
}
},
libdirs =
{
kind = "dirlist",
scope = "config",
},
linkoptions =
{
kind = "list",
scope = "config",
},
links =
{
kind = "list",
scope = "config",
allowed = function(value)
-- if library name contains a '/' then treat it as a path to a local file
if value:find('/', nil, true) then
value = path.getabsolute(value)
end
return value
end
},
location =
{
kind = "path",
scope = "container",
},
nasmformat =
{
kind = "string",
scope = "solution",
},
nasmpath =
{
kind = "path",
scope = "solution"
},
objdir =
{
kind = "path",
scope = "config",
},
pchheader =
{
kind = "path",
scope = "config",
},
pchsource =
{
kind = "path",
scope = "config",
},
platforms =
{
kind = "list",
scope = "solution",
allowed = table.keys(premake.platforms),
},
postbuildcommands =
{
kind = "list",
scope = "config",
},
prebuildcommands =
{
kind = "list",
scope = "config",
},
prelinkcommands =
{
kind = "list",
scope = "config",
},
resdefines =
{
kind = "list",
scope = "config",
},
resincludedirs =
{
kind = "dirlist",
scope = "config",
},
resoptions =
{
kind = "list",
scope = "config",
},
targetdir =
{
kind = "path",
scope = "config",
},
targetextension =
{
kind = "string",
scope = "config",
},
targetname =
{
kind = "string",
scope = "config",
},
targetprefix =
{
kind = "string",
scope = "config",
},
targetsuffix =
{
kind = "string",
scope = "config",
},
trimpaths =
{
kind = "dirlist",
scope = "config",
},
uuid =
{
kind = "string",
scope = "container",
allowed = function(value)
local ok = true
if (#value ~= 36) then ok = false end
for i=1,36 do
local ch = value:sub(i,i)
if (not ch:find("[ABCDEFabcdef0123456789-]")) then ok = false end
end
if (value:sub(9,9) ~= "-") then ok = false end
if (value:sub(14,14) ~= "-") then ok = false end
if (value:sub(19,19) ~= "-") then ok = false end
if (value:sub(24,24) ~= "-") then ok = false end
if (not ok) then
return nil, "invalid UUID"
end
return value:upper()
end
},
}
--
-- End of metadata
--
--
-- Check to see if a value exists in a list of values, using a
-- case-insensitive match. If the value does exist, the canonical
-- version contained in the list is returned, so future tests can
-- use case-sensitive comparisions.
--
function premake.checkvalue(value, allowed)
if (allowed) then
if (type(allowed) == "function") then
return allowed(value)
else
for _,v in ipairs(allowed) do
if (value:lower() == v:lower()) then
return v
end
end
return nil, "invalid value '" .. value .. "'"
end
else
return value
end
end
--
-- Retrieve the current object of a particular type from the session. The
-- type may be "solution", "container" (the last activated solution or
-- project), or "config" (the last activated configuration). Returns the
-- requested container, or nil and an error message.
--
function premake.getobject(t)
local container
if (t == "container" or t == "solution") then
container = premake.CurrentContainer
else
container = premake.CurrentConfiguration
end
if t == "solution" then
if type(container) == "project" then
container = container.solution
end
if type(container) ~= "solution" then
container = nil
end
end
local msg
if (not container) then
if (t == "container") then
msg = "no active solution or project"
elseif (t == "solution") then
msg = "no active solution"
else
msg = "no active solution, project, or configuration"
end
end
return container, msg
end
--
-- Adds values to an array field of a solution/project/configuration. `ctype`
-- specifies the container type (see premake.getobject) for the field.
--
function premake.setarray(ctype, fieldname, value, allowed)
local container, err = premake.getobject(ctype)
if (not container) then
error(err, 4)
end
if (not container[fieldname]) then
container[fieldname] = { }
end
local function doinsert(value, depth)
if (type(value) == "table") then
for _,v in ipairs(value) do
doinsert(v, depth + 1)
end
else
value, err = premake.checkvalue(value, allowed)
if (not value) then
error(err, depth)
end
table.insert(container[fieldname], value)
end
end
if (value) then
doinsert(value, 5)
end
return container[fieldname]
end
--
-- Adds values to an array-of-directories field of a solution/project/configuration.
-- `ctype` specifies the container type (see premake.getobject) for the field. All
-- values are converted to absolute paths before being stored.
--
local function domatchedarray(ctype, fieldname, value, matchfunc)
local result = { }
function makeabsolute(value, depth)
if (type(value) == "table") then
for _, item in ipairs(value) do
makeabsolute(item, depth + 1)
end
elseif type(value) == "string" then
if value:find("*") then
makeabsolute(matchfunc(value), depth + 1)
else
table.insert(result, path.getabsolute(value))
end
else
error("Invalid value in list: expected string, got " .. type(value), depth)
end
end
makeabsolute(value, 3)
return premake.setarray(ctype, fieldname, result)
end
function premake.setdirarray(ctype, fieldname, value)
return domatchedarray(ctype, fieldname, value, os.matchdirs)
end
function premake.setfilearray(ctype, fieldname, value)
return domatchedarray(ctype, fieldname, value, os.matchfiles)
end
--
-- Set a new value for a string field of a solution/project/configuration. `ctype`
-- specifies the container type (see premake.getobject) for the field.
--
function premake.setstring(ctype, fieldname, value, allowed)
-- find the container for this value
local container, err = premake.getobject(ctype)
if (not container) then
error(err, 4)
end
-- if a value was provided, set it
if (value) then
value, err = premake.checkvalue(value, allowed)
if (not value) then
error(err, 4)
end
container[fieldname] = value
end
return container[fieldname]
end
--
-- The getter/setter implemention.
--
local function accessor(name, value)
local kind = premake.fields[name].kind
local scope = premake.fields[name].scope
local allowed = premake.fields[name].allowed
if ((kind == "string" or kind == "path") and value) then
if type(value) ~= "string" then
error("string value expected", 3)
end
end
if (kind == "string") then
return premake.setstring(scope, name, value, allowed)
elseif (kind == "path") then
if value then value = path.getabsolute(value) end
return premake.setstring(scope, name, value)
elseif (kind == "list") then
return premake.setarray(scope, name, value, allowed)
elseif (kind == "dirlist") then
return premake.setdirarray(scope, name, value)
elseif (kind == "filelist") then
return premake.setfilearray(scope, name, value)
end
end
--
-- Build all of the getter/setter functions from the metadata above.
--
for name,_ in pairs(premake.fields) do
_G[name] = function(value)
return accessor(name, value)
end
end
--
-- Project object constructors.
--
function configuration(terms)
if not terms then
return premake.CurrentConfiguration
end
local container, err = premake.getobject("container")
if (not container) then
error(err, 2)
end
local cfg = { }
cfg.terms = table.flatten({terms})
table.insert(container.blocks, cfg)
premake.CurrentConfiguration = cfg
-- create a keyword list using just the indexed keyword items. This is a little
-- confusing: "terms" are what the user specifies in the script, "keywords" are
-- the Lua patterns that result. I'll refactor to better names.
cfg.keywords = { }
for _, word in ipairs(cfg.terms) do
table.insert(cfg.keywords, path.wildcards(word):lower())
end
-- initialize list-type fields to empty tables
for name, field in pairs(premake.fields) do
if (field.kind ~= "string" and field.kind ~= "path") then
cfg[name] = { }
end
end
return cfg
end
function project(name)
if not name then
return iif(type(premake.CurrentContainer) == "project", premake.CurrentContainer, nil)
end
-- identify the parent solution
local sln
if (type(premake.CurrentContainer) == "project") then
sln = premake.CurrentContainer.solution
else
sln = premake.CurrentContainer
end
if (type(sln) ~= "solution") then
error("no active solution", 2)
end
-- if this is a new project, create it
premake.CurrentContainer = sln.projects[name]
if (not premake.CurrentContainer) then
local prj = { }
premake.CurrentContainer = prj
-- add to master list keyed by both name and index
table.insert(sln.projects, prj)
sln.projects[name] = prj
-- attach a type
setmetatable(prj, {
__type = "project",
})
prj.solution = sln
prj.name = name
prj.basedir = os.getcwd()
prj.uuid = os.uuid()
prj.blocks = { }
end
-- add an empty, global configuration to the project
configuration { }
return premake.CurrentContainer
end
function solution(name)
if not name then
if type(premake.CurrentContainer) == "project" then
return premake.CurrentContainer.solution
else
return premake.CurrentContainer
end
end
premake.CurrentContainer = premake.solution.get(name)
if (not premake.CurrentContainer) then
premake.CurrentContainer = premake.solution.new(name)
end
-- add an empty, global configuration
configuration { }
return premake.CurrentContainer
end
--
-- Define a new action.
--
-- @param a
-- The new action object.
--
function newaction(a)
premake.action.add(a)
end
--
-- Define a new option.
--
-- @param opt
-- The new option object.
--
function newoption(opt)
premake.option.add(opt)
end

View File

@ -1,90 +0,0 @@
--
-- cmdline.lua
-- Functions to define and handle command line actions and options.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
--
-- Built-in command line options
--
newoption
{
trigger = "cc",
value = "VALUE",
description = "Choose a C/C++ compiler set",
allowed = {
{ "gcc", "GNU GCC (gcc/g++)" },
{ "ow", "OpenWatcom" },
}
}
newoption
{
trigger = "dotnet",
value = "VALUE",
description = "Choose a .NET compiler set",
allowed = {
{ "msnet", "Microsoft .NET (csc)" },
{ "mono", "Novell Mono (mcs)" },
{ "pnet", "Portable.NET (cscc)" },
}
}
newoption
{
trigger = "file",
value = "FILE",
description = "Read FILE as a Premake script; default is 'premake4.lua'"
}
newoption
{
trigger = "help",
description = "Display this information"
}
newoption
{
trigger = "os",
value = "VALUE",
description = "Generate files for a different operating system",
allowed = {
{ "bsd", "OpenBSD, NetBSD, or FreeBSD" },
{ "linux", "Linux" },
{ "macosx", "Apple Mac OS X" },
{ "solaris", "Solaris" },
{ "windows", "Microsoft Windows" },
}
}
newoption
{
trigger = "platform",
value = "VALUE",
description = "Add target architecture (if supported by action)",
allowed = {
{ "x32", "32-bit" },
{ "x64", "64-bit" },
{ "universal", "Mac OS X Universal, 32- and 64-bit" },
{ "universal32", "Mac OS X Universal, 32-bit only" },
{ "universal64", "Mac OS X Universal, 64-bit only" },
{ "ps3", "Playstation 3 (experimental)" },
{ "xbox360", "Xbox 360 (experimental)" },
}
}
newoption
{
trigger = "scripts",
value = "path",
description = "Search for additional scripts on the given path"
}
newoption
{
trigger = "version",
description = "Display version information"
}

View File

@ -1,502 +0,0 @@
--
-- configs.lua
--
-- Functions for working with configuration objects (which can include
-- projects and solutions).
--
-- This script also contains the configuration "baking" logic (though I
-- would like to eventually move this out to a different file):
-- Once the project scripts have been run, flatten all of the configuration
-- data down into simpler objects, keeping only the settings that apply to
-- the current runtime environment.
--
-- Copyright (c) 2008-2010 Jason Perkins and the Premake project
--
premake.config = { }
--
-- Determine if a configuration represents a "debug" or "release" build.
-- This controls the runtime library selected for Visual Studio builds
-- (and might also be useful elsewhere).
--
-- @param cfg
-- The configuration object to test.
-- @returns
-- True if the configuration represents a debug build; false otherwise.
--
function premake.config.isdebugbuild(cfg)
-- If any of the optimize flags are set, it's a release a build
if cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then
return false
end
-- If symbols are not defined, it's a release build
if not cfg.flags.Symbols then
return false
end
return true
end
-------------------------------------------------------------------------
-- Configuration Baking Logic
-------------------------------------------------------------------------
-- do not copy these fields into the configurations
local nocopy =
{
blocks = true,
keywords = true,
projects = true,
__configs = true,
}
-- leave these paths as absolute, rather than converting to project relative
local nofixup =
{
basedir = true,
location = true,
}
--
-- Returns a list of all of the active terms from the current environment.
-- See the docs for configuration() for more information about the terms.
--
function premake.getactiveterms()
local terms = { _ACTION:lower(), os.get() }
-- add option keys or values
for key, value in pairs(_OPTIONS) do
if value ~= "" then
table.insert(terms, value:lower())
else
table.insert(terms, key:lower())
end
end
return terms
end
--
-- Test a single configuration block keyword against a list of terms.
-- The terms are a mix of key/value pairs. The keyword is tested against
-- the values; on a match, the corresponding key is returned. This
-- enables testing for required values in iskeywordsmatch(), below.
--
function premake.iskeywordmatch(keyword, terms)
-- is it negated?
if keyword:startswith("not ") then
return not premake.iskeywordmatch(keyword:sub(5), terms)
end
for _, pattern in ipairs(keyword:explode(" or ")) do
-- local pattern = "^" .. word .. "$"
for termkey, term in pairs(terms) do
if term:match(pattern) == term then
return termkey
end
end
end
end
--
-- Checks a set of configuration block keywords against a list of terms.
-- I've already forgotten the purpose of the required terms (d'oh!) but
-- I'll see if I can figure it out on a future refactoring.
--
function premake.iskeywordsmatch(keywords, terms)
local hasrequired = false
for _, keyword in ipairs(keywords) do
local matched = premake.iskeywordmatch(keyword, terms)
if not matched then
return false
end
if matched == "required" then
hasrequired = true
end
end
if terms.required and not hasrequired then
return false
else
return true
end
end
--
-- Converts path fields from absolute to location-relative paths.
--
-- @param location
-- The base location, paths will be relative to this directory.
-- @param obj
-- The object containing the fields to be adjusted.
--
local function adjustpaths(location, obj)
for name, value in pairs(obj) do
local field = premake.fields[name]
if field and value and not nofixup[name] then
if field.kind == "path" then
obj[name] = path.getrelative(location, value)
elseif field.kind == "dirlist" or field.kind == "filelist" then
for i, p in ipairs(value) do
value[i] = path.getrelative(location, p)
end
end
end
end
end
--
-- Merge all of the fields from one object into another. String values are overwritten,
-- while list values are merged. Fields listed in premake.nocopy are skipped.
--
-- @param dest
-- The destination object, to contain the merged settings.
-- @param src
-- The source object, containing the settings to added to the destination.
--
local function mergeobject(dest, src)
if not src then return end
for field, value in pairs(src) do
if not nocopy[field] then
if type(value) == "table" then
-- merge two lists, removing any duplicates along the way
local tbl = dest[field] or { }
for _, item in ipairs(value) do
if not tbl[item] then
table.insert(tbl, item)
tbl[item] = item
end
end
dest[field] = tbl
else
dest[field] = value
end
end
end
end
--
-- Merges the settings from a solution's or project's list of configuration blocks,
-- for all blocks that match the provided set of environment terms.
--
-- @param dest
-- The destination object, to contain the merged settings.
-- @param obj
-- The solution or project object being collapsed.
-- @param basis
-- "Root" level settings, from the solution, which act as a starting point for
-- all of the collapsed settings built during this call.
-- @param terms
-- A list of keywords to filter the configuration blocks; only those that
-- match will be included in the destination.
-- @param cfgname
-- The name of the configuration being collapsed. May be nil.
-- @param pltname
-- The name of the platform being collapsed. May be nil.
--
local function merge(dest, obj, basis, terms, cfgname, pltname)
-- the configuration key is the merged configuration and platform names
local key = cfgname or ""
pltname = pltname or "Native"
if pltname ~= "Native" then
key = key .. pltname
end
-- add the configuration and platform to the block filter terms
terms.config = (cfgname or ""):lower()
terms.platform = pltname:lower()
-- build the configuration base by merging the solution and project level settings
local cfg = {}
mergeobject(cfg, basis[key])
adjustpaths(obj.location, cfg)
mergeobject(cfg, obj)
-- add `kind` to the filter terms
if (cfg.kind) then
terms.kind = cfg.kind:lower()
end
-- now add in any blocks that match the filter terms
for _, blk in ipairs(obj.blocks) do
if (premake.iskeywordsmatch(blk.keywords, terms)) then
mergeobject(cfg, blk)
end
end
-- package it all up and add it to the result set
cfg.name = cfgname
cfg.platform = pltname
cfg.terms = terms
dest[key] = cfg
end
--
-- Collapse a solution or project object down to a canonical set of configuration settings,
-- keyed by configuration block/platform pairs, and taking into account the current
-- environment settings.
--
-- @param obj
-- The solution or project to be collapsed.
-- @param basis
-- "Root" level settings, from the solution, which act as a starting point for
-- all of the collapsed settings built during this call.
-- @returns
-- The collapsed list of settings, keyed by configuration block/platform pair.
--
local function collapse(obj, basis)
local result = {}
basis = basis or {}
-- find the solution, which contains the configuration and platform lists
local sln = obj.solution or obj
-- build a set of configuration filter terms; only those configuration blocks
-- with a matching set of keywords will be included in the merged results
local terms = premake.getactiveterms()
-- build a project-level configuration. If a target kind is set at this level
-- then include it into the filter terms
merge(result, obj, basis, terms)
-- if result[""].kind then
-- terms.kind = result[""].kind:lower()
-- end
-- now build configurations for each build config/platform pair
for _, cfgname in ipairs(sln.configurations) do
merge(result, obj, basis, terms, cfgname, "Native")
for _, pltname in ipairs(sln.platforms or {}) do
if pltname ~= "Native" then
merge(result, obj, basis, terms, cfgname, pltname)
end
end
end
return result
end
--
-- Post-process a project configuration, applying path fix-ups and other adjustments
-- to the "raw" setting data pulled from the project script.
--
-- @param prj
-- The project object which contains the configuration.
-- @param cfg
-- The configuration object to be fixed up.
--
local function postprocess(prj, cfg)
cfg.project = prj
cfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)
cfg.longname = premake.getconfigname(cfg.name, cfg.platform)
-- set the project location, if not already set
cfg.location = cfg.location or cfg.basedir
-- figure out the target system
local platform = premake.platforms[cfg.platform]
if platform.iscrosscompiler then
cfg.system = cfg.platform
else
cfg.system = os.get()
end
-- adjust the kind as required by the target system
if cfg.kind == "SharedLib" and platform.nosharedlibs then
cfg.kind = "StaticLib"
end
-- remove excluded files from the file list
local files = { }
for _, fname in ipairs(cfg.files) do
local excluded = false
for _, exclude in ipairs(cfg.excludes) do
excluded = (fname == exclude)
if (excluded) then break end
end
if (not excluded) then
table.insert(files, fname)
end
end
cfg.files = files
-- fixup the data
for name, field in pairs(premake.fields) do
-- re-key flag fields for faster lookups
if field.isflags then
local values = cfg[name]
for _, flag in ipairs(values) do values[flag] = true end
end
end
-- build configuration objects for all files
cfg.__fileconfigs = { }
for _, fname in ipairs(cfg.files) do
cfg.terms.required = fname:lower()
local fcfg = {}
for _, blk in ipairs(cfg.project.blocks) do
if (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then
mergeobject(fcfg, blk)
end
end
-- add indexed by name and integer
fcfg.name = fname
cfg.__fileconfigs[fname] = fcfg
table.insert(cfg.__fileconfigs, fcfg)
end
end
--
-- Computes a unique objects directory for every configuration, using the
-- following choices:
-- [1] -> the objects directory as set in the project of config
-- [2] -> [1] + the platform name
-- [3] -> [2] + the configuration name
-- [4] -> [3] + the project name
--
local function builduniquedirs()
local num_variations = 4
-- Start by listing out each possible object directory for each configuration.
-- Keep a count of how many times each path gets used across the session.
local cfg_dirs = {}
local hit_counts = {}
for sln in premake.solution.each() do
for _, prj in ipairs(sln.projects) do
for _, cfg in pairs(prj.__configs) do
local dirs = { }
dirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or "obj"))
dirs[2] = path.join(dirs[1], iif(cfg.platform == "Native", "", cfg.platform))
dirs[3] = path.join(dirs[2], cfg.name)
dirs[4] = path.join(dirs[3], cfg.project.name)
cfg_dirs[cfg] = dirs
-- configurations other than the root should bias toward a more
-- description path, including the platform or config name
local start = iif(cfg.name, 2, 1)
for v = start, num_variations do
local d = dirs[v]
hit_counts[d] = (hit_counts[d] or 0) + 1
end
end
end
end
-- Now assign an object directory to each configuration, skipping those
-- that are in use somewhere else in the session
for sln in premake.solution.each() do
for _, prj in ipairs(sln.projects) do
for _, cfg in pairs(prj.__configs) do
local dir
local start = iif(cfg.name, 2, 1)
for v = start, num_variations do
dir = cfg_dirs[cfg][v]
if hit_counts[dir] == 1 then break end
end
cfg.objectsdir = path.getrelative(cfg.location, dir)
end
end
end
end
--
-- Pre-computes the build and link targets for a configuration.
--
local function buildtargets()
for sln in premake.solution.each() do
for _, prj in ipairs(sln.projects) do
for _, cfg in pairs(prj.__configs) do
-- determine which conventions the target should follow for this config
local pathstyle = premake.getpathstyle(cfg)
local namestyle = premake.getnamestyle(cfg)
-- build the targets
cfg.buildtarget = premake.gettarget(cfg, "build", pathstyle, namestyle, cfg.system)
cfg.linktarget = premake.gettarget(cfg, "link", pathstyle, namestyle, cfg.system)
if pathstyle == "windows" then
cfg.objectsdir = path.translate(cfg.objectsdir, "\\")
end
end
end
end
end
--
-- Takes the configuration information stored in solution->project->block
-- hierarchy and flattens it all down into one object per configuration.
-- These objects are cached with the project, and can be retrieved by
-- calling the getconfig() or the eachconfig() iterator function.
--
function premake.buildconfigs()
-- convert project path fields to be relative to project location
for sln in premake.solution.each() do
for _, prj in ipairs(sln.projects) do
prj.location = prj.location or sln.location or prj.basedir
adjustpaths(prj.location, prj)
for _, blk in ipairs(prj.blocks) do
adjustpaths(prj.location, blk)
end
end
sln.location = sln.location or sln.basedir
end
-- collapse configuration blocks, so that there is only one block per build
-- configuration/platform pair, filtered to the current operating environment
for sln in premake.solution.each() do
local basis = collapse(sln)
for _, prj in ipairs(sln.projects) do
prj.__configs = collapse(prj, basis)
for _, cfg in pairs(prj.__configs) do
postprocess(prj, cfg)
end
end
end
-- assign unique object directories to each configuration
builduniquedirs()
-- walk it again and build the targets and unique directories
buildtargets(cfg)
end

View File

@ -1,145 +0,0 @@
--
-- globals.lua
-- Global tables and variables, replacements and extensions to Lua's global functions.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
-- A top-level namespace for support functions
premake = { }
-- The list of supported platforms; also update list in cmdline.lua
premake.platforms =
{
Native =
{
cfgsuffix = "",
},
x32 =
{
cfgsuffix = "32",
},
x64 =
{
cfgsuffix = "64",
},
Universal =
{
cfgsuffix = "univ",
},
Universal32 =
{
cfgsuffix = "univ32",
},
Universal64 =
{
cfgsuffix = "univ64",
},
PS3 =
{
cfgsuffix = "ps3",
iscrosscompiler = true,
nosharedlibs = true,
namestyle = "PS3",
},
Xbox360 =
{
cfgsuffix = "xbox360",
iscrosscompiler = true,
namestyle = "windows",
},
}
--
-- A replacement for Lua's built-in dofile() function, this one sets the
-- current working directory to the script's location, enabling script-relative
-- referencing of other files and resources.
--
local builtin_dofile = dofile
function dofile(fname)
-- remember the current working directory and file; I'll restore it shortly
local oldcwd = os.getcwd()
local oldfile = _SCRIPT
-- if the file doesn't exist, check the search path
if (not os.isfile(fname)) then
local path = os.pathsearch(fname, _OPTIONS["scripts"], os.getenv("PREMAKE_PATH"))
if (path) then
fname = path.."/"..fname
end
end
-- use the absolute path to the script file, to avoid any file name
-- ambiguity if an error should arise
_SCRIPT = path.getabsolute(fname)
-- switch the working directory to the new script location
local newcwd = path.getdirectory(_SCRIPT)
os.chdir(newcwd)
-- run the chunk. How can I catch variable return values?
local a, b, c, d, e, f = builtin_dofile(_SCRIPT)
-- restore the previous working directory when done
_SCRIPT = oldfile
os.chdir(oldcwd)
return a, b, c, d, e, f
end
--
-- "Immediate If" - returns one of the two values depending on the value of expr.
--
function iif(expr, trueval, falseval)
if (expr) then
return trueval
else
return falseval
end
end
--
-- A shortcut for including another "premake4.lua" file, often used for projects.
--
function include(fname)
return dofile(fname .. "/premake4.lua")
end
--
-- A shortcut for printing formatted output.
--
function printf(msg, ...)
print(string.format(msg, unpack(arg)))
end
--
-- An extension to type() to identify project object types by reading the
-- "__type" field from the metatable.
--
local builtin_type = type
function type(t)
local mt = getmetatable(t)
if (mt) then
if (mt.__type) then
return mt.__type
end
end
return builtin_type(t)
end

View File

@ -1,51 +0,0 @@
--
-- help.lua
-- User help, displayed on /help option.
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
--
function premake.showhelp()
-- display the basic usage
printf("Premake %s, a build script generator", _PREMAKE_VERSION)
printf(_PREMAKE_COPYRIGHT)
printf("%s %s", _VERSION, _COPYRIGHT)
printf("")
printf("Usage: premake4 [options] action [arguments]")
printf("")
-- display all options
printf("OPTIONS")
printf("")
for option in premake.option.each() do
local trigger = option.trigger
local description = option.description
if (option.value) then trigger = trigger .. "=" .. option.value end
if (option.allowed) then description = description .. "; one of:" end
printf(" --%-15s %s", trigger, description)
if (option.allowed) then
for _, value in ipairs(option.allowed) do
printf(" %-14s %s", value[1], value[2])
end
end
printf("")
end
-- display all actions
printf("ACTIONS")
printf("")
for action in premake.action.each() do
printf(" %-17s %s", action.trigger, action.description)
end
printf("")
-- see more
printf("For additional information, see http://industriousone.com/premake")
end

View File

@ -1,81 +0,0 @@
--
-- io.lua
-- Additions to the I/O namespace.
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
--
--
-- Prepare to capture the output from all subsequent calls to io.printf(),
-- used for automated testing of the generators.
--
function io.capture()
io.captured = ''
end
--
-- Returns the captured text and stops capturing.
--
function io.endcapture()
local captured = io.captured
io.captured = nil
return captured
end
--
-- Open an overload of the io.open() function, which will create any missing
-- subdirectories in the filename if "mode" is set to writeable.
--
local builtin_open = io.open
function io.open(fname, mode)
if (mode) then
if (mode:find("w")) then
local dir = path.getdirectory(fname)
ok, err = os.mkdir(dir)
if (not ok) then
error(err, 0)
end
end
end
return builtin_open(fname, mode)
end
--
-- A shortcut for printing formatted output to an output stream.
--
function io.printf(msg, ...)
if (not io.eol) then
io.eol = "\n"
end
local s
if type(msg) == "number" then
s = string.rep("\t", msg) .. string.format(unpack(arg))
else
s = string.format(msg, unpack(arg))
end
if io.captured then
io.captured = io.captured .. s .. io.eol
else
io.write(s)
io.write(io.eol)
end
end
--
-- Because I use io.printf() so often in the generators, create a terse shortcut
-- for it. This saves me typing, and also reduces the size of the executable.
--
_p = io.printf

View File

@ -1,107 +0,0 @@
--
-- option.lua
-- Work with the list of registered options.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.option = { }
--
-- The list of registered options.
--
premake.option.list = { }
--
-- Register a new option.
--
-- @param opt
-- The new option object.
--
function premake.option.add(opt)
-- some sanity checking
local missing
for _, field in ipairs({ "description", "trigger" }) do
if (not opt[field]) then
missing = field
end
end
if (missing) then
error("option needs a " .. missing, 3)
end
-- add it to the master list
premake.option.list[opt.trigger] = opt
end
--
-- Retrieve an option by name.
--
-- @param name
-- The name of the option to retrieve.
-- @returns
-- The requested option, or nil if the option does not exist.
--
function premake.option.get(name)
return premake.option.list[name]
end
--
-- Iterator for the list of options.
--
function premake.option.each()
-- sort the list by trigger
local keys = { }
for _, option in pairs(premake.option.list) do
table.insert(keys, option.trigger)
end
table.sort(keys)
local i = 0
return function()
i = i + 1
return premake.option.list[keys[i]]
end
end
--
-- Validate a list of user supplied key/value pairs against the list of registered options.
--
-- @param values
-- The list of user supplied key/value pairs.
-- @returns
--- True if the list of pairs are valid, false and an error message otherwise.
--
function premake.option.validate(values)
for key, value in pairs(values) do
-- does this option exist
local opt = premake.option.get(key)
if (not opt) then
return false, "invalid option '" .. key .. "'"
end
-- does it need a value?
if (opt.value and value == "") then
return false, "no value specified for option '" .. key .. "'"
end
-- is the value allowed?
if (opt.allowed) then
for _, match in ipairs(opt.allowed) do
if (match[1] == value) then return true end
end
return false, "invalid value '" .. value .. "' for option '" .. key .. "'"
end
end
return true
end

View File

@ -1,290 +0,0 @@
--
-- os.lua
-- Additions to the OS namespace.
-- Copyright (c) 2002-2011 Jason Perkins and the Premake project
--
--
-- Same as os.execute(), but accepts string formatting arguments.
--
function os.executef(cmd, ...)
cmd = string.format(cmd, unpack(arg))
return os.execute(cmd)
end
--
-- Scan the well-known system locations for a particular library.
--
local function parse_ld_so_conf(conf_file)
-- Linux ldconfig file parser to find system library locations
local first, last
local dirs = { }
local file = io.open(conf_file)
-- Handle missing ld.so.conf (BSDs) gracefully
if file == nil then
return dirs
end
for line in file:lines() do
-- ignore comments
first = line:find("#", 1, true)
if first ~= nil then
line = line:sub(1, first - 1)
end
if line ~= "" then
-- check for include files
first, last = line:find("include%s+")
if first ~= nil then
-- found include glob
local include_glob = line:sub(last + 1)
local includes = os.matchfiles(include_glob)
for _, v in ipairs(includes) do
dirs = table.join(dirs, parse_ld_so_conf(v))
end
else
-- found an actual ld path entry
table.insert(dirs, line)
end
end
end
return dirs
end
function os.findlib(libname)
local path, formats
-- assemble a search path, depending on the platform
if os.is("windows") then
formats = { "%s.dll", "%s" }
path = os.getenv("PATH")
elseif os.is("haiku") then
formats = { "lib%s.so", "%s.so" }
path = os.getenv("LIBRARY_PATH")
else
if os.is("macosx") then
formats = { "lib%s.dylib", "%s.dylib" }
path = os.getenv("DYLD_LIBRARY_PATH")
else
formats = { "lib%s.so", "%s.so" }
path = os.getenv("LD_LIBRARY_PATH") or ""
for _, v in ipairs(parse_ld_so_conf("/etc/ld.so.conf")) do
path = path .. ":" .. v
end
end
table.insert(formats, "%s")
path = path or ""
if os.is64bit() then
path = path .. ":/lib64:/usr/lib64/:usr/local/lib64"
end
path = path .. ":/lib:/usr/lib:/usr/local/lib"
end
for _, fmt in ipairs(formats) do
local name = string.format(fmt, libname)
local result = os.pathsearch(name, path)
if result then return result end
end
end
--
-- Retrieve the current operating system ID string.
--
function os.get()
return _OPTIONS.os or _OS
end
--
-- Check the current operating system; may be set with the /os command line flag.
--
function os.is(id)
return (os.get():lower() == id:lower())
end
--
-- Determine if the current system is running a 64-bit architecture
--
local _64BitHostTypes = {
"x86_64",
"ia64",
"amd64",
"ppc64",
"powerpc64",
"sparc64"
}
function os.is64bit()
-- Identify the system
local arch
if _OS == "windows" then
arch = os.getenv("PROCESSOR_ARCHITECTURE")
elseif _OS == "macosx" then
arch = os.outputof("echo $HOSTTYPE")
else
arch = os.outputof("uname -m")
end
-- Check our known 64-bit identifiers
arch = arch:lower()
for _, hosttype in ipairs(_64BitHostTypes) do
if arch:find(hosttype) then
return true
end
end
return false
end
--
-- The os.matchdirs() and os.matchfiles() functions
--
local function domatch(result, mask, wantfiles)
-- need to remove extraneous path info from the mask to ensure a match
-- against the paths returned by the OS. Haven't come up with a good
-- way to do it yet, so will handle cases as they come up
if mask:startswith("./") then
mask = mask:sub(3)
end
-- strip off any leading directory information to find out
-- where the search should take place
local basedir = mask
local starpos = mask:find("%*")
if starpos then
basedir = basedir:sub(1, starpos - 1)
end
basedir = path.getdirectory(basedir)
if (basedir == ".") then basedir = "" end
-- recurse into subdirectories?
local recurse = mask:find("**", nil, true)
-- convert mask to a Lua pattern
mask = path.wildcards(mask)
local function matchwalker(basedir)
local wildcard = path.join(basedir, "*")
-- retrieve files from OS and test against mask
local m = os.matchstart(wildcard)
while (os.matchnext(m)) do
local isfile = os.matchisfile(m)
if ((wantfiles and isfile) or (not wantfiles and not isfile)) then
local fname = path.join(basedir, os.matchname(m))
if fname:match(mask) == fname then
table.insert(result, fname)
end
end
end
os.matchdone(m)
-- check subdirectories
if recurse then
m = os.matchstart(wildcard)
while (os.matchnext(m)) do
if not os.matchisfile(m) then
local dirname = os.matchname(m)
matchwalker(path.join(basedir, dirname))
end
end
os.matchdone(m)
end
end
matchwalker(basedir)
end
function os.matchdirs(...)
local result = { }
for _, mask in ipairs(arg) do
domatch(result, mask, false)
end
return result
end
function os.matchfiles(...)
local result = { }
for _, mask in ipairs(arg) do
domatch(result, mask, true)
end
return result
end
--
-- An overload of the os.mkdir() function, which will create any missing
-- subdirectories along the path.
--
local builtin_mkdir = os.mkdir
function os.mkdir(p)
local dir = iif(p:startswith("/"), "/", "")
for part in p:gmatch("[^/]+") do
dir = dir .. part
if (part ~= "" and not path.isabsolute(part) and not os.isdir(dir)) then
local ok, err = builtin_mkdir(dir)
if (not ok) then
return nil, err
end
end
dir = dir .. "/"
end
return true
end
--
-- Run a shell command and return the output.
--
function os.outputof(cmd)
local pipe = io.popen(cmd)
local result = pipe:read('*a')
pipe:close()
return result
end
--
-- Remove a directory, along with any contained files or subdirectories.
--
local builtin_rmdir = os.rmdir
function os.rmdir(p)
-- recursively remove subdirectories
local dirs = os.matchdirs(p .. "/*")
for _, dname in ipairs(dirs) do
os.rmdir(dname)
end
-- remove any files
local files = os.matchfiles(p .. "/*")
for _, fname in ipairs(files) do
os.remove(fname)
end
-- remove this directory
builtin_rmdir(p)
end

View File

@ -1,298 +0,0 @@
--
-- path.lua
-- Path manipulation functions.
-- Copyright (c) 2002-2010 Jason Perkins and the Premake project
--
--
-- Get the absolute file path from a relative path. The requested
-- file path doesn't actually need to exist.
--
function path.getabsolute(p)
-- normalize the target path
p = path.translate(p, "/")
if (p == "") then p = "." end
-- if the directory is already absolute I don't need to do anything
local result = iif (path.isabsolute(p), nil, os.getcwd())
-- split up the supplied relative path and tackle it bit by bit
for n, part in ipairs(p:explode("/", true)) do
if (part == "" and n == 1) then
result = "/"
elseif (part == "..") then
result = path.getdirectory(result)
elseif (part ~= ".") then
result = path.join(result, part)
end
end
-- if I end up with a trailing slash remove it
result = iif(result:endswith("/"), result:sub(1, -2), result)
return result
end
--
-- Retrieve the filename portion of a path, without any extension.
--
function path.getbasename(p)
local name = path.getname(p)
local i = name:findlast(".", true)
if (i) then
return name:sub(1, i - 1)
else
return name
end
end
--
-- Retrieve the directory portion of a path, or an empty string if
-- the path does not include a directory.
--
function path.getdirectory(p)
local i = p:findlast("/", true)
if (i) then
if i > 1 then i = i - 1 end
return p:sub(1, i)
else
return "."
end
end
--
-- Retrieve the drive letter, if a Windows path.
--
function path.getdrive(p)
local ch1 = p:sub(1,1)
local ch2 = p:sub(2,2)
if ch2 == ":" then
return ch1
end
end
--
-- Retrieve the file extension.
--
function path.getextension(p)
local i = p:findlast(".", true)
if (i) then
return p:sub(i)
else
return ""
end
end
--
-- Retrieve the filename portion of a path.
--
function path.getname(p)
local i = p:findlast("[/\\]")
if (i) then
return p:sub(i + 1)
else
return p
end
end
--
-- Returns the relative path from src to dest.
--
function path.getrelative(src, dst)
-- normalize the two paths
src = path.getabsolute(src)
dst = path.getabsolute(dst)
-- same directory?
if (src == dst) then
return "."
end
-- dollar macro? Can't tell what the real path is; use absolute
-- This enables paths like $(SDK_ROOT)/include to work correctly.
if dst:startswith("$") then
return dst
end
src = src .. "/"
dst = dst .. "/"
-- find the common leading directories
local idx = 0
while (true) do
local tst = src:find("/", idx + 1, true)
if tst then
if src:sub(1,tst) == dst:sub(1,tst) then
idx = tst
else
break
end
else
break
end
end
-- if they have nothing in common return absolute path
local first = src:find("/", 0, true)
if idx <= first then
return dst:sub(1, -2)
end
-- trim off the common directories from the front
src = src:sub(idx + 1)
dst = dst:sub(idx + 1)
-- back up from dst to get to this common parent
local result = ""
idx = src:find("/")
while (idx) do
result = result .. "../"
idx = src:find("/", idx + 1)
end
-- tack on the path down to the dst from here
result = result .. dst
-- remove the trailing slash
return result:sub(1, -2)
end
--
-- Returns true if the filename represents a C/C++ source code file. This check
-- is used to prevent passing non-code files to the compiler in makefiles. It is
-- not foolproof, but it has held up well. I'm open to better suggestions.
--
function path.iscfile(fname)
local extensions = { ".c", ".s", ".m" }
local ext = path.getextension(fname):lower()
return table.contains(extensions, ext)
end
function path.iscppfile(fname)
local extensions = { ".cc", ".cpp", ".cxx", ".c", ".s", ".m", ".mm" }
local ext = path.getextension(fname):lower()
return table.contains(extensions, ext)
end
--
-- Returns true if the filename represents a Windows resource file. This check
-- is used to prevent passing non-resources to the compiler in makefiles.
--
function path.isresourcefile(fname)
local extensions = { ".rc" }
local ext = path.getextension(fname):lower()
return table.contains(extensions, ext)
end
--
-- Join two pieces of a path together into a single path.
--
function path.join(leading, trailing)
leading = leading or ""
if (not trailing) then
return leading
end
if (path.isabsolute(trailing)) then
return trailing
end
if (leading == ".") then
leading = ""
end
if (leading:len() > 0 and not leading:endswith("/")) then
leading = leading .. "/"
end
return leading .. trailing
end
--
-- Takes a path which is relative to one location and makes it relative
-- to another location instead.
--
function path.rebase(p, oldbase, newbase)
p = path.getabsolute(path.join(oldbase, p))
p = path.getrelative(newbase, p)
return p
end
--
-- Convert the separators in a path from one form to another. If `sep`
-- is nil, then a platform-specific separator is used.
--
function path.translate(p, sep)
if (type(p) == "table") then
local result = { }
for _, value in ipairs(p) do
table.insert(result, path.translate(value))
end
return result
else
if (not sep) then
if (os.is("windows")) then
sep = "\\"
else
sep = "/"
end
end
local result = p:gsub("[/\\]", sep)
return result
end
end
--
-- Converts from a simple wildcard syntax, where * is "match any"
-- and ** is "match recursive", to the corresponding Lua pattern.
--
-- @param pattern
-- The wildcard pattern to convert.
-- @returns
-- The corresponding Lua pattern.
--
function path.wildcards(pattern)
-- Escape characters that have special meanings in Lua patterns
pattern = pattern:gsub("([%+%.%-%^%$%(%)%%])", "%%%1")
-- Replace wildcard patterns with special placeholders so I don't
-- have competing star replacements to worry about
pattern = pattern:gsub("%*%*", "\001")
pattern = pattern:gsub("%*", "\002")
-- Replace the placeholders with their Lua patterns
pattern = pattern:gsub("\001", ".*")
pattern = pattern:gsub("\002", "[^/]*")
return pattern
end

View File

@ -1,34 +0,0 @@
--
-- premake.lua
-- High-level processing functions.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
--
-- Open a file for output, and call a function to actually do the writing.
-- Used by the actions to generate solution and project files.
--
-- @param obj
-- A solution or project object; will be based to the callback function.
-- @param filename
-- The output filename; see the docs for premake.project.getfilename()
-- for the expected format.
-- @param callback
-- The function responsible for writing the file, should take a solution
-- or project as a parameters.
--
function premake.generate(obj, filename, callback)
filename = premake.project.getfilename(obj, filename)
printf("Generating %s...", filename)
local f, err = io.open(filename, "wb")
if (not f) then
error(err, 0)
end
io.output(f)
callback(obj)
f:close()
end

View File

@ -1,623 +0,0 @@
--
-- project.lua
-- Functions for working with the project data.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.project = { }
--
-- Create a tree from a project's list of files, representing the filesystem hierarchy.
--
-- @param prj
-- The project containing the files to map.
-- @returns
-- A new tree object containing a corresponding filesystem hierarchy. The root node
-- contains a reference back to the original project: prj = tr.project.
--
function premake.project.buildsourcetree(prj)
local tr = premake.tree.new(prj.name)
for _, fname in ipairs(prj.files) do
local node = premake.tree.add(tr, fname)
end
premake.tree.sort(tr)
tr.project = prj
return tr
end
--
-- Returns an iterator for a set of build configuration settings. If a platform is
-- specified, settings specific to that platform and build configuration pair are
-- returned.
--
function premake.eachconfig(prj, platform)
-- I probably have the project root config, rather than the actual project
if prj.project then prj = prj.project end
local cfgs = prj.solution.configurations
local i = 0
return function ()
i = i + 1
if i <= #cfgs then
return premake.getconfig(prj, cfgs[i], platform)
end
end
end
--
-- Iterator for a project's files; returns a file configuration object.
--
function premake.eachfile(prj)
-- project root config contains the file config list
if not prj.project then prj = premake.getconfig(prj) end
local i = 0
local t = prj.files
return function ()
i = i + 1
if (i <= #t) then
return prj.__fileconfigs[t[i]]
end
end
end
--
-- Apply XML escaping to a value.
--
function premake.esc(value)
if (type(value) == "table") then
local result = { }
for _,v in ipairs(value) do
table.insert(result, premake.esc(v))
end
return result
else
value = value:gsub('&', "&amp;")
value = value:gsub('"', "&quot;")
value = value:gsub("'", "&apos;")
value = value:gsub('<', "&lt;")
value = value:gsub('>', "&gt;")
value = value:gsub('\r', "&#x0D;")
value = value:gsub('\n', "&#x0A;")
return value
end
end
--
-- Given a map of supported platform identifiers, filters the solution's list
-- of platforms to match. A map takes the form of a table like:
--
-- { x32 = "Win32", x64 = "x64" }
--
-- Only platforms that are listed in both the solution and the map will be
-- included in the results. An optional default platform may also be specified;
-- if the result set would otherwise be empty this platform will be used.
--
function premake.filterplatforms(sln, map, default)
local result = { }
local keys = { }
if sln.platforms then
for _, p in ipairs(sln.platforms) do
if map[p] and not table.contains(keys, map[p]) then
table.insert(result, p)
table.insert(keys, map[p])
end
end
end
if #result == 0 and default then
table.insert(result, default)
end
return result
end
--
-- Locate a project by name; case insensitive.
--
function premake.findproject(name)
for sln in premake.solution.each() do
for prj in premake.solution.eachproject(sln) do
if (prj.name == name) then
return prj
end
end
end
end
--
-- Locate a file in a project with a given extension; used to locate "special"
-- items such as Windows .def files.
--
function premake.findfile(prj, extension)
for _, fname in ipairs(prj.files) do
if fname:endswith(extension) then return fname end
end
end
--
-- Retrieve a configuration for a given project/configuration pairing.
-- @param prj
-- The project to query.
-- @param cfgname
-- The target build configuration; only settings applicable to this configuration
-- will be returned. May be nil to retrieve project-wide settings.
-- @param pltname
-- The target platform; only settings applicable to this platform will be returned.
-- May be nil to retrieve platform-independent settings.
-- @returns
-- A configuration object containing all the settings for the given platform/build
-- configuration pair.
--
function premake.getconfig(prj, cfgname, pltname)
-- might have the root configuration, rather than the actual project
prj = prj.project or prj
-- if platform is not included in the solution, use general settings instead
if pltname == "Native" or not table.contains(prj.solution.platforms or {}, pltname) then
pltname = nil
end
local key = (cfgname or "")
if pltname then key = key .. pltname end
return prj.__configs[key]
end
--
-- Build a name from a build configuration/platform pair. The short name
-- is good for makefiles or anywhere a user will have to type it in. The
-- long name is more readable.
--
function premake.getconfigname(cfgname, platform, useshortname)
if cfgname then
local name = cfgname
if platform and platform ~= "Native" then
if useshortname then
name = name .. premake.platforms[platform].cfgsuffix
else
name = name .. "|" .. platform
end
end
return iif(useshortname, name:lower(), name)
end
end
--
-- Returns a list of sibling projects on which the specified project depends.
-- This is used to list dependencies within a solution or workspace. Must
-- consider all configurations because Visual Studio does not support per-config
-- project dependencies.
--
-- @param prj
-- The project to query.
-- @returns
-- A list of dependent projects, as an array of objects.
--
function premake.getdependencies(prj)
-- make sure I've got the project and not root config
prj = prj.project or prj
local results = { }
for _, cfg in pairs(prj.__configs) do
for _, link in ipairs(cfg.links) do
local dep = premake.findproject(link)
if dep and not table.contains(results, dep) then
table.insert(results, dep)
end
end
end
return results
end
--
-- Uses information from a project (or solution) to format a filename.
--
-- @param prj
-- A project or solution object with the file naming information.
-- @param pattern
-- A naming pattern. The sequence "%%" will be replaced by the
-- project name.
-- @returns
-- A filename matching the specified pattern, with a relative path
-- from the current directory to the project location.
--
function premake.project.getfilename(prj, pattern)
local fname = pattern:gsub("%%%%", prj.name)
fname = path.join(prj.location, fname)
return path.getrelative(os.getcwd(), fname)
end
--
-- Returns a list of link targets. Kind may be one of:
-- siblings - linkable sibling projects
-- system - system (non-sibling) libraries
-- dependencies - all sibling dependencies, including non-linkable
-- static - siblings that are static libraries
-- all - return everything
--
-- Part may be one of:
-- name - the decorated library name with no directory
-- basename - the undecorated library name
-- directory - just the directory, no name
-- fullpath - full path with decorated name
-- object - return the project object of the dependency
--
function premake.getlinks(cfg, kind, part)
-- if I'm building a list of link directories, include libdirs
local result = iif (part == "directory" and kind == "all", cfg.libdirs, {})
-- am I getting links for a configuration or a project?
local cfgname = iif(cfg.name == cfg.project.name, "", cfg.name)
-- how should files be named?
local pathstyle = premake.getpathstyle(cfg)
local namestyle = premake.getnamestyle(cfg)
local function canlink(source, target)
if (kind == "static" and target.kind ~= "StaticLib") then
return false
elseif (target.kind ~= "SharedLib" and target.kind ~= "StaticLib") then
return false
end
if premake.iscppproject(source) then
return premake.iscppproject(target)
elseif premake.isdotnetproject(source) then
return premake.isdotnetproject(target)
end
end
for _, link in ipairs(cfg.links) do
local item
-- is this a sibling project?
local prj = premake.findproject(link)
if prj and kind ~= "system" then
local prjcfg = premake.getconfig(prj, cfgname, cfg.platform)
if kind == "dependencies" or canlink(cfg, prjcfg) then
if (part == "directory") then
item = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)
elseif (part == "basename") then
item = prjcfg.linktarget.basename
elseif (part == "fullpath") then
item = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)
elseif (part == "object") then
item = prjcfg
end
end
elseif not prj and (kind == "system" or kind == "all") then
if (part == "directory") then
local dir = path.getdirectory(link)
if (dir ~= ".") then
item = dir
end
elseif (part == "fullpath") then
item = link
if namestyle == "windows" then
if premake.iscppproject(cfg) then
item = item .. ".lib"
elseif premake.isdotnetproject(cfg) then
item = item .. ".dll"
end
end
if item:find("/", nil, true) then
item = path.getrelative(cfg.basedir, item)
end
else
item = link
end
end
if item then
if pathstyle == "windows" and part ~= "object" then
item = path.translate(item, "\\")
end
if not table.contains(result, item) then
table.insert(result, item)
end
end
end
return result
end
--
-- Gets the name style for a configuration, indicating what kind of prefix,
-- extensions, etc. should be used in target file names.
--
-- @param cfg
-- The configuration to check.
-- @returns
-- The target naming style, one of "windows", "posix", or "PS3".
--
function premake.getnamestyle(cfg)
return premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or "posix"
end
--
-- Gets the path style for a configuration, indicating what kind of path separator
-- should be used in target file names.
--
-- @param cfg
-- The configuration to check.
-- @returns
-- The target path style, one of "windows" or "posix".
--
function premake.getpathstyle(cfg)
if premake.action.current().os == "windows" then
return "windows"
else
return "posix"
end
end
--
-- Assembles a target for a particular tool/system/configuration.
--
-- @param cfg
-- The configuration to be targeted.
-- @param direction
-- One of 'build' for the build target, or 'link' for the linking target.
-- @param pathstyle
-- The path format, one of "windows" or "posix". This comes from the current
-- action: Visual Studio uses "windows", GMake uses "posix", etc.
-- @param namestyle
-- The file naming style, one of "windows" or "posix". This comes from the
-- current tool: GCC uses "posix", MSC uses "windows", etc.
-- @param system
-- The target operating system, which can modify the naming style. For example,
-- shared libraries on Mac OS X use a ".dylib" extension.
-- @returns
-- An object with these fields:
-- basename - the target with no directory or file extension
-- name - the target name and extension, with no directory
-- directory - relative path to the target, with no file name
-- prefix - the file name prefix
-- suffix - the file name suffix
-- fullpath - directory, name, and extension
-- bundlepath - the relative path and file name of the bundle
--
function premake.gettarget(cfg, direction, pathstyle, namestyle, system)
if system == "bsd" or system == "solaris" then
system = "linux"
end
-- Fix things up based on the current system
local kind = cfg.kind
if premake.iscppproject(cfg) then
-- On Windows, shared libraries link against a static import library
if (namestyle == "windows" or system == "windows") and kind == "SharedLib" and direction == "link" then
kind = "StaticLib"
end
-- Posix name conventions only apply to static libs on windows (by user request)
if namestyle == "posix" and system == "windows" and kind ~= "StaticLib" then
namestyle = "windows"
end
end
-- Initialize the target components
local field = iif(direction == "build", "target", "implib")
local name = cfg[field.."name"] or cfg.targetname or cfg.project.name
local dir = cfg[field.."dir"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)
local prefix = ""
local suffix = ""
local ext = ""
local bundlepath, bundlename
if namestyle == "windows" then
if kind == "ConsoleApp" or kind == "WindowedApp" then
ext = ".exe"
elseif kind == "SharedLib" then
ext = ".dll"
elseif kind == "StaticLib" then
ext = ".lib"
end
elseif namestyle == "posix" then
if kind == "WindowedApp" and system == "macosx" then
bundlename = name .. ".app"
bundlepath = path.join(dir, bundlename)
dir = path.join(bundlepath, "Contents/MacOS")
elseif kind == "SharedLib" then
prefix = "lib"
ext = iif(system == "macosx", ".dylib", ".so")
elseif kind == "StaticLib" then
prefix = "lib"
ext = ".a"
end
elseif namestyle == "PS3" then
if kind == "ConsoleApp" or kind == "WindowedApp" then
ext = ".elf"
elseif kind == "StaticLib" then
prefix = "lib"
ext = ".a"
end
end
prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix
suffix = cfg[field.."suffix"] or cfg.targetsuffix or suffix
ext = cfg[field.."extension"] or cfg.targetextension or ext
-- build the results object
local result = { }
result.basename = name .. suffix
result.name = prefix .. name .. suffix .. ext
result.directory = dir
result.prefix = prefix
result.suffix = suffix
result.fullpath = path.join(result.directory, result.name)
result.bundlepath = bundlepath or result.fullpath
if pathstyle == "windows" then
result.directory = path.translate(result.directory, "\\")
result.fullpath = path.translate(result.fullpath, "\\")
end
return result
end
--
-- Return the appropriate tool interface, based on the target language and
-- any relevant command-line options.
--
function premake.gettool(cfg)
if premake.iscppproject(cfg) then
if _OPTIONS.cc then
return premake[_OPTIONS.cc]
end
local action = premake.action.current()
if action.valid_tools then
return premake[action.valid_tools.cc[1]]
end
return premake.gcc
else
return premake.dotnet
end
end
--
-- Returns true if the solution contains at least one C/C++ project.
--
function premake.hascppproject(sln)
for prj in premake.solution.eachproject(sln) do
if premake.iscppproject(prj) then
return true
end
end
end
--
-- Returns true if the solution contains at least one .NET project.
--
function premake.hasdotnetproject(sln)
for prj in premake.solution.eachproject(sln) do
if premake.isdotnetproject(prj) then
return true
end
end
end
--
-- Returns true if the project uses a C/C++ language.
--
function premake.iscppproject(prj)
return (prj.language == "C" or prj.language == "C++")
end
--
-- Returns true if the project uses a .NET language.
--
function premake.isdotnetproject(prj)
return (prj.language == "C#")
end
--
-- Walk the list of source code files, breaking them into "groups" based
-- on the directory hierarchy.
--
local function walksources(cfg, fn, group, nestlevel, finished)
local grouplen = group:len()
local gname = iif(group:endswith("/"), group:sub(1, -2), group)
-- open this new group
if (nestlevel >= 0) then
fn(cfg, gname, "GroupStart", nestlevel)
end
-- scan the list of files for items which belong in this group
for _,fname in ipairs(cfg.files) do
if (fname:startswith(group)) then
-- is there a subgroup within this item?
local _,split = fname:find("[^\.]/", grouplen + 1)
if (split) then
local subgroup = fname:sub(1, split)
if (not finished[subgroup]) then
finished[subgroup] = true
walksources(cfg, fn, subgroup, nestlevel + 1, finished)
end
end
end
end
-- process all files that belong in this group
for _,fname in ipairs(cfg.files) do
if (fname:startswith(group) and not fname:find("[^\.]/", grouplen + 1)) then
fn(cfg, fname, "GroupItem", nestlevel + 1)
end
end
-- close the group
if (nestlevel >= 0) then
fn(cfg, gname, "GroupEnd", nestlevel)
end
end
function premake.walksources(cfg, fn)
walksources(cfg, fn, "", -1, {})
end

View File

@ -1,113 +0,0 @@
--
-- solution.lua
-- Work with the list of solutions loaded from the script.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
premake.solution = { }
-- The list of defined solutions (which contain projects, etc.)
premake.solution.list = { }
--
-- Create a new solution and add it to the session.
--
-- @param name
-- The new solution's name.
--
function premake.solution.new(name)
local sln = { }
-- add to master list keyed by both name and index
table.insert(premake.solution.list, sln)
premake.solution.list[name] = sln
-- attach a type descriptor
setmetatable(sln, { __type="solution" })
sln.name = name
sln.basedir = os.getcwd()
sln.projects = { }
sln.blocks = { }
sln.configurations = { }
return sln
end
--
-- Iterate over the collection of solutions in a session.
--
-- @returns
-- An iterator function.
--
function premake.solution.each()
local i = 0
return function ()
i = i + 1
if i <= #premake.solution.list then
return premake.solution.list[i]
end
end
end
--
-- Iterate over the projects of a solution.
--
-- @param sln
-- The solution.
-- @returns
-- An iterator function.
--
function premake.solution.eachproject(sln)
local i = 0
return function ()
i = i + 1
if (i <= #sln.projects) then
return premake.solution.getproject(sln, i)
end
end
end
--
-- Retrieve a solution by name or index.
--
-- @param key
-- The solution key, either a string name or integer index.
-- @returns
-- The solution with the provided key.
--
function premake.solution.get(key)
return premake.solution.list[key]
end
--
-- Retrieve the project at a particular index.
--
-- @param sln
-- The solution.
-- @param idx
-- An index into the array of projects.
-- @returns
-- The project at the given index.
--
function premake.solution.getproject(sln, idx)
-- retrieve the root configuration of the project, with all of
-- the global (not configuration specific) settings collapsed
local prj = sln.projects[idx]
local cfg = premake.getconfig(prj)
-- root configuration doesn't have a name; use the project's
cfg.name = prj.name
return cfg
end

View File

@ -1,50 +0,0 @@
--
-- string.lua
-- Additions to Lua's built-in string functions.
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
--
--
-- Returns an array of strings, each of which is a substring of s
-- formed by splitting on boundaries formed by `pattern`.
--
function string.explode(s, pattern, plain)
if (pattern == '') then return false end
local pos = 0
local arr = { }
for st,sp in function() return s:find(pattern, pos, plain) end do
table.insert(arr, s:sub(pos, st-1))
pos = sp + 1
end
table.insert(arr, s:sub(pos))
return arr
end
--
-- Find the last instance of a pattern in a string.
--
function string.findlast(s, pattern, plain)
local curr = 0
repeat
local next = s:find(pattern, curr + 1, plain)
if (next) then curr = next end
until (not next)
if (curr > 0) then
return curr
end
end
--
-- Returns true if `haystack` starts with the sequence `needle`.
--
function string.startswith(haystack, needle)
return (haystack:find(needle, 1, true) == 1)
end

View File

@ -1,139 +0,0 @@
--
-- table.lua
-- Additions to Lua's built-in table functions.
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
--
--
-- Returns true if the table contains the specified value.
--
function table.contains(t, value)
for _,v in pairs(t) do
if (v == value) then
return true
end
end
return false
end
--
-- Enumerates an array of objects and returns a new table containing
-- only the value of one particular field.
--
function table.extract(arr, fname)
local result = { }
for _,v in ipairs(arr) do
table.insert(result, v[fname])
end
return result
end
--
-- Flattens a hierarchy of tables into a single array containing all
-- of the values.
--
function table.flatten(arr)
local result = { }
local function flatten(arr)
for _, v in ipairs(arr) do
if type(v) == "table" then
flatten(v)
else
table.insert(result, v)
end
end
end
flatten(arr)
return result
end
--
-- Merges an array of items into a string.
--
function table.implode(arr, before, after, between)
local result = ""
for _,v in ipairs(arr) do
if (result ~= "" and between) then
result = result .. between
end
result = result .. before .. v .. after
end
return result
end
--
-- Returns true if the table is empty, and contains no indexed or keyed values.
--
function table.isempty(t)
return not next(t)
end
--
-- Adds the values from one array to the end of another and
-- returns the result.
--
function table.join(...)
local result = { }
for _,t in ipairs(arg) do
if type(t) == "table" then
for _,v in ipairs(t) do
table.insert(result, v)
end
else
table.insert(result, t)
end
end
return result
end
--
-- Return a list of all keys used in a table.
--
function table.keys(tbl)
local keys = {}
for k, _ in pairs(tbl) do
table.insert(keys, k)
end
return keys
end
--
-- Translates the values contained in array, using the specified
-- translation table, and returns the results in a new array.
--
function table.translate(arr, translation)
local result = { }
for _, value in ipairs(arr) do
local tvalue
if type(translation) == "function" then
tvalue = translation(value)
else
tvalue = translation[value]
end
if (tvalue) then
table.insert(result, tvalue)
end
end
return result
end

View File

@ -1,195 +0,0 @@
--
-- tree.lua
-- Functions for working with the source code tree.
-- Copyright (c) 2009 Jason Perkins and the Premake project
--
premake.tree = { }
local tree = premake.tree
--
-- Create a new tree.
--
-- @param n
-- The name of the tree, applied to the root node (optional).
--
function premake.tree.new(n)
local t = {
name = n,
children = { }
}
return t
end
--
-- Add a new node to the tree, or returns the current node if it already exists.
--
-- @param tr
-- The tree to contain the new node.
-- @param p
-- The path of the new node.
-- @returns
-- The new tree node.
--
function premake.tree.add(tr, p)
-- Special case "." refers to the current node
if p == "." then
return tr
end
-- Look for the immediate parent for this new node, creating it if necessary.
-- Recurses to create as much of the tree as necessary.
local parentnode = tree.add(tr, path.getdirectory(p))
-- Another special case, ".." refers to the parent node and doesn't create anything
local childname = path.getname(p)
if childname == ".." then
return parentnode
end
-- Create the child if necessary. If two children with the same name appear
-- at the same level, make sure they have the same path to prevent conflicts
-- i.e. ../Common and ../../Common can both appear at the top of the tree
-- yet they have different paths (Bug #3016050)
local childnode = parentnode.children[childname]
if not childnode or childnode.path ~= p then
childnode = tree.insert(parentnode, tree.new(childname))
childnode.path = p
end
return childnode
end
--
-- Insert one tree into another.
--
-- @param parent
-- The parent tree, to contain the child.
-- @param child
-- The child tree, to be inserted.
--
function premake.tree.insert(parent, child)
table.insert(parent.children, child)
if child.name then
parent.children[child.name] = child
end
child.parent = parent
return child
end
--
-- Gets the node's relative path from it's parent. If the parent does not have
-- a path set (it is the root or other container node) returns the full node path.
--
-- @param node
-- The node to query.
--
function premake.tree.getlocalpath(node)
if node.parent.path then
return node.name
else
return node.path
end
end
--
-- Remove a node from a tree.
--
-- @param node
-- The node to remove.
--
function premake.tree.remove(node)
local children = node.parent.children
for i = 1, #children do
if children[i] == node then
table.remove(children, i)
end
end
node.children = {}
end
--
-- Sort the nodes of a tree in-place.
--
-- @param tr
-- The tree to sort.
--
function premake.tree.sort(tr)
tree.traverse(tr, {
onnode = function(node)
table.sort(node.children, function(a,b)
return a.name < b.name
end)
end
}, true)
end
--
-- Traverse a tree.
--
-- @param t
-- The tree to traverse.
-- @param fn
-- A collection of callback functions, which may contain:
--
-- onnode(node, depth) - called on each node encountered
-- onleaf(node, depth) - called only on leaf nodes
-- onbranch(node, depth) - called only on branch nodes
--
-- @param includeroot
-- True to include the root node in the traversal, otherwise it will be skipped.
--
function premake.tree.traverse(t, fn, includeroot)
local donode, dochildren
donode = function(node, fn, depth)
if node.isremoved then
return
end
if fn.onnode then
fn.onnode(node, depth)
end
if #node.children > 0 then
if fn.onbranch then
fn.onbranch(node, depth)
end
dochildren(node, fn, depth + 1)
else
if fn.onleaf then
fn.onleaf(node, depth)
end
end
end
dochildren = function(parent, fn, depth)
-- this goofy iterator allows nodes to be removed during the traversal
local i = 1
while i <= #parent.children do
local node = parent.children[i]
donode(node, fn, depth)
if node == parent.children[i] then
i = i + 1
end
end
end
if includeroot then
donode(t, fn, 0)
else
dochildren(t, fn, 0)
end
end

View File

@ -1,91 +0,0 @@
--
-- validate.lua
-- Tests to validate the run-time environment before starting the action.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
--
-- Performs a sanity check of all of the solutions and projects
-- in the session to be sure they meet some minimum requirements.
--
function premake.checkprojects()
local action = premake.action.current()
for sln in premake.solution.each() do
-- every solution must have at least one project
if (#sln.projects == 0) then
return nil, "solution '" .. sln.name .. "' needs at least one project"
end
-- every solution must provide a list of configurations
if (#sln.configurations == 0) then
return nil, "solution '" .. sln.name .. "' needs configurations"
end
for prj in premake.solution.eachproject(sln) do
-- every project must have a language
if (not prj.language) then
return nil, "project '" ..prj.name .. "' needs a language"
end
-- and the action must support it
if (action.valid_languages) then
if (not table.contains(action.valid_languages, prj.language)) then
return nil, "the " .. action.shortname .. " action does not support " .. prj.language .. " projects"
end
end
for cfg in premake.eachconfig(prj) do
-- every config must have a kind
if (not cfg.kind) then
return nil, "project '" ..prj.name .. "' needs a kind in configuration '" .. cfg.name .. "'"
end
-- and the action must support it
if (action.valid_kinds) then
if (not table.contains(action.valid_kinds, cfg.kind)) then
return nil, "the " .. action.shortname .. " action does not support " .. cfg.kind .. " projects"
end
end
end
-- some actions have custom validation logic
if action.oncheckproject then
action.oncheckproject(prj)
end
end
end
return true
end
--
-- Check the specified tools (/cc, /dotnet, etc.) against the current action
-- to make sure they are compatible and supported.
--
function premake.checktools()
local action = premake.action.current()
if (not action.valid_tools) then
return true
end
for tool, values in pairs(action.valid_tools) do
if (_OPTIONS[tool]) then
if (not table.contains(values, _OPTIONS[tool])) then
return nil, "the " .. action.shortname .. " action does not support /" .. tool .. "=" .. _OPTIONS[tool] .. " (yet)"
end
else
_OPTIONS[tool] = values[1]
end
end
return true
end

View File

@ -1,34 +0,0 @@
Lua License
-----------
Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic
and commercial purposes at absolutely no cost.
For details and rationale, see http://www.lua.org/license.html .
===============================================================================
Copyright (C) 1994-2008 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================================================
(end of COPYRIGHT)

View File

@ -1,183 +0,0 @@
HISTORY for Lua 5.1
* Changes from version 5.0 to 5.1
-------------------------------
Language:
+ new module system.
+ new semantics for control variables of fors.
+ new semantics for setn/getn.
+ new syntax/semantics for varargs.
+ new long strings and comments.
+ new `mod' operator (`%')
+ new length operator #t
+ metatables for all types
API:
+ new functions: lua_createtable, lua_get(set)field, lua_push(to)integer.
+ user supplies memory allocator (lua_open becomes lua_newstate).
+ luaopen_* functions must be called through Lua.
Implementation:
+ new configuration scheme via luaconf.h.
+ incremental garbage collection.
+ better handling of end-of-line in the lexer.
+ fully reentrant parser (new Lua function `load')
+ better support for 64-bit machines.
+ native loadlib support for Mac OS X.
+ standard distribution in only one library (lualib.a merged into lua.a)
* Changes from version 4.0 to 5.0
-------------------------------
Language:
+ lexical scoping.
+ Lua coroutines.
+ standard libraries now packaged in tables.
+ tags replaced by metatables and tag methods replaced by metamethods,
stored in metatables.
+ proper tail calls.
+ each function can have its own global table, which can be shared.
+ new __newindex metamethod, called when we insert a new key into a table.
+ new block comments: --[[ ... ]].
+ new generic for.
+ new weak tables.
+ new boolean type.
+ new syntax "local function".
+ (f()) returns the first value returned by f.
+ {f()} fills a table with all values returned by f.
+ \n ignored in [[\n .
+ fixed and-or priorities.
+ more general syntax for function definition (e.g. function a.x.y:f()...end).
+ more general syntax for function calls (e.g. (print or write)(9)).
+ new functions (time/date, tmpfile, unpack, require, load*, etc.).
API:
+ chunks are loaded by using lua_load; new luaL_loadfile and luaL_loadbuffer.
+ introduced lightweight userdata, a simple "void*" without a metatable.
+ new error handling protocol: the core no longer prints error messages;
all errors are reported to the caller on the stack.
+ new lua_atpanic for host cleanup.
+ new, signal-safe, hook scheme.
Implementation:
+ new license: MIT.
+ new, faster, register-based virtual machine.
+ support for external multithreading and coroutines.
+ new and consistent error message format.
+ the core no longer needs "stdio.h" for anything (except for a single
use of sprintf to convert numbers to strings).
+ lua.c now runs the environment variable LUA_INIT, if present. It can
be "@filename", to run a file, or the chunk itself.
+ support for user extensions in lua.c.
sample implementation given for command line editing.
+ new dynamic loading library, active by default on several platforms.
+ safe garbage-collector metamethods.
+ precompiled bytecodes checked for integrity (secure binary dostring).
+ strings are fully aligned.
+ position capture in string.find.
+ read('*l') can read lines with embedded zeros.
* Changes from version 3.2 to 4.0
-------------------------------
Language:
+ new "break" and "for" statements (both numerical and for tables).
+ uniform treatment of globals: globals are now stored in a Lua table.
+ improved error messages.
+ no more '$debug': full speed *and* full debug information.
+ new read form: read(N) for next N bytes.
+ general read patterns now deprecated.
(still available with -DCOMPAT_READPATTERNS.)
+ all return values are passed as arguments for the last function
(old semantics still available with -DLUA_COMPAT_ARGRET)
+ garbage collection tag methods for tables now deprecated.
+ there is now only one tag method for order.
API:
+ New API: fully re-entrant, simpler, and more efficient.
+ New debug API.
Implementation:
+ faster than ever: cleaner virtual machine and new hashing algorithm.
+ non-recursive garbage-collector algorithm.
+ reduced memory usage for programs with many strings.
+ improved treatment for memory allocation errors.
+ improved support for 16-bit machines (we hope).
+ code now compiles unmodified as both ANSI C and C++.
+ numbers in bases other than 10 are converted using strtoul.
+ new -f option in Lua to support #! scripts.
+ luac can now combine text and binaries.
* Changes from version 3.1 to 3.2
-------------------------------
+ redirected all output in Lua's core to _ERRORMESSAGE and _ALERT.
+ increased limit on the number of constants and globals per function
(from 2^16 to 2^24).
+ debugging info (lua_debug and hooks) moved into lua_state and new API
functions provided to get and set this info.
+ new debug lib gives full debugging access within Lua.
+ new table functions "foreachi", "sort", "tinsert", "tremove", "getn".
+ new io functions "flush", "seek".
* Changes from version 3.0 to 3.1
-------------------------------
+ NEW FEATURE: anonymous functions with closures (via "upvalues").
+ new syntax:
- local variables in chunks.
- better scope control with DO block END.
- constructors can now be also written: { record-part; list-part }.
- more general syntax for function calls and lvalues, e.g.:
f(x).y=1
o:f(x,y):g(z)
f"string" is sugar for f("string")
+ strings may now contain arbitrary binary data (e.g., embedded zeros).
+ major code re-organization and clean-up; reduced module interdependecies.
+ no arbitrary limits on the total number of constants and globals.
+ support for multiple global contexts.
+ better syntax error messages.
+ new traversal functions "foreach" and "foreachvar".
+ the default for numbers is now double.
changing it to use floats or longs is easy.
+ complete debug information stored in pre-compiled chunks.
+ sample interpreter now prompts user when run interactively, and also
handles control-C interruptions gracefully.
* Changes from version 2.5 to 3.0
-------------------------------
+ NEW CONCEPT: "tag methods".
Tag methods replace fallbacks as the meta-mechanism for extending the
semantics of Lua. Whereas fallbacks had a global nature, tag methods
work on objects having the same tag (e.g., groups of tables).
Existing code that uses fallbacks should work without change.
+ new, general syntax for constructors {[exp] = exp, ... }.
+ support for handling variable number of arguments in functions (varargs).
+ support for conditional compilation ($if ... $else ... $end).
+ cleaner semantics in API simplifies host code.
+ better support for writing libraries (auxlib.h).
+ better type checking and error messages in the standard library.
+ luac can now also undump.
* Changes from version 2.4 to 2.5
-------------------------------
+ io and string libraries are now based on pattern matching;
the old libraries are still available for compatibility
+ dofile and dostring can now return values (via return statement)
+ better support for 16- and 64-bit machines
+ expanded documentation, with more examples
* Changes from version 2.2 to 2.4
-------------------------------
+ external compiler creates portable binary files that can be loaded faster
+ interface for debugging and profiling
+ new "getglobal" fallback
+ new functions for handling references to Lua objects
+ new functions in standard lib
+ only one copy of each string is stored
+ expanded documentation, with more examples
* Changes from version 2.1 to 2.2
-------------------------------
+ functions now may be declared with any "lvalue" as a name
+ garbage collection of functions
+ support for pipes
* Changes from version 1.1 to 2.1
-------------------------------
+ object-oriented support
+ fallbacks
+ simplified syntax for tables
+ many internal improvements
(end of HISTORY)

View File

@ -1,99 +0,0 @@
INSTALL for Lua 5.1
* Building Lua
------------
Lua is built in the src directory, but the build process can be
controlled from the top-level Makefile.
Building Lua on Unix systems should be very easy. First do "make" and
see if your platform is listed. If so, just do "make xxx", where xxx
is your platform name. The platforms currently supported are:
aix ansi bsd freebsd generic linux macosx mingw posix solaris
If your platform is not listed, try the closest one or posix, generic,
ansi, in this order.
See below for customization instructions and for instructions on how
to build with other Windows compilers.
If you want to check that Lua has been built correctly, do "make test"
after building Lua. Also, have a look at the example programs in test.
* Installing Lua
--------------
Once you have built Lua, you may want to install it in an official
place in your system. In this case, do "make install". The official
place and the way to install files are defined in Makefile. You must
have the right permissions to install files.
If you want to build and install Lua in one step, do "make xxx install",
where xxx is your platform name.
If you want to install Lua locally, then do "make local". This will
create directories bin, include, lib, man, and install Lua there as
follows:
bin: lua luac
include: lua.h luaconf.h lualib.h lauxlib.h lua.hpp
lib: liblua.a
man/man1: lua.1 luac.1
These are the only directories you need for development.
There are man pages for lua and luac, in both nroff and html, and a
reference manual in html in doc, some sample code in test, and some
useful stuff in etc. You don't need these directories for development.
If you want to install Lua locally, but in some other directory, do
"make install INSTALL_TOP=xxx", where xxx is your chosen directory.
See below for instructions for Windows and other systems.
* Customization
-------------
Three things can be customized by editing a file:
- Where and how to install Lua -- edit Makefile.
- How to build Lua -- edit src/Makefile.
- Lua features -- edit src/luaconf.h.
You don't actually need to edit the Makefiles because you may set the
relevant variables when invoking make.
On the other hand, if you need to select some Lua features, you'll need
to edit src/luaconf.h. The edited file will be the one installed, and
it will be used by any Lua clients that you build, to ensure consistency.
We strongly recommend that you enable dynamic loading. This is done
automatically for all platforms listed above that have this feature
(and also Windows). See src/luaconf.h and also src/Makefile.
* Building Lua on Windows and other systems
-----------------------------------------
If you're not using the usual Unix tools, then the instructions for
building Lua depend on the compiler you use. You'll need to create
projects (or whatever your compiler uses) for building the library,
the interpreter, and the compiler, as follows:
library: lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
ltable.c ltm.c lundump.c lvm.c lzio.c
lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
ltablib.c lstrlib.c loadlib.c linit.c
interpreter: library, lua.c
compiler: library, luac.c print.c
If you use Visual Studio .NET, you can use etc/luavs.bat in its
"Command Prompt".
If all you want is to build the Lua interpreter, you may put all .c files
in a single project, except for luac.c and print.c. Or just use etc/all.c.
To use Lua as a library in your own programs, you'll need to know how to
create and use libraries with your compiler.
As mentioned above, you may edit luaconf.h to select some features before
building Lua.
(end of INSTALL)

View File

@ -1,128 +0,0 @@
# makefile for installing Lua
# see INSTALL for installation instructions
# see src/Makefile and src/luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= none
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path.
INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
#
# You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
# How to install. If your install program does not support "-p", then you
# may have to run ranlib on the installed liblua.a (do "make ranlib").
INSTALL= install -p
INSTALL_EXEC= $(INSTALL) -m 0755
INSTALL_DATA= $(INSTALL) -m 0644
#
# If you don't have install you can use cp instead.
# INSTALL= cp -p
# INSTALL_EXEC= $(INSTALL)
# INSTALL_DATA= $(INSTALL)
# Utilities.
MKDIR= mkdir -p
RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
# Convenience platforms targets.
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
TO_LIB= liblua.a
TO_MAN= lua.1 luac.1
# Lua version and release.
V= 5.1
R= 5.1.4
all: $(PLAT)
$(PLATS) clean:
cd src && $(MAKE) $@
test: dummy
src/lua test/hello.lua
install: dummy
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
ranlib:
cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
local:
$(MAKE) install INSTALL_TOP=..
none:
@echo "Please do"
@echo " make PLATFORM"
@echo "where PLATFORM is one of these:"
@echo " $(PLATS)"
@echo "See INSTALL for complete instructions."
# make may get confused with test/ and INSTALL in a case-insensitive OS
dummy:
# echo config parameters
echo:
@echo ""
@echo "These are the parameters currently set in src/Makefile to build Lua $R:"
@echo ""
@cd src && $(MAKE) -s echo
@echo ""
@echo "These are the parameters currently set in Makefile to install Lua $R:"
@echo ""
@echo "PLAT = $(PLAT)"
@echo "INSTALL_TOP = $(INSTALL_TOP)"
@echo "INSTALL_BIN = $(INSTALL_BIN)"
@echo "INSTALL_INC = $(INSTALL_INC)"
@echo "INSTALL_LIB = $(INSTALL_LIB)"
@echo "INSTALL_MAN = $(INSTALL_MAN)"
@echo "INSTALL_LMOD = $(INSTALL_LMOD)"
@echo "INSTALL_CMOD = $(INSTALL_CMOD)"
@echo "INSTALL_EXEC = $(INSTALL_EXEC)"
@echo "INSTALL_DATA = $(INSTALL_DATA)"
@echo ""
@echo "See also src/luaconf.h ."
@echo ""
# echo private config parameters
pecho:
@echo "V = $(V)"
@echo "R = $(R)"
@echo "TO_BIN = $(TO_BIN)"
@echo "TO_INC = $(TO_INC)"
@echo "TO_LIB = $(TO_LIB)"
@echo "TO_MAN = $(TO_MAN)"
# echo config parameters as Lua code
# uncomment the last sed expression if you want nil instead of empty strings
lecho:
@echo "-- installation parameters for Lua $R"
@echo "VERSION = '$V'"
@echo "RELEASE = '$R'"
@$(MAKE) echo | grep = | sed -e 's/= /= "/' -e 's/$$/"/' #-e 's/""/nil/'
@echo "-- EOF"
# list targets that do not create files (but not all makes understand .PHONY)
.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
# (end of Makefile)

View File

@ -1,37 +0,0 @@
README for Lua 5.1
See INSTALL for installation instructions.
See HISTORY for a summary of changes since the last released version.
* What is Lua?
------------
Lua is a powerful, light-weight programming language designed for extending
applications. Lua is also frequently used as a general-purpose, stand-alone
language. Lua is free software.
For complete information, visit Lua's web site at http://www.lua.org/ .
For an executive summary, see http://www.lua.org/about.html .
Lua has been used in many different projects around the world.
For a short list, see http://www.lua.org/uses.html .
* Availability
------------
Lua is freely available for both academic and commercial purposes.
See COPYRIGHT and http://www.lua.org/license.html for details.
Lua can be downloaded at http://www.lua.org/download.html .
* Installation
------------
Lua is implemented in pure ANSI C, and compiles unmodified in all known
platforms that have an ANSI C compiler. In most Unix-like platforms, simply
do "make" with a suitable target. See INSTALL for detailed instructions.
* Origin
------
Lua is developed at Lua.org, a laboratory of the Department of Computer
Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro
in Brazil).
For more information about the authors, see http://www.lua.org/authors.html .
(end of README)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

View File

@ -1,499 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Lua 5.1 Reference Manual - contents</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
<STYLE TYPE="text/css">
ul {
list-style-type: none ;
list-style-position: outside ;
}
</STYLE>
</HEAD>
<BODY>
<HR>
<H1>
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="" BORDER=0></A>
Lua 5.1 Reference Manual
</H1>
This is an online version of
<BLOCKQUOTE>
<A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20">
<IMG SRC="cover.png" ALT="" TITLE="buy from Amazon" BORDER=1 ALIGN="left" HSPACE=12>
</A>
<B>Lua 5.1 Reference Manual</B>
<BR>by R. Ierusalimschy, L. H. de Figueiredo, W. Celes
<BR>Lua.org, August 2006
<BR>ISBN 85-903798-3-3
<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20">
<IMG SRC="amazon.gif" ALT="[Buy from Amazon]" BORDER=0></A>
<BR CLEAR="all">
</BLOCKQUOTE>
<P>
Buy a copy of this book and
<A HREF="http://www.lua.org/donations.html">help to support</A>
the Lua project.
<P>
The reference manual is the official definition of the Lua language.
For a complete introduction to Lua programming, see the book
<A HREF="http://www.lua.org/docs.html#books">Programming in Lua</A>.
<P>
<A HREF="manual.html">start</A>
&middot;
<A HREF="#contents">contents</A>
&middot;
<A HREF="#index">index</A>
&middot;
<A HREF="http://www.lua.org/manual/5.1/pt/">português</A>
&middot;
<A HREF="http://www.lua.org/manual/5.1/es/">español</A>
<HR>
<SMALL>
Copyright &copy; 2006-2008 Lua.org, PUC-Rio.
Freely available under the terms of the
<a href="http://www.lua.org/license.html#5">Lua license</a>.
</SMALL>
<P>
<H2><A NAME="contents">Contents</A></H2>
<UL style="padding: 0">
<LI><A HREF="manual.html">1 - Introduction</A>
<P>
<LI><A HREF="manual.html#2">2 - The Language</A>
<UL>
<LI><A HREF="manual.html#2.1">2.1 - Lexical Conventions</A>
<LI><A HREF="manual.html#2.2">2.2 - Values and Types</A>
<UL>
<LI><A HREF="manual.html#2.2.1">2.2.1 - Coercion</A>
</UL>
<LI><A HREF="manual.html#2.3">2.3 - Variables</A>
<LI><A HREF="manual.html#2.4">2.4 - Statements</A>
<UL>
<LI><A HREF="manual.html#2.4.1">2.4.1 - Chunks</A>
<LI><A HREF="manual.html#2.4.2">2.4.2 - Blocks</A>
<LI><A HREF="manual.html#2.4.3">2.4.3 - Assignment</A>
<LI><A HREF="manual.html#2.4.4">2.4.4 - Control Structures</A>
<LI><A HREF="manual.html#2.4.5">2.4.5 - For Statement</A>
<LI><A HREF="manual.html#2.4.6">2.4.6 - Function Calls as Statements</A>
<LI><A HREF="manual.html#2.4.7">2.4.7 - Local Declarations</A>
</UL>
<LI><A HREF="manual.html#2.5">2.5 - Expressions</A>
<UL>
<LI><A HREF="manual.html#2.5.1">2.5.1 - Arithmetic Operators</A>
<LI><A HREF="manual.html#2.5.2">2.5.2 - Relational Operators</A>
<LI><A HREF="manual.html#2.5.3">2.5.3 - Logical Operators</A>
<LI><A HREF="manual.html#2.5.4">2.5.4 - Concatenation</A>
<LI><A HREF="manual.html#2.5.5">2.5.5 - The Length Operator</A>
<LI><A HREF="manual.html#2.5.6">2.5.6 - Precedence</A>
<LI><A HREF="manual.html#2.5.7">2.5.7 - Table Constructors</A>
<LI><A HREF="manual.html#2.5.8">2.5.8 - Function Calls</A>
<LI><A HREF="manual.html#2.5.9">2.5.9 - Function Definitions</A>
</UL>
<LI><A HREF="manual.html#2.6">2.6 - Visibility Rules</A>
<LI><A HREF="manual.html#2.7">2.7 - Error Handling</A>
<LI><A HREF="manual.html#2.8">2.8 - Metatables</A>
<LI><A HREF="manual.html#2.9">2.9 - Environments</A>
<LI><A HREF="manual.html#2.10">2.10 - Garbage Collection</A>
<UL>
<LI><A HREF="manual.html#2.10.1">2.10.1 - Garbage-Collection Metamethods</A>
<LI><A HREF="manual.html#2.10.2">2.10.2 - Weak Tables</A>
</UL>
<LI><A HREF="manual.html#2.11">2.11 - Coroutines</A>
</UL>
<P>
<LI><A HREF="manual.html#3">3 - The Application Program Interface</A>
<UL>
<LI><A HREF="manual.html#3.1">3.1 - The Stack</A>
<LI><A HREF="manual.html#3.2">3.2 - Stack Size</A>
<LI><A HREF="manual.html#3.3">3.3 - Pseudo-Indices</A>
<LI><A HREF="manual.html#3.4">3.4 - C Closures</A>
<LI><A HREF="manual.html#3.5">3.5 - Registry</A>
<LI><A HREF="manual.html#3.6">3.6 - Error Handling in C</A>
<LI><A HREF="manual.html#3.7">3.7 - Functions and Types</A>
<LI><A HREF="manual.html#3.8">3.8 - The Debug Interface</A>
</UL>
<P>
<LI><A HREF="manual.html#4">4 - The Auxiliary Library</A>
<UL>
<LI><A HREF="manual.html#4.1">4.1 - Functions and Types</A>
</UL>
<P>
<LI><A HREF="manual.html#5">5 - Standard Libraries</A>
<UL>
<LI><A HREF="manual.html#5.1">5.1 - Basic Functions</A>
<LI><A HREF="manual.html#5.2">5.2 - Coroutine Manipulation</A>
<LI><A HREF="manual.html#5.3">5.3 - Modules</A>
<LI><A HREF="manual.html#5.4">5.4 - String Manipulation</A>
<UL>
<LI><A HREF="manual.html#5.4.1">5.4.1 - Patterns</A>
</UL>
<LI><A HREF="manual.html#5.5">5.5 - Table Manipulation</A>
<LI><A HREF="manual.html#5.6">5.6 - Mathematical Functions</A>
<LI><A HREF="manual.html#5.7">5.7 - Input and Output Facilities</A>
<LI><A HREF="manual.html#5.8">5.8 - Operating System Facilities</A>
<LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A>
</UL>
<P>
<LI><A HREF="manual.html#6">6 - Lua Stand-alone</A>
<P>
<LI><A HREF="manual.html#7">7 - Incompatibilities with the Previous Version</A>
<UL>
<LI><A HREF="manual.html#7.1">7.1 - Changes in the Language</A>
<LI><A HREF="manual.html#7.2">7.2 - Changes in the Libraries</A>
<LI><A HREF="manual.html#7.3">7.3 - Changes in the API</A>
</UL>
<P>
<LI><A HREF="manual.html#8">8 - The Complete Syntax of Lua</A>
</UL>
<H2><A NAME="index">Index</A></H2>
<TABLE WIDTH="100%">
<TR VALIGN="top">
<TD>
<H3><A NAME="functions">Lua functions</A></H3>
<A HREF="manual.html#pdf-_G">_G</A><BR>
<A HREF="manual.html#pdf-_VERSION">_VERSION</A><BR>
<A HREF="manual.html#pdf-assert">assert</A><BR>
<A HREF="manual.html#pdf-collectgarbage">collectgarbage</A><BR>
<A HREF="manual.html#pdf-dofile">dofile</A><BR>
<A HREF="manual.html#pdf-error">error</A><BR>
<A HREF="manual.html#pdf-getfenv">getfenv</A><BR>
<A HREF="manual.html#pdf-getmetatable">getmetatable</A><BR>
<A HREF="manual.html#pdf-ipairs">ipairs</A><BR>
<A HREF="manual.html#pdf-load">load</A><BR>
<A HREF="manual.html#pdf-loadfile">loadfile</A><BR>
<A HREF="manual.html#pdf-loadstring">loadstring</A><BR>
<A HREF="manual.html#pdf-module">module</A><BR>
<A HREF="manual.html#pdf-next">next</A><BR>
<A HREF="manual.html#pdf-pairs">pairs</A><BR>
<A HREF="manual.html#pdf-pcall">pcall</A><BR>
<A HREF="manual.html#pdf-print">print</A><BR>
<A HREF="manual.html#pdf-rawequal">rawequal</A><BR>
<A HREF="manual.html#pdf-rawget">rawget</A><BR>
<A HREF="manual.html#pdf-rawset">rawset</A><BR>
<A HREF="manual.html#pdf-require">require</A><BR>
<A HREF="manual.html#pdf-select">select</A><BR>
<A HREF="manual.html#pdf-setfenv">setfenv</A><BR>
<A HREF="manual.html#pdf-setmetatable">setmetatable</A><BR>
<A HREF="manual.html#pdf-tonumber">tonumber</A><BR>
<A HREF="manual.html#pdf-tostring">tostring</A><BR>
<A HREF="manual.html#pdf-type">type</A><BR>
<A HREF="manual.html#pdf-unpack">unpack</A><BR>
<A HREF="manual.html#pdf-xpcall">xpcall</A><BR>
<P>
<A HREF="manual.html#pdf-coroutine.create">coroutine.create</A><BR>
<A HREF="manual.html#pdf-coroutine.resume">coroutine.resume</A><BR>
<A HREF="manual.html#pdf-coroutine.running">coroutine.running</A><BR>
<A HREF="manual.html#pdf-coroutine.status">coroutine.status</A><BR>
<A HREF="manual.html#pdf-coroutine.wrap">coroutine.wrap</A><BR>
<A HREF="manual.html#pdf-coroutine.yield">coroutine.yield</A><BR>
<P>
<A HREF="manual.html#pdf-debug.debug">debug.debug</A><BR>
<A HREF="manual.html#pdf-debug.getfenv">debug.getfenv</A><BR>
<A HREF="manual.html#pdf-debug.gethook">debug.gethook</A><BR>
<A HREF="manual.html#pdf-debug.getinfo">debug.getinfo</A><BR>
<A HREF="manual.html#pdf-debug.getlocal">debug.getlocal</A><BR>
<A HREF="manual.html#pdf-debug.getmetatable">debug.getmetatable</A><BR>
<A HREF="manual.html#pdf-debug.getregistry">debug.getregistry</A><BR>
<A HREF="manual.html#pdf-debug.getupvalue">debug.getupvalue</A><BR>
<A HREF="manual.html#pdf-debug.setfenv">debug.setfenv</A><BR>
<A HREF="manual.html#pdf-debug.sethook">debug.sethook</A><BR>
<A HREF="manual.html#pdf-debug.setlocal">debug.setlocal</A><BR>
<A HREF="manual.html#pdf-debug.setmetatable">debug.setmetatable</A><BR>
<A HREF="manual.html#pdf-debug.setupvalue">debug.setupvalue</A><BR>
<A HREF="manual.html#pdf-debug.traceback">debug.traceback</A><BR>
</TD>
<TD>
<H3>&nbsp;</H3>
<A HREF="manual.html#pdf-file:close">file:close</A><BR>
<A HREF="manual.html#pdf-file:flush">file:flush</A><BR>
<A HREF="manual.html#pdf-file:lines">file:lines</A><BR>
<A HREF="manual.html#pdf-file:read">file:read</A><BR>
<A HREF="manual.html#pdf-file:seek">file:seek</A><BR>
<A HREF="manual.html#pdf-file:setvbuf">file:setvbuf</A><BR>
<A HREF="manual.html#pdf-file:write">file:write</A><BR>
<P>
<A HREF="manual.html#pdf-io.close">io.close</A><BR>
<A HREF="manual.html#pdf-io.flush">io.flush</A><BR>
<A HREF="manual.html#pdf-io.input">io.input</A><BR>
<A HREF="manual.html#pdf-io.lines">io.lines</A><BR>
<A HREF="manual.html#pdf-io.open">io.open</A><BR>
<A HREF="manual.html#pdf-io.output">io.output</A><BR>
<A HREF="manual.html#pdf-io.popen">io.popen</A><BR>
<A HREF="manual.html#pdf-io.read">io.read</A><BR>
<A HREF="manual.html#pdf-io.stderr">io.stderr</A><BR>
<A HREF="manual.html#pdf-io.stdin">io.stdin</A><BR>
<A HREF="manual.html#pdf-io.stdout">io.stdout</A><BR>
<A HREF="manual.html#pdf-io.tmpfile">io.tmpfile</A><BR>
<A HREF="manual.html#pdf-io.type">io.type</A><BR>
<A HREF="manual.html#pdf-io.write">io.write</A><BR>
<P>
<A HREF="manual.html#pdf-math.abs">math.abs</A><BR>
<A HREF="manual.html#pdf-math.acos">math.acos</A><BR>
<A HREF="manual.html#pdf-math.asin">math.asin</A><BR>
<A HREF="manual.html#pdf-math.atan">math.atan</A><BR>
<A HREF="manual.html#pdf-math.atan2">math.atan2</A><BR>
<A HREF="manual.html#pdf-math.ceil">math.ceil</A><BR>
<A HREF="manual.html#pdf-math.cos">math.cos</A><BR>
<A HREF="manual.html#pdf-math.cosh">math.cosh</A><BR>
<A HREF="manual.html#pdf-math.deg">math.deg</A><BR>
<A HREF="manual.html#pdf-math.exp">math.exp</A><BR>
<A HREF="manual.html#pdf-math.floor">math.floor</A><BR>
<A HREF="manual.html#pdf-math.fmod">math.fmod</A><BR>
<A HREF="manual.html#pdf-math.frexp">math.frexp</A><BR>
<A HREF="manual.html#pdf-math.huge">math.huge</A><BR>
<A HREF="manual.html#pdf-math.ldexp">math.ldexp</A><BR>
<A HREF="manual.html#pdf-math.log">math.log</A><BR>
<A HREF="manual.html#pdf-math.log10">math.log10</A><BR>
<A HREF="manual.html#pdf-math.max">math.max</A><BR>
<A HREF="manual.html#pdf-math.min">math.min</A><BR>
<A HREF="manual.html#pdf-math.modf">math.modf</A><BR>
<A HREF="manual.html#pdf-math.pi">math.pi</A><BR>
<A HREF="manual.html#pdf-math.pow">math.pow</A><BR>
<A HREF="manual.html#pdf-math.rad">math.rad</A><BR>
<A HREF="manual.html#pdf-math.random">math.random</A><BR>
<A HREF="manual.html#pdf-math.randomseed">math.randomseed</A><BR>
<A HREF="manual.html#pdf-math.sin">math.sin</A><BR>
<A HREF="manual.html#pdf-math.sinh">math.sinh</A><BR>
<A HREF="manual.html#pdf-math.sqrt">math.sqrt</A><BR>
<A HREF="manual.html#pdf-math.tan">math.tan</A><BR>
<A HREF="manual.html#pdf-math.tanh">math.tanh</A><BR>
<P>
<A HREF="manual.html#pdf-os.clock">os.clock</A><BR>
<A HREF="manual.html#pdf-os.date">os.date</A><BR>
<A HREF="manual.html#pdf-os.difftime">os.difftime</A><BR>
<A HREF="manual.html#pdf-os.execute">os.execute</A><BR>
<A HREF="manual.html#pdf-os.exit">os.exit</A><BR>
<A HREF="manual.html#pdf-os.getenv">os.getenv</A><BR>
<A HREF="manual.html#pdf-os.remove">os.remove</A><BR>
<A HREF="manual.html#pdf-os.rename">os.rename</A><BR>
<A HREF="manual.html#pdf-os.setlocale">os.setlocale</A><BR>
<A HREF="manual.html#pdf-os.time">os.time</A><BR>
<A HREF="manual.html#pdf-os.tmpname">os.tmpname</A><BR>
<P>
<A HREF="manual.html#pdf-package.cpath">package.cpath</A><BR>
<A HREF="manual.html#pdf-package.loaded">package.loaded</A><BR>
<A HREF="manual.html#pdf-package.loaders">package.loaders</A><BR>
<A HREF="manual.html#pdf-package.loadlib">package.loadlib</A><BR>
<A HREF="manual.html#pdf-package.path">package.path</A><BR>
<A HREF="manual.html#pdf-package.preload">package.preload</A><BR>
<A HREF="manual.html#pdf-package.seeall">package.seeall</A><BR>
<P>
<A HREF="manual.html#pdf-string.byte">string.byte</A><BR>
<A HREF="manual.html#pdf-string.char">string.char</A><BR>
<A HREF="manual.html#pdf-string.dump">string.dump</A><BR>
<A HREF="manual.html#pdf-string.find">string.find</A><BR>
<A HREF="manual.html#pdf-string.format">string.format</A><BR>
<A HREF="manual.html#pdf-string.gmatch">string.gmatch</A><BR>
<A HREF="manual.html#pdf-string.gsub">string.gsub</A><BR>
<A HREF="manual.html#pdf-string.len">string.len</A><BR>
<A HREF="manual.html#pdf-string.lower">string.lower</A><BR>
<A HREF="manual.html#pdf-string.match">string.match</A><BR>
<A HREF="manual.html#pdf-string.rep">string.rep</A><BR>
<A HREF="manual.html#pdf-string.reverse">string.reverse</A><BR>
<A HREF="manual.html#pdf-string.sub">string.sub</A><BR>
<A HREF="manual.html#pdf-string.upper">string.upper</A><BR>
<P>
<A HREF="manual.html#pdf-table.concat">table.concat</A><BR>
<A HREF="manual.html#pdf-table.insert">table.insert</A><BR>
<A HREF="manual.html#pdf-table.maxn">table.maxn</A><BR>
<A HREF="manual.html#pdf-table.remove">table.remove</A><BR>
<A HREF="manual.html#pdf-table.sort">table.sort</A><BR>
</TD>
<TD>
<H3>C API</H3>
<A HREF="manual.html#lua_Alloc">lua_Alloc</A><BR>
<A HREF="manual.html#lua_CFunction">lua_CFunction</A><BR>
<A HREF="manual.html#lua_Debug">lua_Debug</A><BR>
<A HREF="manual.html#lua_Hook">lua_Hook</A><BR>
<A HREF="manual.html#lua_Integer">lua_Integer</A><BR>
<A HREF="manual.html#lua_Number">lua_Number</A><BR>
<A HREF="manual.html#lua_Reader">lua_Reader</A><BR>
<A HREF="manual.html#lua_State">lua_State</A><BR>
<A HREF="manual.html#lua_Writer">lua_Writer</A><BR>
<P>
<A HREF="manual.html#lua_atpanic">lua_atpanic</A><BR>
<A HREF="manual.html#lua_call">lua_call</A><BR>
<A HREF="manual.html#lua_checkstack">lua_checkstack</A><BR>
<A HREF="manual.html#lua_close">lua_close</A><BR>
<A HREF="manual.html#lua_concat">lua_concat</A><BR>
<A HREF="manual.html#lua_cpcall">lua_cpcall</A><BR>
<A HREF="manual.html#lua_createtable">lua_createtable</A><BR>
<A HREF="manual.html#lua_dump">lua_dump</A><BR>
<A HREF="manual.html#lua_equal">lua_equal</A><BR>
<A HREF="manual.html#lua_error">lua_error</A><BR>
<A HREF="manual.html#lua_gc">lua_gc</A><BR>
<A HREF="manual.html#lua_getallocf">lua_getallocf</A><BR>
<A HREF="manual.html#lua_getfenv">lua_getfenv</A><BR>
<A HREF="manual.html#lua_getfield">lua_getfield</A><BR>
<A HREF="manual.html#lua_getglobal">lua_getglobal</A><BR>
<A HREF="manual.html#lua_gethook">lua_gethook</A><BR>
<A HREF="manual.html#lua_gethookcount">lua_gethookcount</A><BR>
<A HREF="manual.html#lua_gethookmask">lua_gethookmask</A><BR>
<A HREF="manual.html#lua_getinfo">lua_getinfo</A><BR>
<A HREF="manual.html#lua_getlocal">lua_getlocal</A><BR>
<A HREF="manual.html#lua_getmetatable">lua_getmetatable</A><BR>
<A HREF="manual.html#lua_getstack">lua_getstack</A><BR>
<A HREF="manual.html#lua_gettable">lua_gettable</A><BR>
<A HREF="manual.html#lua_gettop">lua_gettop</A><BR>
<A HREF="manual.html#lua_getupvalue">lua_getupvalue</A><BR>
<A HREF="manual.html#lua_insert">lua_insert</A><BR>
<A HREF="manual.html#lua_isboolean">lua_isboolean</A><BR>
<A HREF="manual.html#lua_iscfunction">lua_iscfunction</A><BR>
<A HREF="manual.html#lua_isfunction">lua_isfunction</A><BR>
<A HREF="manual.html#lua_islightuserdata">lua_islightuserdata</A><BR>
<A HREF="manual.html#lua_isnil">lua_isnil</A><BR>
<A HREF="manual.html#lua_isnone">lua_isnone</A><BR>
<A HREF="manual.html#lua_isnoneornil">lua_isnoneornil</A><BR>
<A HREF="manual.html#lua_isnumber">lua_isnumber</A><BR>
<A HREF="manual.html#lua_isstring">lua_isstring</A><BR>
<A HREF="manual.html#lua_istable">lua_istable</A><BR>
<A HREF="manual.html#lua_isthread">lua_isthread</A><BR>
<A HREF="manual.html#lua_isuserdata">lua_isuserdata</A><BR>
<A HREF="manual.html#lua_lessthan">lua_lessthan</A><BR>
<A HREF="manual.html#lua_load">lua_load</A><BR>
<A HREF="manual.html#lua_newstate">lua_newstate</A><BR>
<A HREF="manual.html#lua_newtable">lua_newtable</A><BR>
<A HREF="manual.html#lua_newthread">lua_newthread</A><BR>
<A HREF="manual.html#lua_newuserdata">lua_newuserdata</A><BR>
<A HREF="manual.html#lua_next">lua_next</A><BR>
<A HREF="manual.html#lua_objlen">lua_objlen</A><BR>
<A HREF="manual.html#lua_pcall">lua_pcall</A><BR>
<A HREF="manual.html#lua_pop">lua_pop</A><BR>
<A HREF="manual.html#lua_pushboolean">lua_pushboolean</A><BR>
<A HREF="manual.html#lua_pushcclosure">lua_pushcclosure</A><BR>
<A HREF="manual.html#lua_pushcfunction">lua_pushcfunction</A><BR>
<A HREF="manual.html#lua_pushfstring">lua_pushfstring</A><BR>
<A HREF="manual.html#lua_pushinteger">lua_pushinteger</A><BR>
<A HREF="manual.html#lua_pushlightuserdata">lua_pushlightuserdata</A><BR>
<A HREF="manual.html#lua_pushliteral">lua_pushliteral</A><BR>
<A HREF="manual.html#lua_pushlstring">lua_pushlstring</A><BR>
<A HREF="manual.html#lua_pushnil">lua_pushnil</A><BR>
<A HREF="manual.html#lua_pushnumber">lua_pushnumber</A><BR>
<A HREF="manual.html#lua_pushstring">lua_pushstring</A><BR>
<A HREF="manual.html#lua_pushthread">lua_pushthread</A><BR>
<A HREF="manual.html#lua_pushvalue">lua_pushvalue</A><BR>
<A HREF="manual.html#lua_pushvfstring">lua_pushvfstring</A><BR>
<A HREF="manual.html#lua_rawequal">lua_rawequal</A><BR>
<A HREF="manual.html#lua_rawget">lua_rawget</A><BR>
<A HREF="manual.html#lua_rawgeti">lua_rawgeti</A><BR>
<A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
<A HREF="manual.html#lua_rawseti">lua_rawseti</A><BR>
<A HREF="manual.html#lua_register">lua_register</A><BR>
<A HREF="manual.html#lua_remove">lua_remove</A><BR>
<A HREF="manual.html#lua_replace">lua_replace</A><BR>
<A HREF="manual.html#lua_resume">lua_resume</A><BR>
<A HREF="manual.html#lua_setallocf">lua_setallocf</A><BR>
<A HREF="manual.html#lua_setfenv">lua_setfenv</A><BR>
<A HREF="manual.html#lua_setfield">lua_setfield</A><BR>
<A HREF="manual.html#lua_setglobal">lua_setglobal</A><BR>
<A HREF="manual.html#lua_sethook">lua_sethook</A><BR>
<A HREF="manual.html#lua_setlocal">lua_setlocal</A><BR>
<A HREF="manual.html#lua_setmetatable">lua_setmetatable</A><BR>
<A HREF="manual.html#lua_settable">lua_settable</A><BR>
<A HREF="manual.html#lua_settop">lua_settop</A><BR>
<A HREF="manual.html#lua_setupvalue">lua_setupvalue</A><BR>
<A HREF="manual.html#lua_status">lua_status</A><BR>
<A HREF="manual.html#lua_toboolean">lua_toboolean</A><BR>
<A HREF="manual.html#lua_tocfunction">lua_tocfunction</A><BR>
<A HREF="manual.html#lua_tointeger">lua_tointeger</A><BR>
<A HREF="manual.html#lua_tolstring">lua_tolstring</A><BR>
<A HREF="manual.html#lua_tonumber">lua_tonumber</A><BR>
<A HREF="manual.html#lua_topointer">lua_topointer</A><BR>
<A HREF="manual.html#lua_tostring">lua_tostring</A><BR>
<A HREF="manual.html#lua_tothread">lua_tothread</A><BR>
<A HREF="manual.html#lua_touserdata">lua_touserdata</A><BR>
<A HREF="manual.html#lua_type">lua_type</A><BR>
<A HREF="manual.html#lua_typename">lua_typename</A><BR>
<A HREF="manual.html#lua_upvalueindex">lua_upvalueindex</A><BR>
<A HREF="manual.html#lua_xmove">lua_xmove</A><BR>
<A HREF="manual.html#lua_yield">lua_yield</A><BR>
</TD>
<TD>
<H3>auxiliary library</H3>
<A HREF="manual.html#luaL_Buffer">luaL_Buffer</A><BR>
<A HREF="manual.html#luaL_Reg">luaL_Reg</A><BR>
<P>
<A HREF="manual.html#luaL_addchar">luaL_addchar</A><BR>
<A HREF="manual.html#luaL_addlstring">luaL_addlstring</A><BR>
<A HREF="manual.html#luaL_addsize">luaL_addsize</A><BR>
<A HREF="manual.html#luaL_addstring">luaL_addstring</A><BR>
<A HREF="manual.html#luaL_addvalue">luaL_addvalue</A><BR>
<A HREF="manual.html#luaL_argcheck">luaL_argcheck</A><BR>
<A HREF="manual.html#luaL_argerror">luaL_argerror</A><BR>
<A HREF="manual.html#luaL_buffinit">luaL_buffinit</A><BR>
<A HREF="manual.html#luaL_callmeta">luaL_callmeta</A><BR>
<A HREF="manual.html#luaL_checkany">luaL_checkany</A><BR>
<A HREF="manual.html#luaL_checkint">luaL_checkint</A><BR>
<A HREF="manual.html#luaL_checkinteger">luaL_checkinteger</A><BR>
<A HREF="manual.html#luaL_checklong">luaL_checklong</A><BR>
<A HREF="manual.html#luaL_checklstring">luaL_checklstring</A><BR>
<A HREF="manual.html#luaL_checknumber">luaL_checknumber</A><BR>
<A HREF="manual.html#luaL_checkoption">luaL_checkoption</A><BR>
<A HREF="manual.html#luaL_checkstack">luaL_checkstack</A><BR>
<A HREF="manual.html#luaL_checkstring">luaL_checkstring</A><BR>
<A HREF="manual.html#luaL_checktype">luaL_checktype</A><BR>
<A HREF="manual.html#luaL_checkudata">luaL_checkudata</A><BR>
<A HREF="manual.html#luaL_dofile">luaL_dofile</A><BR>
<A HREF="manual.html#luaL_dostring">luaL_dostring</A><BR>
<A HREF="manual.html#luaL_error">luaL_error</A><BR>
<A HREF="manual.html#luaL_getmetafield">luaL_getmetafield</A><BR>
<A HREF="manual.html#luaL_getmetatable">luaL_getmetatable</A><BR>
<A HREF="manual.html#luaL_gsub">luaL_gsub</A><BR>
<A HREF="manual.html#luaL_loadbuffer">luaL_loadbuffer</A><BR>
<A HREF="manual.html#luaL_loadfile">luaL_loadfile</A><BR>
<A HREF="manual.html#luaL_loadstring">luaL_loadstring</A><BR>
<A HREF="manual.html#luaL_newmetatable">luaL_newmetatable</A><BR>
<A HREF="manual.html#luaL_newstate">luaL_newstate</A><BR>
<A HREF="manual.html#luaL_openlibs">luaL_openlibs</A><BR>
<A HREF="manual.html#luaL_optint">luaL_optint</A><BR>
<A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR>
<A HREF="manual.html#luaL_optlong">luaL_optlong</A><BR>
<A HREF="manual.html#luaL_optlstring">luaL_optlstring</A><BR>
<A HREF="manual.html#luaL_optnumber">luaL_optnumber</A><BR>
<A HREF="manual.html#luaL_optstring">luaL_optstring</A><BR>
<A HREF="manual.html#luaL_prepbuffer">luaL_prepbuffer</A><BR>
<A HREF="manual.html#luaL_pushresult">luaL_pushresult</A><BR>
<A HREF="manual.html#luaL_ref">luaL_ref</A><BR>
<A HREF="manual.html#luaL_register">luaL_register</A><BR>
<A HREF="manual.html#luaL_typename">luaL_typename</A><BR>
<A HREF="manual.html#luaL_typerror">luaL_typerror</A><BR>
<A HREF="manual.html#luaL_unref">luaL_unref</A><BR>
<A HREF="manual.html#luaL_where">luaL_where</A><BR>
</TD>
</TR>
</TABLE>
<P>
<HR>
<SMALL>
Last update:
Sat Jan 19 13:24:29 BRST 2008
</SMALL>
<!--
Last change: revised for Lua 5.1.3
-->
</BODY>
</HTML>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1,163 +0,0 @@
.\" $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $
.TH LUA 1 "$Date: 2006/01/06 16:03:34 $"
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
.B lua
[
.I options
]
[
.I script
[
.I args
]
]
.SH DESCRIPTION
.B lua
is the stand-alone Lua interpreter.
It loads and executes Lua programs,
either in textual source form or
in precompiled binary form.
(Precompiled binaries are output by
.BR luac ,
the Lua compiler.)
.B lua
can be used as a batch interpreter and also interactively.
.LP
The given
.I options
(see below)
are executed and then
the Lua program in file
.I script
is loaded and executed.
The given
.I args
are available to
.I script
as strings in a global table named
.BR arg .
If these arguments contain spaces or other characters special to the shell,
then they should be quoted
(but note that the quotes will be removed by the shell).
The arguments in
.B arg
start at 0,
which contains the string
.RI ' script '.
The index of the last argument is stored in
.BR arg.n .
The arguments given in the command line before
.IR script ,
including the name of the interpreter,
are available in negative indices in
.BR arg .
.LP
At the very start,
before even handling the command line,
.B lua
executes the contents of the environment variable
.BR LUA_INIT ,
if it is defined.
If the value of
.B LUA_INIT
is of the form
.RI '@ filename ',
then
.I filename
is executed.
Otherwise, the string is assumed to be a Lua statement and is executed.
.LP
Options start with
.B '\-'
and are described below.
You can use
.B "'\--'"
to signal the end of options.
.LP
If no arguments are given,
then
.B "\-v \-i"
is assumed when the standard input is a terminal;
otherwise,
.B "\-"
is assumed.
.LP
In interactive mode,
.B lua
prompts the user,
reads lines from the standard input,
and executes them as they are read.
If a line does not contain a complete statement,
then a secondary prompt is displayed and
lines are read until a complete statement is formed or
a syntax error is found.
So, one way to interrupt the reading of an incomplete statement is
to force a syntax error:
adding a
.B ';'
in the middle of a statement is a sure way of forcing a syntax error
(except inside multiline strings and comments; these must be closed explicitly).
If a line starts with
.BR '=' ,
then
.B lua
displays the values of all the expressions in the remainder of the
line. The expressions must be separated by commas.
The primary prompt is the value of the global variable
.BR _PROMPT ,
if this value is a string;
otherwise, the default prompt is used.
Similarly, the secondary prompt is the value of the global variable
.BR _PROMPT2 .
So,
to change the prompts,
set the corresponding variable to a string of your choice.
You can do that after calling the interpreter
or on the command line
(but in this case you have to be careful with quotes
if the prompt string contains a space; otherwise you may confuse the shell.)
The default prompts are "> " and ">> ".
.SH OPTIONS
.TP
.B \-
load and execute the standard input as a file,
that is,
not interactively,
even when the standard input is a terminal.
.TP
.BI \-e " stat"
execute statement
.IR stat .
You need to quote
.I stat
if it contains spaces, quotes,
or other characters special to the shell.
.TP
.B \-i
enter interactive mode after
.I script
is executed.
.TP
.BI \-l " name"
call
.BI require(' name ')
before executing
.IR script .
Typically used to load libraries.
.TP
.B \-v
show version information.
.SH "SEE ALSO"
.BR luac (1)
.br
http://www.lua.org/
.SH DIAGNOSTICS
Error messages should be self explanatory.
.SH AUTHORS
R. Ierusalimschy,
L. H. de Figueiredo,
and
W. Celes
.\" EOF

View File

@ -1,41 +0,0 @@
body {
color: #000000 ;
background-color: #FFFFFF ;
font-family: sans-serif ;
text-align: justify ;
margin-right: 20px ;
margin-left: 20px ;
}
h1, h2, h3, h4 {
font-weight: normal ;
font-style: italic ;
}
a:link {
color: #000080 ;
background-color: inherit ;
text-decoration: none ;
}
a:visited {
background-color: inherit ;
text-decoration: none ;
}
a:link:hover, a:visited:hover {
color: #000080 ;
background-color: #E0E0FF ;
}
a:link:active, a:visited:active {
color: #FF0000 ;
}
hr {
border: 0 ;
height: 1px ;
color: #a0a0a0 ;
background-color: #a0a0a0 ;
}

View File

@ -1,172 +0,0 @@
<!-- $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $ -->
<HTML>
<HEAD>
<TITLE>LUA man page</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>NAME</H2>
lua - Lua interpreter
<H2>SYNOPSIS</H2>
<B>lua</B>
[
<I>options</I>
]
[
<I>script</I>
[
<I>args</I>
]
]
<H2>DESCRIPTION</H2>
<B>lua</B>
is the stand-alone Lua interpreter.
It loads and executes Lua programs,
either in textual source form or
in precompiled binary form.
(Precompiled binaries are output by
<B>luac</B>,
the Lua compiler.)
<B>lua</B>
can be used as a batch interpreter and also interactively.
<P>
The given
<I>options</I>
(see below)
are executed and then
the Lua program in file
<I>script</I>
is loaded and executed.
The given
<I>args</I>
are available to
<I>script</I>
as strings in a global table named
<B>arg</B>.
If these arguments contain spaces or other characters special to the shell,
then they should be quoted
(but note that the quotes will be removed by the shell).
The arguments in
<B>arg</B>
start at 0,
which contains the string
'<I>script</I>'.
The index of the last argument is stored in
<B>arg.n</B>.
The arguments given in the command line before
<I>script</I>,
including the name of the interpreter,
are available in negative indices in
<B>arg</B>.
<P>
At the very start,
before even handling the command line,
<B>lua</B>
executes the contents of the environment variable
<B>LUA_INIT</B>,
if it is defined.
If the value of
<B>LUA_INIT</B>
is of the form
'@<I>filename</I>',
then
<I>filename</I>
is executed.
Otherwise, the string is assumed to be a Lua statement and is executed.
<P>
Options start with
<B>'-'</B>
and are described below.
You can use
<B>'--'</B>
to signal the end of options.
<P>
If no arguments are given,
then
<B>"-v -i"</B>
is assumed when the standard input is a terminal;
otherwise,
<B>"-"</B>
is assumed.
<P>
In interactive mode,
<B>lua</B>
prompts the user,
reads lines from the standard input,
and executes them as they are read.
If a line does not contain a complete statement,
then a secondary prompt is displayed and
lines are read until a complete statement is formed or
a syntax error is found.
So, one way to interrupt the reading of an incomplete statement is
to force a syntax error:
adding a
<B>';'</B>
in the middle of a statement is a sure way of forcing a syntax error
(except inside multiline strings and comments; these must be closed explicitly).
If a line starts with
<B>'='</B>,
then
<B>lua</B>
displays the values of all the expressions in the remainder of the
line. The expressions must be separated by commas.
The primary prompt is the value of the global variable
<B>_PROMPT</B>,
if this value is a string;
otherwise, the default prompt is used.
Similarly, the secondary prompt is the value of the global variable
<B>_PROMPT2</B>.
So,
to change the prompts,
set the corresponding variable to a string of your choice.
You can do that after calling the interpreter
or on the command line
(but in this case you have to be careful with quotes
if the prompt string contains a space; otherwise you may confuse the shell.)
The default prompts are "&gt; " and "&gt;&gt; ".
<H2>OPTIONS</H2>
<P>
<B>-</B>
load and execute the standard input as a file,
that is,
not interactively,
even when the standard input is a terminal.
<P>
<B>-e </B><I>stat</I>
execute statement
<I>stat</I>.
You need to quote
<I>stat </I>
if it contains spaces, quotes,
or other characters special to the shell.
<P>
<B>-i</B>
enter interactive mode after
<I>script</I>
is executed.
<P>
<B>-l </B><I>name</I>
call
<B>require</B>('<I>name</I>')
before executing
<I>script</I>.
Typically used to load libraries.
<P>
<B>-v</B>
show version information.
<H2>SEE ALSO</H2>
<B>luac</B>(1)
<BR>
<A HREF="http://www.lua.org/">http://www.lua.org/</A>
<H2>DIAGNOSTICS</H2>
Error messages should be self explanatory.
<H2>AUTHORS</H2>
R. Ierusalimschy,
L. H. de Figueiredo,
and
W. Celes
<!-- EOF -->
</BODY>
</HTML>

View File

@ -1,136 +0,0 @@
.\" $Id: luac.man,v 1.28 2006/01/06 16:03:34 lhf Exp $
.TH LUAC 1 "$Date: 2006/01/06 16:03:34 $"
.SH NAME
luac \- Lua compiler
.SH SYNOPSIS
.B luac
[
.I options
] [
.I filenames
]
.SH DESCRIPTION
.B luac
is the Lua compiler.
It translates programs written in the Lua programming language
into binary files that can be later loaded and executed.
.LP
The main advantages of precompiling chunks are:
faster loading,
protecting source code from accidental user changes,
and
off-line syntax checking.
.LP
Pre-compiling does not imply faster execution
because in Lua chunks are always compiled into bytecodes before being executed.
.B luac
simply allows those bytecodes to be saved in a file for later execution.
.LP
Pre-compiled chunks are not necessarily smaller than the corresponding source.
The main goal in pre-compiling is faster loading.
.LP
The binary files created by
.B luac
are portable only among architectures with the same word size and byte order.
.LP
.B luac
produces a single output file containing the bytecodes
for all source files given.
By default,
the output file is named
.BR luac.out ,
but you can change this with the
.B \-o
option.
.LP
In the command line,
you can mix
text files containing Lua source and
binary files containing precompiled chunks.
This is useful to combine several precompiled chunks,
even from different (but compatible) platforms,
into a single precompiled chunk.
.LP
You can use
.B "'\-'"
to indicate the standard input as a source file
and
.B "'\--'"
to signal the end of options
(that is,
all remaining arguments will be treated as files even if they start with
.BR "'\-'" ).
.LP
The internal format of the binary files produced by
.B luac
is likely to change when a new version of Lua is released.
So,
save the source files of all Lua programs that you precompile.
.LP
.SH OPTIONS
Options must be separate.
.TP
.B \-l
produce a listing of the compiled bytecode for Lua's virtual machine.
Listing bytecodes is useful to learn about Lua's virtual machine.
If no files are given, then
.B luac
loads
.B luac.out
and lists its contents.
.TP
.BI \-o " file"
output to
.IR file ,
instead of the default
.BR luac.out .
(You can use
.B "'\-'"
for standard output,
but not on platforms that open standard output in text mode.)
The output file may be a source file because
all files are loaded before the output file is written.
Be careful not to overwrite precious files.
.TP
.B \-p
load files but do not generate any output file.
Used mainly for syntax checking and for testing precompiled chunks:
corrupted files will probably generate errors when loaded.
Lua always performs a thorough integrity test on precompiled chunks.
Bytecode that passes this test is completely safe,
in the sense that it will not break the interpreter.
However,
there is no guarantee that such code does anything sensible.
(None can be given, because the halting problem is unsolvable.)
If no files are given, then
.B luac
loads
.B luac.out
and tests its contents.
No messages are displayed if the file passes the integrity test.
.TP
.B \-s
strip debug information before writing the output file.
This saves some space in very large chunks,
but if errors occur when running a stripped chunk,
then the error messages may not contain the full information they usually do.
For instance,
line numbers and names of local variables are lost.
.TP
.B \-v
show version information.
.SH FILES
.TP 15
.B luac.out
default output file
.SH "SEE ALSO"
.BR lua (1)
.br
http://www.lua.org/
.SH DIAGNOSTICS
Error messages should be self explanatory.
.SH AUTHORS
L. H. de Figueiredo,
R. Ierusalimschy and
W. Celes
.\" EOF

View File

@ -1,145 +0,0 @@
<!-- $Id: luac.man,v 1.28 2006/01/06 16:03:34 lhf Exp $ -->
<HTML>
<HEAD>
<TITLE>LUAC man page</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>NAME</H2>
luac - Lua compiler
<H2>SYNOPSIS</H2>
<B>luac</B>
[
<I>options</I>
] [
<I>filenames</I>
]
<H2>DESCRIPTION</H2>
<B>luac</B>
is the Lua compiler.
It translates programs written in the Lua programming language
into binary files that can be later loaded and executed.
<P>
The main advantages of precompiling chunks are:
faster loading,
protecting source code from accidental user changes,
and
off-line syntax checking.
<P>
Precompiling does not imply faster execution
because in Lua chunks are always compiled into bytecodes before being executed.
<B>luac</B>
simply allows those bytecodes to be saved in a file for later execution.
<P>
Precompiled chunks are not necessarily smaller than the corresponding source.
The main goal in precompiling is faster loading.
<P>
The binary files created by
<B>luac</B>
are portable only among architectures with the same word size and byte order.
<P>
<B>luac</B>
produces a single output file containing the bytecodes
for all source files given.
By default,
the output file is named
<B>luac.out</B>,
but you can change this with the
<B>-o</B>
option.
<P>
In the command line,
you can mix
text files containing Lua source and
binary files containing precompiled chunks.
This is useful because several precompiled chunks,
even from different (but compatible) platforms,
can be combined into a single precompiled chunk.
<P>
You can use
<B>'-'</B>
to indicate the standard input as a source file
and
<B>'--'</B>
to signal the end of options
(that is,
all remaining arguments will be treated as files even if they start with
<B>'-'</B>).
<P>
The internal format of the binary files produced by
<B>luac</B>
is likely to change when a new version of Lua is released.
So,
save the source files of all Lua programs that you precompile.
<P>
<H2>OPTIONS</H2>
Options must be separate.
<P>
<B>-l</B>
produce a listing of the compiled bytecode for Lua's virtual machine.
Listing bytecodes is useful to learn about Lua's virtual machine.
If no files are given, then
<B>luac</B>
loads
<B>luac.out</B>
and lists its contents.
<P>
<B>-o </B><I>file</I>
output to
<I>file</I>,
instead of the default
<B>luac.out</B>.
(You can use
<B>'-'</B>
for standard output,
but not on platforms that open standard output in text mode.)
The output file may be a source file because
all files are loaded before the output file is written.
Be careful not to overwrite precious files.
<P>
<B>-p</B>
load files but do not generate any output file.
Used mainly for syntax checking and for testing precompiled chunks:
corrupted files will probably generate errors when loaded.
Lua always performs a thorough integrity test on precompiled chunks.
Bytecode that passes this test is completely safe,
in the sense that it will not break the interpreter.
However,
there is no guarantee that such code does anything sensible.
(None can be given, because the halting problem is unsolvable.)
If no files are given, then
<B>luac</B>
loads
<B>luac.out</B>
and tests its contents.
No messages are displayed if the file passes the integrity test.
<P>
<B>-s</B>
strip debug information before writing the output file.
This saves some space in very large chunks,
but if errors occur when running a stripped chunk,
then the error messages may not contain the full information they usually do.
For instance,
line numbers and names of local variables are lost.
<P>
<B>-v</B>
show version information.
<H2>FILES</H2>
<P>
<B>luac.out</B>
default output file
<H2>SEE ALSO</H2>
<B>lua</B>(1)
<BR>
<A HREF="http://www.lua.org/">http://www.lua.org/</A>
<H2>DIAGNOSTICS</H2>
Error messages should be self explanatory.
<H2>AUTHORS</H2>
L. H. de Figueiredo,
R. Ierusalimschy and
W. Celes
<!-- EOF -->
</BODY>
</HTML>

View File

@ -1,13 +0,0 @@
h3 code {
font-family: inherit ;
}
pre {
font-size: 105% ;
}
span.apii {
float: right ;
font-family: inherit ;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
<HTML>
<HEAD>
<TITLE>Lua documentation</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
</HEAD>
<BODY>
<HR>
<H1>
<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A>
Documentation
</H1>
This is the documentation included in the source distribution of Lua 5.1.4.
<UL>
<LI><A HREF="contents.html">Reference manual</A>
<LI><A HREF="lua.html">lua man page</A>
<LI><A HREF="luac.html">luac man page</A>
<LI><A HREF="../README">lua/README</A>
<LI><A HREF="../etc/README">lua/etc/README</A>
<LI><A HREF="../test/README">lua/test/README</A>
</UL>
Lua's
<A HREF="http://www.lua.org/">official web site</A>
contains updated documentation,
especially the
<A HREF="http://www.lua.org/manual/5.1/">reference manual</A>.
<P>
<HR>
<SMALL>
Last update:
Tue Aug 12 14:46:07 BRT 2008
</SMALL>
</BODY>
</HTML>

View File

@ -1,44 +0,0 @@
# makefile for Lua etc
TOP= ..
LIB= $(TOP)/src
INC= $(TOP)/src
BIN= $(TOP)/src
SRC= $(TOP)/src
TST= $(TOP)/test
CC= gcc
CFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS)
MYCFLAGS=
MYLDFLAGS= -Wl,-E
MYLIBS= -lm
#MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
RM= rm -f
default:
@echo 'Please choose a target: min noparser one strict clean'
min: min.c
$(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
echo 'print"Hello there!"' | ./a.out
noparser: noparser.o
$(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS)
$(BIN)/luac $(TST)/hello.lua
-./a.out luac.out
-./a.out -e'a=1'
one:
$(CC) $(CFLAGS) all.c $(MYLIBS)
./a.out $(TST)/hello.lua
strict:
-$(BIN)/lua -e 'print(a);b=2'
-$(BIN)/lua -lstrict -e 'print(a)'
-$(BIN)/lua -e 'function f() b=2 end f()'
-$(BIN)/lua -lstrict -e 'function f() b=2 end f()'
clean:
$(RM) a.out core core.* *.o luac.out
.PHONY: default min noparser one strict clean

View File

@ -1,37 +0,0 @@
This directory contains some useful files and code.
Unlike the code in ../src, everything here is in the public domain.
If any of the makes fail, you're probably not using the same libraries
used to build Lua. Set MYLIBS in Makefile accordingly.
all.c
Full Lua interpreter in a single file.
Do "make one" for a demo.
lua.hpp
Lua header files for C++ using 'extern "C"'.
lua.ico
A Lua icon for Windows (and web sites: save as favicon.ico).
Drawn by hand by Markus Gritsch <gritsch@iue.tuwien.ac.at>.
lua.pc
pkg-config data for Lua
luavs.bat
Script to build Lua under "Visual Studio .NET Command Prompt".
Run it from the toplevel as etc\luavs.bat.
min.c
A minimal Lua interpreter.
Good for learning and for starting your own.
Do "make min" for a demo.
noparser.c
Linking with noparser.o avoids loading the parsing modules in lualib.a.
Do "make noparser" for a demo.
strict.lua
Traps uses of undeclared global variables.
Do "make strict" for a demo.

View File

@ -1,38 +0,0 @@
/*
* all.c -- Lua core, libraries and interpreter in a single file
*/
#define luaall_c
#include "lapi.c"
#include "lcode.c"
#include "ldebug.c"
#include "ldo.c"
#include "ldump.c"
#include "lfunc.c"
#include "lgc.c"
#include "llex.c"
#include "lmem.c"
#include "lobject.c"
#include "lopcodes.c"
#include "lparser.c"
#include "lstate.c"
#include "lstring.c"
#include "ltable.c"
#include "ltm.c"
#include "lundump.c"
#include "lvm.c"
#include "lzio.c"
#include "lauxlib.c"
#include "lbaselib.c"
#include "ldblib.c"
#include "liolib.c"
#include "linit.c"
#include "lmathlib.c"
#include "loadlib.c"
#include "loslib.c"
#include "lstrlib.c"
#include "ltablib.c"
#include "lua.c"

View File

@ -1,9 +0,0 @@
// lua.hpp
// Lua header files for C++
// <<extern "C">> not supplied automatically because Lua also compiles as C++
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,31 +0,0 @@
# lua.pc -- pkg-config data for Lua
# vars from install Makefile
# grep '^V=' ../Makefile
V= 5.1
# grep '^R=' ../Makefile
R= 5.1.4
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local
INSTALL_BIN= ${prefix}/bin
INSTALL_INC= ${prefix}/include
INSTALL_LIB= ${prefix}/lib
INSTALL_MAN= ${prefix}/man/man1
INSTALL_LMOD= ${prefix}/share/lua/${V}
INSTALL_CMOD= ${prefix}/lib/lua/${V}
# canonical vars
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
Libs: -L${libdir} -llua -lm
Cflags: -I${includedir}
# (end of lua.pc)

View File

@ -1,28 +0,0 @@
@rem Script to build Lua under "Visual Studio .NET Command Prompt".
@rem Do not run from this directory; run it from the toplevel: etc\luavs.bat .
@rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src.
@rem (contributed by David Manura and Mike Pall)
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
@set MYLINK=link /nologo
@set MYMT=mt /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua51.dll l*.obj
if exist lua51.dll.manifest^
%MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua51.lib
if exist lua.exe.manifest^
%MYMT% -manifest lua.exe.manifest -outputresource:lua.exe
%MYCOMPILE% l*.c print.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^
loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
if exist luac.exe.manifest^
%MYMT% -manifest luac.exe.manifest -outputresource:luac.exe
del *.obj *.manifest
cd ..

View File

@ -1,39 +0,0 @@
/*
* min.c -- a minimal Lua interpreter
* loads stdin only with minimal error handling.
* no interaction, and no standard library, only a "print" function.
*/
#include <stdio.h>
#include "lua.h"
#include "lauxlib.h"
static int print(lua_State *L)
{
int n=lua_gettop(L);
int i;
for (i=1; i<=n; i++)
{
if (i>1) printf("\t");
if (lua_isstring(L,i))
printf("%s",lua_tostring(L,i));
else if (lua_isnil(L,i))
printf("%s","nil");
else if (lua_isboolean(L,i))
printf("%s",lua_toboolean(L,i) ? "true" : "false");
else
printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i));
}
printf("\n");
return 0;
}
int main(void)
{
lua_State *L=lua_open();
lua_register(L,"print",print);
if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1));
lua_close(L);
return 0;
}

View File

@ -1,50 +0,0 @@
/*
* The code below can be used to make a Lua core that does not contain the
* parsing modules (lcode, llex, lparser), which represent 35% of the total core.
* You'll only be able to load binary files and strings, precompiled with luac.
* (Of course, you'll have to build luac with the original parsing modules!)
*
* To use this module, simply compile it ("make noparser" does that) and list
* its object file before the Lua libraries. The linker should then not load
* the parsing modules. To try it, do "make luab".
*
* If you also want to avoid the dump module (ldump.o), define NODUMP.
* #define NODUMP
*/
#define LUA_CORE
#include "llex.h"
#include "lparser.h"
#include "lzio.h"
LUAI_FUNC void luaX_init (lua_State *L) {
UNUSED(L);
}
LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
UNUSED(z);
UNUSED(buff);
UNUSED(name);
lua_pushliteral(L,"parser not loaded");
lua_error(L);
return NULL;
}
#ifdef NODUMP
#include "lundump.h"
LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) {
UNUSED(f);
UNUSED(w);
UNUSED(data);
UNUSED(strip);
#if 1
UNUSED(L);
return 0;
#else
lua_pushliteral(L,"dumper not loaded");
lua_error(L);
#endif
}
#endif

View File

@ -1,41 +0,0 @@
--
-- strict.lua
-- checks uses of undeclared global variables
-- All global variables must be 'declared' through a regular assignment
-- (even assigning nil will do) in a main chunk before being used
-- anywhere or assigned to inside a function.
--
local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget
local mt = getmetatable(_G)
if mt == nil then
mt = {}
setmetatable(_G, mt)
end
mt.__declared = {}
local function what ()
local d = getinfo(3, "S")
return d and d.what or "C"
end
mt.__newindex = function (t, n, v)
if not mt.__declared[n] then
local w = what()
if w ~= "main" and w ~= "C" then
error("assign to undeclared variable '"..n.."'", 2)
end
mt.__declared[n] = true
end
rawset(t, n, v)
end
mt.__index = function (t, n)
if not mt.__declared[n] and what() ~= "C" then
error("variable '"..n.."' is not declared", 2)
end
return rawget(t, n)
end

View File

@ -1,182 +0,0 @@
# makefile for building Lua
# see ../INSTALL for installation instructions
# see ../Makefile and luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= none
CC= gcc
CFLAGS= -O2 -Wall $(MYCFLAGS)
AR= ar rcu
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)
MYCFLAGS=
MYLDFLAGS=
MYLIBS=
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
lundump.o lvm.o lzio.o
LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
lstrlib.o loadlib.o linit.o
LUA_T= lua
LUA_O= lua.o
LUAC_T= luac
LUAC_O= luac.o print.o
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
default: $(PLAT)
all: $(ALL_T)
o: $(ALL_O)
a: $(ALL_A)
$(LUA_A): $(CORE_O) $(LIB_O)
$(AR) $@ $?
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
depend:
@$(CC) $(CFLAGS) -MM l*.c print.c
echo:
@echo "PLAT = $(PLAT)"
@echo "CC = $(CC)"
@echo "CFLAGS = $(CFLAGS)"
@echo "AR = $(AR)"
@echo "RANLIB = $(RANLIB)"
@echo "RM = $(RM)"
@echo "MYCFLAGS = $(MYCFLAGS)"
@echo "MYLDFLAGS = $(MYLDFLAGS)"
@echo "MYLIBS = $(MYLIBS)"
# convenience targets for popular platforms
none:
@echo "Please choose a platform:"
@echo " $(PLATS)"
aix:
$(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
ansi:
$(MAKE) all MYCFLAGS=-DLUA_ANSI
bsd:
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
freebsd:
$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
generic:
$(MAKE) all MYCFLAGS=
linux:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
macosx:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
# use this on Mac OS X 10.3-
# $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
mingw:
$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
"AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
$(MAKE) "LUAC_T=luac.exe" luac.exe
posix:
$(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
solaris:
$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
# list targets that do not create files (but not all makes understand .PHONY)
.PHONY: all $(PLATS) default o a clean depend echo none
# DO NOT DELETE
lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
lundump.h lvm.h
lauxlib.o: lauxlib.c lua.h luaconf.h lauxlib.h
lbaselib.o: lbaselib.c lua.h luaconf.h lauxlib.h lualib.h
lcode.o: lcode.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h lgc.h \
ltable.h
ldblib.o: ldblib.c lua.h luaconf.h lauxlib.h lualib.h
ldebug.o: ldebug.c lua.h luaconf.h lapi.h lobject.h llimits.h lcode.h \
llex.h lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
lfunc.h lstring.h lgc.h ltable.h lvm.h
ldo.o: ldo.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lparser.h lstring.h \
ltable.h lundump.h lvm.h
ldump.o: ldump.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h \
lzio.h lmem.h lundump.h
lfunc.o: lfunc.c lua.h luaconf.h lfunc.h lobject.h llimits.h lgc.h lmem.h \
lstate.h ltm.h lzio.h
lgc.o: lgc.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
linit.o: linit.c lua.h luaconf.h lualib.h lauxlib.h
liolib.o: liolib.c lua.h luaconf.h lauxlib.h lualib.h
llex.o: llex.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h ltm.h \
lzio.h lmem.h llex.h lparser.h lstring.h lgc.h ltable.h
lmathlib.o: lmathlib.c lua.h luaconf.h lauxlib.h lualib.h
lmem.o: lmem.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h
loadlib.o: loadlib.c lua.h luaconf.h lauxlib.h lualib.h
lobject.o: lobject.c lua.h luaconf.h ldo.h lobject.h llimits.h lstate.h \
ltm.h lzio.h lmem.h lstring.h lgc.h lvm.h
lopcodes.o: lopcodes.c lopcodes.h llimits.h lua.h luaconf.h
loslib.o: loslib.c lua.h luaconf.h lauxlib.h lualib.h
lparser.o: lparser.c lua.h luaconf.h lcode.h llex.h lobject.h llimits.h \
lzio.h lmem.h lopcodes.h lparser.h ldebug.h lstate.h ltm.h ldo.h \
lfunc.h lstring.h lgc.h ltable.h
lstate.o: lstate.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h llex.h lstring.h ltable.h
lstring.o: lstring.c lua.h luaconf.h lmem.h llimits.h lobject.h lstate.h \
ltm.h lzio.h lstring.h lgc.h
lstrlib.o: lstrlib.c lua.h luaconf.h lauxlib.h lualib.h
ltable.o: ltable.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h \
ltm.h lzio.h lmem.h ldo.h lgc.h ltable.h
ltablib.o: ltablib.c lua.h luaconf.h lauxlib.h lualib.h
ltm.o: ltm.c lua.h luaconf.h lobject.h llimits.h lstate.h ltm.h lzio.h \
lmem.h lstring.h lgc.h ltable.h
lua.o: lua.c lua.h luaconf.h lauxlib.h lualib.h
luac.o: luac.c lua.h luaconf.h lauxlib.h ldo.h lobject.h llimits.h \
lstate.h ltm.h lzio.h lmem.h lfunc.h lopcodes.h lstring.h lgc.h \
lundump.h
lundump.o: lundump.c lua.h luaconf.h ldebug.h lstate.h lobject.h \
llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lstring.h lgc.h lundump.h
lvm.o: lvm.c lua.h luaconf.h ldebug.h lstate.h lobject.h llimits.h ltm.h \
lzio.h lmem.h ldo.h lfunc.h lgc.h lopcodes.h lstring.h ltable.h lvm.h
lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
lzio.h
print.o: print.c ldebug.h lstate.h lua.h luaconf.h lobject.h llimits.h \
ltm.h lzio.h lmem.h lopcodes.h lundump.h
# (end of Makefile)

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More