This commit is contained in:
Happy 2015-03-24 18:26:59 -06:00
commit ba1c0f799a
443 changed files with 17078 additions and 5265 deletions

View File

@ -353,6 +353,9 @@
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
#pragma GCC diagnostic ignored "-Wunused-parameter" // warning: unused parameter xxxx
#pragma GCC diagnostic ignored "-Wtype-limits" // warning: comparison is always true due to limited range of data type
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // warning: xxxx may be used uninitialized in this function
#endif
//-------------------------------------------------------------------------
@ -5618,8 +5621,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
// From the moment we focused we are ignoring the content of 'buf'
ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf);
const char* buf_end = NULL;
edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
edit_state.CurLenW = (int)ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
edit_state.Width = w;
edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f);
edit_state.CursorAnimReset();

View File

@ -4,7 +4,8 @@
What is it?
-----------
Cross-platform rendering library.
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style
rendering library.
Supported rendering backends:
@ -319,18 +320,27 @@ Building
Steps bellow are for default build system inside bgfx repository. There is
alterative way to build bgfx and examples with [fips](https://github.com/floooh/fips-bgfx/#fips-bgfx).
### Prerequisites
Windows users download GnuWin32 utilities from:
[http://gnuwin32.sourceforge.net/packages/make.htm](http://gnuwin32.sourceforge.net/packages/make.htm)
[http://gnuwin32.sourceforge.net/packages/coreutils.htm](http://gnuwin32.sourceforge.net/packages/coreutils.htm)
[http://gnuwin32.sourceforge.net/packages/libiconv.htm](http://gnuwin32.sourceforge.net/packages/libiconv.htm)
[http://gnuwin32.sourceforge.net/packages/libintl.htm](http://gnuwin32.sourceforge.net/packages/libintl.htm)
### Getting source
git clone git://github.com/bkaradzic/bx.git
git clone git://github.com/bkaradzic/bgfx.git
### Quick start (Windows with Visual Studio)
Enter bgfx directory:
cd bgfx
Generate Visual Studio 2013 project files:
..\bx\tools\bin\windows\genie vs2013
Open bgfx solution in Visual Studio 2013:
start .build\projects\vs2013\bgfx.sln
### Generating project files for all targets
cd bgfx
make
@ -361,6 +371,12 @@ Download Native Client SDK from:
### Prerequisites for Windows
Windows users download GnuWin32 utilities from:
[http://gnuwin32.sourceforge.net/packages/make.htm](http://gnuwin32.sourceforge.net/packages/make.htm)
[http://gnuwin32.sourceforge.net/packages/coreutils.htm](http://gnuwin32.sourceforge.net/packages/coreutils.htm)
[http://gnuwin32.sourceforge.net/packages/libiconv.htm](http://gnuwin32.sourceforge.net/packages/libiconv.htm)
[http://gnuwin32.sourceforge.net/packages/libintl.htm](http://gnuwin32.sourceforge.net/packages/libintl.htm)
When building on Windows, you have to set DXSDK_DIR environment variable to
point to DirectX SDK directory.

View File

@ -0,0 +1,17 @@
$input v_texcoord0
/*
* Copyright 2011-2015 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
#include "../common/common.sh"
SAMPLER3D(u_texColor, 0);
uniform float u_time;
void main()
{
vec3 uvw = vec3(v_texcoord0.xy*0.5+0.5, sin(u_time)*0.5+0.5);
gl_FragColor = vec4_splat(texture3D(u_texColor, uvw).x);
}

View File

@ -149,6 +149,31 @@ int _main_(int /*_argc*/, char** /*_argv*/)
loadTexture("texture_compression_ptc24.pvr"),
};
const bgfx::Memory* mem8 = bgfx::alloc(32*32*32);
const bgfx::Memory* mem16f = bgfx::alloc(32*32*32*2);
const bgfx::Memory* mem32f = bgfx::alloc(32*32*32*4);
for (uint8_t zz = 0; zz < 32; ++zz)
{
for (uint8_t yy = 0; yy < 32; ++yy)
{
for (uint8_t xx = 0; xx < 32; ++xx)
{
const uint32_t offset = ( (zz*32+yy)*32+xx);
const uint32_t val = xx ^ yy ^ zz;
mem8->data[offset] = val<<3;
*(uint16_t*)&mem16f->data[offset*2] = bx::halfFromFloat( (float)val/32.0f);
*(float*)&mem32f->data[offset*4] = (float)val/32.0f;
}
}
}
bgfx::TextureHandle textures3d[] =
{
bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem8),
bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R16F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem16f),
bgfx::createTexture3D(32, 32, 32, 0, bgfx::TextureFormat::R32F, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_W_CLAMP, mem32f),
};
// Create static vertex buffer.
bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) ), PosTexcoordVertex::ms_decl);
@ -156,12 +181,14 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
// Create texture sampler uniforms.
bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv);
bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv);
bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update");
bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp");
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update");
bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp");
bgfx::ProgramHandle program3d = loadProgram("vs_update", "fs_update_3d");
const uint32_t textureSide = 2048;
@ -210,6 +237,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
const int64_t freq = bx::getHPFrequency();
const double toMs = 1000.0/double(freq);
float time = (float)( (now - timeOffset)/double(bx::getHPFrequency() ) );
bgfx::setUniform(u_time, &time);
// Use debug font to print information about this example.
bgfx::dbgTextClear();
@ -345,10 +373,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Submit primitive for rendering to view 1.
bgfx::submit(1);
const float xpos = -8.0f - BX_COUNTOF(textures)*0.1f*0.5f;
for (uint32_t ii = 0; ii < BX_COUNTOF(textures); ++ii)
{
bx::mtxTranslate(mtx, -8.0f - BX_COUNTOF(textures)*0.1f*0.5f + ii*2.1f, 4.0f, 0.0f);
bx::mtxTranslate(mtx, xpos + ii*2.1f, 4.0f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
@ -370,9 +399,33 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::submit(1);
}
for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii)
{
bx::mtxTranslate(mtx, xpos + ii*2.1f, -4.0f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
// Set vertex and fragment shaders.
bgfx::setProgram(program3d);
// Set vertex and index buffer.
bgfx::setVertexBuffer(vbh);
bgfx::setIndexBuffer(ibh, 0, 6);
// Bind texture.
bgfx::setTexture(0, u_texColor, textures3d[ii]);
// Set render states.
bgfx::setState(BGFX_STATE_DEFAULT);
// Submit primitive for rendering to view 1.
bgfx::submit(1);
}
for (uint32_t ii = 0; ii < 3; ++ii)
{
bx::mtxTranslate(mtx, -8.0f - BX_COUNTOF(textures)*0.1f*0.5f + 8*2.1f, -4.0f + ii*2.1f, 0.0f);
bx::mtxTranslate(mtx, xpos + 8*2.1f, -4.0f + ii*2.1f, 0.0f);
// Set model matrix for rendering.
bgfx::setTransform(mtx);
@ -412,12 +465,19 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::destroyTexture(textures[ii]);
}
for (uint32_t ii = 0; ii < BX_COUNTOF(textures3d); ++ii)
{
bgfx::destroyTexture(textures3d[ii]);
}
bgfx::destroyTexture(texture2d);
bgfx::destroyTexture(textureCube);
bgfx::destroyIndexBuffer(ibh);
bgfx::destroyVertexBuffer(vbh);
bgfx::destroyProgram(program3d);
bgfx::destroyProgram(programCmp);
bgfx::destroyProgram(program);
bgfx::destroyUniform(u_time);
bgfx::destroyUniform(u_texColor);
bgfx::destroyUniform(u_texCube);

View File

@ -0,0 +1,68 @@
/*
* Copyright 2011-2015 Branimir Karadzic. All rights reserved.
* License: http://www.opensource.org/licenses/BSD-2-Clause
*/
#include <bgfx.c99.h>
#include "../00-helloworld/logo.h"
extern bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset);
uint16_t uint16_max(uint16_t _a, uint16_t _b)
{
return _a < _b ? _b : _a;
}
int _main_(int _argc, char** _argv)
{
(void)_argc;
(void)_argv;
uint32_t width = 1280;
uint32_t height = 720;
uint32_t debug = BGFX_DEBUG_TEXT;
uint32_t reset = BGFX_RESET_VSYNC;
bgfx_init(BGFX_RENDERER_TYPE_COUNT, NULL, NULL);
bgfx_reset(width, height, reset);
// Enable debug text.
bgfx_set_debug(debug);
bgfx_set_view_clear(0
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0
);
while (!entry_process_events(&width, &height, &debug, &reset) )
{
// Set view 0 default viewport.
bgfx_set_view_rect(0, 0, 0, width, height);
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
bgfx_submit(0, 0);
// Use debug font to print information about this example.
bgfx_dbg_text_clear(0, false);
bgfx_dbg_text_image(uint16_max(width/2/8, 20)-20
, uint16_max(height/2/16, 6)-6
, 40
, 12
, s_logo
, 160
);
bgfx_dbg_text_printf(0, 1, 0x4f, "bgfx/examples/25-c99");
bgfx_dbg_text_printf(0, 2, 0x6f, "Description: Initialization and debug text with C99 API.");
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx_frame();
}
// Shutdown bgfx.
bgfx_shutdown();
return 0;
}

View File

@ -60,15 +60,17 @@ namespace entry
switch (_key)
{
case Key::Esc: { return 0x1b; } break;
case Key::Return: { return 0x0d; } break;
case Key::Tab: { return 0x09; } break;
case Key::Space: { return 0xa0; } break;
case Key::Backspace: { return 0x08; } break;
case Key::Plus: { return 0x2b; } break;
case Key::Minus: { return 0x2d; } break;
default: { return '\0'; } break;
case Key::Esc: return 0x1b;
case Key::Return: return '\n';
case Key::Tab: return '\t';
case Key::Space: return ' ';
case Key::Backspace: return 0x08;
case Key::Plus: return '+';
case Key::Minus: return '-';
default: break;
}
return '\0';
}
bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv)

View File

@ -584,10 +584,10 @@ namespace entry
if (!s_ctx.m_fullscreen)
{
[NSMenu setMenuBarVisible: false];
s_ctx.m_style &= ~NSTitledWindowMask;
dispatch_async(dispatch_get_main_queue()
, ^{
[NSMenu setMenuBarVisible: false];
[window setStyleMask: s_ctx.m_style];
[window setFrame:screenRect display:YES];
});
@ -596,10 +596,10 @@ namespace entry
}
else
{
[NSMenu setMenuBarVisible: true];
s_ctx.m_style |= NSTitledWindowMask;
dispatch_async(dispatch_get_main_queue()
, ^{
[NSMenu setMenuBarVisible: true];
[window setStyleMask: s_ctx.m_style];
[window setFrame:s_ctx.m_windowFrame display:YES];
});

View File

@ -211,6 +211,9 @@ namespace entry
: m_width(ENTRY_DEFAULT_WIDTH)
, m_height(ENTRY_DEFAULT_HEIGHT)
, m_aspectRatio(16.0f/9.0f)
, m_mx(0)
, m_my(0)
, m_mz(0)
, m_mouseLock(false)
, m_fullscreen(false)
{
@ -376,10 +379,13 @@ namespace entry
case SDL_MOUSEMOTION:
{
const SDL_MouseMotionEvent& mev = event.motion;
m_mx = mev.x;
m_my = mev.y;
WindowHandle handle = findHandle(mev.windowID);
if (isValid(handle) )
{
m_eventQueue.postMouseEvent(handle, mev.x, mev.y, 0);
m_eventQueue.postMouseEvent(handle, m_mx, m_my, m_mz);
}
}
break;
@ -411,6 +417,30 @@ namespace entry
}
break;
case SDL_MOUSEWHEEL:
{
const SDL_MouseWheelEvent& mev = event.wheel;
m_mz += mev.y;
WindowHandle handle = findHandle(mev.windowID);
if (isValid(handle) )
{
m_eventQueue.postMouseEvent(handle, m_mx, m_my, m_mz);
}
}
break;
case SDL_TEXTINPUT:
{
const SDL_TextInputEvent& tev = event.text;
WindowHandle handle = findHandle(tev.windowID);
if (isValid(handle) )
{
m_eventQueue.postCharEvent(handle, 1, (const uint8_t*)tev.text);
}
}
break;
case SDL_KEYDOWN:
{
const SDL_KeyboardEvent& kev = event.key;
@ -745,6 +775,7 @@ namespace entry
int32_t m_mx;
int32_t m_my;
int32_t m_mz;
bool m_mouseLock;
bool m_fullscreen;
};

View File

@ -388,6 +388,8 @@ struct Imgui
, m_halfTexel(0.0f)
, m_nvg(NULL)
, m_view(255)
, m_surfaceWidth(0)
, m_surfaceHeight(0)
, m_viewWidth(0)
, m_viewHeight(0)
, m_currentFontIdx(0)
@ -810,20 +812,31 @@ struct Imgui
m_char = _inputChar;
}
void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _view)
void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar, uint8_t _view)
{
IMGUI_beginFrame(_mx, _my, _button, _width, _height, _inputChar, _view);
m_view = _view;
m_viewWidth = _width;
m_viewHeight = _height;
m_surfaceWidth = _surfaceWidth;
m_surfaceHeight = _surfaceHeight;
const float xscale = float(m_surfaceWidth) /float(m_viewWidth);
const float yscale = float(m_surfaceHeight)/float(m_viewHeight);
const int32_t mx = int32_t(float(_mx)*xscale);
const int32_t my = int32_t(float(_my)*yscale);
IMGUI_beginFrame(mx, my, _button, _width, _height, _inputChar, _view);
nvgBeginFrameScaled(m_nvg, m_viewWidth, m_viewHeight, m_surfaceWidth, m_surfaceHeight, 1.0f);
nvgViewId(m_nvg, _view);
bgfx::setViewName(_view, "IMGUI");
bgfx::setViewSeq(_view, true);
const bgfx::HMD* hmd = bgfx::getHMD();
if (NULL != hmd)
{
m_viewWidth = _width / 2;
m_viewWidth = _width / 2;
m_surfaceWidth = _surfaceWidth / 2;
float proj[16];
bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
@ -836,22 +849,22 @@ struct Imgui
const float offset1 = -proj[8] + (hmd->eye[1].viewOffset[0] / dist * proj[0]);
float ortho[2][16];
const float viewOffset = _width/4.0f;
const float viewWidth = _width/2.0f;
bx::mtxOrtho(ortho[0], viewOffset, viewOffset + viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f, offset0);
bx::mtxOrtho(ortho[1], viewOffset, viewOffset + viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f, offset1);
const float viewOffset = _surfaceWidth/4.0f;
const float viewWidth = _surfaceWidth/2.0f;
bx::mtxOrtho(ortho[0], viewOffset, viewOffset + viewWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f, offset0);
bx::mtxOrtho(ortho[1], viewOffset, viewOffset + viewWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f, offset1);
bgfx::setViewTransform(_view, NULL, ortho[0], BGFX_VIEW_STEREO, ortho[1]);
bgfx::setViewRect(_view, 0, 0, hmd->width, hmd->height);
}
else
{
float ortho[16];
bx::mtxOrtho(ortho, 0.0f, (float)m_viewWidth, (float)m_viewHeight, 0.0f, 0.0f, 1000.0f);
bx::mtxOrtho(ortho, 0.0f, (float)m_surfaceWidth, (float)m_surfaceHeight, 0.0f, 0.0f, 1000.0f);
bgfx::setViewTransform(_view, NULL, ortho);
bgfx::setViewRect(_view, 0, 0, _width, _height);
}
updateInput(_mx, _my, _button, _scroll, _inputChar);
updateInput(mx, my, _button, _scroll, _inputChar);
m_hot = m_hotToBe;
m_hotToBe = 0;
@ -883,6 +896,7 @@ struct Imgui
clearInput();
nvgEndFrame(m_nvg);
IMGUI_endFrame();
}
@ -936,12 +950,7 @@ struct Imgui
setEnabled(m_areaId);
}
nvgScissor(m_nvg
, float(area.m_scissorX)
, float(area.m_scissorY-1)
, float(area.m_scissorWidth)
, float(area.m_scissorHeight+1)
);
nvgScissor(m_nvg, area);
m_insideArea |= area.m_inside;
@ -1079,12 +1088,7 @@ struct Imgui
}
}
nvgScissor(m_nvg
, float(parentArea.m_scissorX)
, float(parentArea.m_scissorY-1)
, float(parentArea.m_scissorWidth)
, float(parentArea.m_scissorHeight+1)
);
nvgScissor(m_nvg, parentArea);
}
bool beginArea(const char* _name, int32_t _x, int32_t _y, int32_t _width, int32_t _height, bool _enabled, int32_t _r)
@ -1158,13 +1162,7 @@ struct Imgui
}
area.m_scissorEnabled = true;
nvgBeginFrame(m_nvg, m_viewWidth, m_viewHeight, 1.0f);
nvgScissor(m_nvg
, float(area.m_scissorX)
, float(area.m_scissorY-1)
, float(area.m_scissorWidth)
, float(area.m_scissorHeight+1)
);
nvgScissor(m_nvg, area);
m_insideArea |= area.m_inside;
return area.m_inside;
@ -1172,8 +1170,8 @@ struct Imgui
void endArea()
{
m_areaId.pop();
nvgResetScissor(m_nvg);
nvgEndFrame(m_nvg);
}
bool button(const char* _text, bool _enabled, ImguiAlign::Enum _align, uint32_t _rgb0, int32_t _r)
@ -1202,7 +1200,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
const bool enabled = _enabled && isEnabled(m_areaId);
@ -1385,7 +1383,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
const bool drawLabel = (NULL != _label && _label[0] != '\0');
@ -1524,7 +1522,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
uint8_t selected = _selected;
@ -1744,7 +1742,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
const int32_t height = width/2;
@ -1797,7 +1795,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
const bool adjustHeight = (_cross && _sameHeight);
@ -2023,39 +2021,39 @@ struct Imgui
xx = -borderSize;
yy = -1;
width = 2*borderSize+1;
height = m_viewHeight+1;
height = m_surfaceHeight+1;
triX = 0;
triY = (m_viewHeight-triSize)/2;
triY = (m_surfaceHeight-triSize)/2;
orientation = _checked ? TriangleOrientation::Left : TriangleOrientation::Right;
}
else if (ImguiBorder::Right == _border)
{
xx = m_viewWidth - borderSize;
xx = m_surfaceWidth - borderSize;
yy = -1;
width = 2*borderSize+1;
height = m_viewHeight+1;
triX = m_viewWidth - triSize - 2;
triY = (m_viewHeight-width)/2;
height = m_surfaceHeight+1;
triX = m_surfaceWidth - triSize - 2;
triY = (m_surfaceHeight-width)/2;
orientation = _checked ? TriangleOrientation::Right : TriangleOrientation::Left;
}
else if (ImguiBorder::Top == _border)
{
xx = 0;
yy = -borderSize;
width = m_viewWidth;
width = m_surfaceWidth;
height = 2*borderSize;
triX = (m_viewWidth-triSize)/2;
triX = (m_surfaceWidth-triSize)/2;
triY = 0;
orientation = _checked ? TriangleOrientation::Up : TriangleOrientation::Down;
}
else //if (ImguiBorder::Bottom == _border).
{
xx = 0;
yy = m_viewHeight - borderSize;
width = m_viewWidth;
yy = m_surfaceHeight - borderSize;
width = m_surfaceWidth;
height = 2*borderSize;
triX = (m_viewWidth-triSize)/2;
triY = m_viewHeight-triSize;
triX = (m_surfaceWidth-triSize)/2;
triY = m_surfaceHeight-triSize;
orientation = _checked ? TriangleOrientation::Down : TriangleOrientation::Up;
}
@ -2146,7 +2144,7 @@ struct Imgui
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_scissorX);
width = area.m_widgetW - (area.m_widgetX-area.m_contentX);
}
drawRoundedRect( (float)xx, (float)yy, (float)width, (float)height, 4.0f, imguiRGBA(0, 0, 0, 128) );
@ -2264,19 +2262,40 @@ struct Imgui
area.m_widgetY += _height;
}
void separatorLine(uint16_t _height)
void separatorLine(uint16_t _height, ImguiAlign::Enum _align)
{
Area& area = getCurrentArea();
const int32_t rectWidth = area.m_widgetW;
const int32_t rectHeight = 1;
const int32_t xx = area.m_widgetX;
const int32_t yy = area.m_widgetY + _height/2 - rectHeight;
//const int32_t width = area.m_widgetW;
const int32_t height = 1;
//const int32_t xx = area.m_widgetX;
const int32_t yy = area.m_widgetY + _height/2 - height;
int32_t xx;
int32_t width;
if (ImguiAlign::Left == _align)
{
xx = area.m_contentX + SCROLL_AREA_PADDING;
width = area.m_widgetW;
}
else if (ImguiAlign::LeftIndented == _align
|| ImguiAlign::Right == _align)
{
xx = area.m_widgetX;
width = area.m_widgetW;
}
else //if (ImguiAlign::Center == _align
//|| ImguiAlign::CenterIndented == _align).
{
xx = area.m_widgetX;
width = area.m_widgetW - (area.m_widgetX-area.m_contentX) + 1;
}
area.m_widgetY += _height;
drawRect( (float)xx
, (float)yy
, (float)rectWidth
, (float)rectHeight
, (float)width
, (float)height
, imguiRGBA(255, 255, 255, 32)
);
}
@ -3047,10 +3066,16 @@ struct Imgui
const Area& area = getCurrentArea();
if (area.m_scissorEnabled)
{
bgfx::setScissor(uint16_t(IMGUI_MAX(0, area.m_scissorX) )
, uint16_t(IMGUI_MAX(0, area.m_scissorY-1) )
, area.m_scissorWidth
, area.m_scissorHeight+1
const float xscale = float(m_viewWidth) /float(m_surfaceWidth);
const float yscale = float(m_viewHeight)/float(m_surfaceHeight);
const int16_t scissorX = int16_t(float(area.m_scissorX)*xscale);
const int16_t scissorY = int16_t(float(area.m_scissorY)*yscale);
const int16_t scissorWidth = int16_t(float(area.m_scissorWidth)*xscale);
const int16_t scissorHeight = int16_t(float(area.m_scissorHeight)*yscale);
bgfx::setScissor(uint16_t(IMGUI_MAX(0, scissorX) )
, uint16_t(IMGUI_MAX(0, scissorY-1) )
, scissorWidth
, scissorHeight+1
);
}
else
@ -3059,6 +3084,23 @@ struct Imgui
}
}
inline void nvgScissor(NVGcontext* _ctx, const Area& _area)
{
if (_area.m_scissorEnabled)
{
::nvgScissor(_ctx
, float(IMGUI_MAX(0, _area.m_scissorX) )
, float(IMGUI_MAX(0, _area.m_scissorY-1) )
, float(_area.m_scissorWidth)
, float(_area.m_scissorHeight+1)
);
}
else
{
nvgResetScissor(_ctx);
}
}
template <typename Ty, uint16_t Max=64>
struct IdStack
{
@ -3146,6 +3188,8 @@ struct Imgui
NVGcontext* m_nvg;
uint8_t m_view;
uint16_t m_surfaceWidth;
uint16_t m_surfaceHeight;
uint16_t m_viewWidth;
uint16_t m_viewHeight;
@ -3202,9 +3246,14 @@ ImguiFontHandle imguiGetCurrentFont()
return handle;
}
void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar, uint8_t _view)
{
s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _surfaceWidth, _surfaceHeight, _inputChar, _view);
}
void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _view)
{
s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _inputChar, _view);
s_imgui.beginFrame(_mx, _my, _button, _scroll, _width, _height, _width, _height, _inputChar, _view);
}
void imguiEndFrame()
@ -3287,9 +3336,9 @@ void imguiSeparator(uint16_t _height)
s_imgui.separator(_height);
}
void imguiSeparatorLine(uint16_t _height)
void imguiSeparatorLine(uint16_t _height, ImguiAlign::Enum _align)
{
s_imgui.separatorLine(_height);
s_imgui.separatorLine(_height, _align);
}
int32_t imguiGetWidgetX()

View File

@ -137,6 +137,7 @@ ImguiFontHandle imguiCreate(const void* _data = NULL, uint32_t _size = 0, float
void imguiDestroy();
void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar = 0, uint8_t _view = 255);
void imguiBeginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, uint16_t _surfaceWidth, uint16_t _surfaceHeight, char _inputChar = 0, uint8_t _view = 255);
void imguiEndFrame();
void imguiDrawText(int _x, int _y, ImguiTextAlign::Enum _align, const char* _text, uint32_t _argb);
@ -158,7 +159,7 @@ void imguiEndScrollArea(int32_t _r = IMGUI_SCROLL_BAR_R);
void imguiIndent(uint16_t _width = IMGUI_INDENT_VALUE);
void imguiUnindent(uint16_t _width = IMGUI_INDENT_VALUE);
void imguiSeparator(uint16_t _height = IMGUI_SEPARATOR_VALUE);
void imguiSeparatorLine(uint16_t _height = IMGUI_SEPARATOR_VALUE);
void imguiSeparatorLine(uint16_t _height = IMGUI_SEPARATOR_VALUE, ImguiAlign::Enum = ImguiAlign::LeftIndented);
int32_t imguiGetWidgetX();
int32_t imguiGetWidgetY();

View File

@ -165,7 +165,7 @@ struct OcornutImguiContext
ImGui::NewFrame();
ImGui::ShowTestWindow();
//ImGui::ShowTestWindow(); //Debug only.
}
void endFrame()

View File

@ -296,7 +296,7 @@ void nvgDeleteInternal(NVGcontext* ctx)
free(ctx);
}
void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio)
void nvgBeginFrameScaled(NVGcontext* ctx, int windowWidth, int windowHeight, int surfaceWidth, int surfaceHeight, float devicePixelRatio)
{
/* printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n",
ctx->drawCallCount, ctx->fillTriCount, ctx->strokeTriCount, ctx->textTriCount,
@ -307,8 +307,8 @@ void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float dev
nvgReset(ctx);
nvg__setDevicePixelRatio(ctx, devicePixelRatio);
ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight);
ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight, surfaceWidth, surfaceHeight);
ctx->drawCallCount = 0;
ctx->fillTriCount = 0;
@ -316,6 +316,11 @@ void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float dev
ctx->textTriCount = 0;
}
void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio)
{
nvgBeginFrameScaled(ctx, windowWidth, windowHeight, windowWidth, windowHeight, devicePixelRatio);
}
void nvgCancelFrame(NVGcontext* ctx)
{
ctx->params.renderCancel(ctx->params.userPtr);

View File

@ -116,6 +116,7 @@ enum NVGimageFlags {
// frame buffer size. In that case you would set windowWidth/Height to the window size
// devicePixelRatio to: frameBufferWidth / windowWidth.
void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio);
void nvgBeginFrameScaled(NVGcontext* ctx, int windowWidth, int windowHeight, int surfaceWidth, int surfaceHeight, float devicePixelRatio);
// Cancels drawing the current frame.
void nvgCancelFrame(NVGcontext* ctx);
@ -588,7 +589,7 @@ struct NVGparams {
int (*renderDeleteTexture)(void* uptr, int image);
int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data);
int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h);
void (*renderViewport)(void* uptr, int width, int height);
void (*renderViewport)(void* uptr, int width, int height, int surfaceWidth, int surfaceHeight);
void (*renderCancel)(void* uptr);
void (*renderFlush)(void* uptr);
void (*renderFill)(void* uptr, NVGpaint* paint, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths);
@ -599,6 +600,7 @@ struct NVGparams {
typedef struct NVGparams NVGparams;
NVGcontext* nvgCreate(int edgeaa, unsigned char viewid);
void nvgViewId(struct NVGcontext* ctx, unsigned char viewid);
void nvgDelete(struct NVGcontext* ctx);
// Contructor and destructor, called by the render back-end.

View File

@ -132,6 +132,7 @@ namespace
struct GLNVGtexture* textures;
float view[2];
float surface[2];
int ntextures;
int ctextures;
int textureId;
@ -516,11 +517,13 @@ namespace
gl->th = handle;
}
static void nvgRenderViewport(void* _userPtr, int width, int height)
static void nvgRenderViewport(void* _userPtr, int width, int height, int surfaceWidth, int surfaceHeight)
{
struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr;
gl->view[0] = (float)width;
gl->view[1] = (float)height;
gl->surface[0] = (float)surfaceWidth;
gl->surface[1] = (float)surfaceHeight;
bgfx::setViewRect(gl->viewid, 0, 0, width, height);
}
@ -720,7 +723,7 @@ namespace
);
}
bgfx::setUniform(gl->u_viewSize, gl->view);
bgfx::setUniform(gl->u_viewSize, gl->surface);
for (uint32_t ii = 0, num = gl->ncalls; ii < num; ++ii)
{
@ -1051,6 +1054,13 @@ error:
return NULL;
}
void nvgViewId(struct NVGcontext* ctx, unsigned char viewid)
{
struct NVGparams* params = nvgInternalParams(ctx);
struct GLNVGcontext* gl = (struct GLNVGcontext*)params->userPtr;
gl->viewid = uint8_t(viewid);
}
void nvgDelete(struct NVGcontext* ctx)
{
nvgDeleteInternal(ctx);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,6 +25,11 @@ function bgfxProject(_name, _kind, _defines)
"-shared",
}
configuration { "linux-*" }
buildoptions {
"-fPIC",
}
configuration {}
end

View File

@ -84,13 +84,14 @@ function exampleProject(_name)
end
includedirs {
path.join(BX_DIR, "include"),
path.join(BX_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
path.join(BGFX_DIR, "examples/common"),
}
files {
path.join(BGFX_DIR, "examples", _name, "**.c"),
path.join(BGFX_DIR, "examples", _name, "**.cpp"),
path.join(BGFX_DIR, "examples", _name, "**.h"),
}
@ -308,6 +309,7 @@ exampleProject("21-deferred")
exampleProject("22-windows")
exampleProject("23-vectordisplay")
exampleProject("24-nbody")
exampleProject("25-c99")
if _OPTIONS["with-shared-lib"] then
group "libs"

View File

@ -74,6 +74,16 @@ struct BgfxSampler3D
Texture3D m_texture;
};
struct BgfxISampler3D
{
Texture3D<ivec4> m_texture;
};
struct BgfxUSampler3D
{
Texture3D<uvec4> m_texture;
};
vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord)
{
return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
@ -84,6 +94,20 @@ vec4 bgfxTexture3DLod(BgfxSampler3D _sampler, vec3 _coord, float _level)
return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);
}
ivec4 bgfxTexture3D(BgfxISampler3D _sampler, vec3 _coord)
{
ivec3 size;
_sampler.m_texture.GetDimensions(size.x, size.y, size.z);
return _sampler.m_texture.Load(ivec4(_coord * size, 0) );
}
uvec4 bgfxTexture3D(BgfxUSampler3D _sampler, vec3 _coord)
{
uvec3 size;
_sampler.m_texture.GetDimensions(size.x, size.y, size.z);
return _sampler.m_texture.Load(uvec4(_coord * size, 0) );
}
struct BgfxSamplerCube
{
SamplerState m_sampler;
@ -121,6 +145,12 @@ vec4 bgfxTextureCubeLod(BgfxSamplerCube _sampler, vec3 _coord, float _level)
uniform SamplerState _name ## Sampler : register(s[_reg]); \
uniform Texture3D _name ## Texture : register(t[_reg]); \
static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture }
# define ISAMPLER3D(_name, _reg) \
uniform Texture3D<ivec4> _name ## Texture : register(t[_reg]); \
static BgfxISampler3D _name = { _name ## Texture }
# define USAMPLER3D(_name, _reg) \
uniform Texture3D<uvec4> _name ## Texture : register(t[_reg]); \
static BgfxUSampler3D _name = { _name ## Texture }
# define sampler3D BgfxSampler3D
# define texture3D(_sampler, _coord) bgfxTexture3D(_sampler, _coord)
# define texture3DLod(_sampler, _coord, _level) bgfxTexture3DLod(_sampler, _coord, _level)
@ -247,6 +277,13 @@ vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); }
# define uvec3_splat(_x) uvec3(_x)
# define uvec4_splat(_x) uvec4(_x)
# if BGFX_SHADER_LANGUAGE_GLSL >= 130
# define ISAMPLER3D(_name, _reg) uniform isampler3D _name
# define USAMPLER3D(_name, _reg) uniform usampler3D _name
ivec4 texture3D(isampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); }
uvec4 texture3D(usampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); }
# endif // BGFX_SHADER_LANGUAGE_GLSL >= 130
vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }
vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_mtx, _vec); }
vec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_vec, _mtx); }

View File

@ -19,55 +19,55 @@ namespace bgfx
// | | | | +----- min blocks x
// | | | | | +-- min blocks y
// | | | | | |
{ 4, 4, 4, 8, 1, 1 }, // BC1
{ 8, 4, 4, 16, 1, 1 }, // BC2
{ 8, 4, 4, 16, 1, 1 }, // BC3
{ 4, 4, 4, 8, 1, 1 }, // BC4
{ 8, 4, 4, 16, 1, 1 }, // BC5
{ 8, 4, 4, 16, 1, 1 }, // BC6H
{ 8, 4, 4, 16, 1, 1 }, // BC7
{ 4, 4, 4, 8, 1, 1 }, // ETC1
{ 4, 4, 4, 8, 1, 1 }, // ETC2
{ 8, 4, 4, 16, 1, 1 }, // ETC2A
{ 4, 4, 4, 8, 1, 1 }, // ETC2A1
{ 2, 8, 4, 8, 2, 2 }, // PTC12
{ 4, 4, 4, 8, 2, 2 }, // PTC14
{ 2, 8, 4, 8, 2, 2 }, // PTC12A
{ 4, 4, 4, 8, 2, 2 }, // PTC14A
{ 2, 8, 4, 8, 2, 2 }, // PTC22
{ 4, 4, 4, 8, 2, 2 }, // PTC24
{ 0, 0, 0, 0, 1, 1 }, // Unknown
{ 1, 8, 1, 1, 1, 1 }, // R1
{ 8, 1, 1, 1, 1, 1 }, // R8
{ 16, 1, 1, 2, 1, 1 }, // R16
{ 16, 1, 1, 2, 1, 1 }, // R16F
{ 32, 1, 1, 4, 1, 1 }, // R32
{ 32, 1, 1, 4, 1, 1 }, // R32F
{ 16, 1, 1, 2, 1, 1 }, // RG8
{ 32, 1, 1, 4, 1, 1 }, // RG16
{ 32, 1, 1, 4, 1, 1 }, // RG16F
{ 64, 1, 1, 8, 1, 1 }, // RG32
{ 64, 1, 1, 8, 1, 1 }, // RG32F
{ 32, 1, 1, 4, 1, 1 }, // BGRA8
{ 32, 1, 1, 4, 1, 1 }, // RGBA8
{ 64, 1, 1, 8, 1, 1 }, // RGBA16
{ 64, 1, 1, 8, 1, 1 }, // RGBA16F
{ 128, 1, 1, 16, 1, 1 }, // RGBA32
{ 128, 1, 1, 16, 1, 1 }, // RGBA32F
{ 16, 1, 1, 2, 1, 1 }, // R5G6B5
{ 16, 1, 1, 2, 1, 1 }, // RGBA4
{ 16, 1, 1, 2, 1, 1 }, // RGB5A1
{ 32, 1, 1, 4, 1, 1 }, // RGB10A2
{ 32, 1, 1, 4, 1, 1 }, // R11G11B10F
{ 0, 0, 0, 0, 1, 1 }, // UnknownDepth
{ 16, 1, 1, 2, 1, 1 }, // D16
{ 24, 1, 1, 3, 1, 1 }, // D24
{ 32, 1, 1, 4, 1, 1 }, // D24S8
{ 32, 1, 1, 4, 1, 1 }, // D32
{ 16, 1, 1, 2, 1, 1 }, // D16F
{ 24, 1, 1, 3, 1, 1 }, // D24F
{ 32, 1, 1, 4, 1, 1 }, // D32F
{ 8, 1, 1, 1, 1, 1 }, // D0S8
{ 4, 4, 4, 8, 1, 1, 0, 0 }, // BC1
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // BC2
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // BC3
{ 4, 4, 4, 8, 1, 1, 0, 0 }, // BC4
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // BC5
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // BC6H
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // BC7
{ 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC1
{ 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2
{ 8, 4, 4, 16, 1, 1, 0, 0 }, // ETC2A
{ 4, 4, 4, 8, 1, 1, 0, 0 }, // ETC2A1
{ 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12
{ 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14
{ 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC12A
{ 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC14A
{ 2, 8, 4, 8, 2, 2, 0, 0 }, // PTC22
{ 4, 4, 4, 8, 2, 2, 0, 0 }, // PTC24
{ 0, 0, 0, 0, 1, 1, 0, 0 }, // Unknown
{ 1, 8, 1, 1, 1, 1, 0, 0 }, // R1
{ 8, 1, 1, 1, 1, 1, 0, 0 }, // R8
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // R16
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // R16F
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // R32
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // R32F
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // RG8
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // RG16F
{ 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32
{ 64, 1, 1, 8, 1, 1, 0, 0 }, // RG32F
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // BGRA8
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // RGBA8
{ 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16
{ 64, 1, 1, 8, 1, 1, 0, 0 }, // RGBA16F
{ 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32
{ 128, 1, 1, 16, 1, 1, 0, 0 }, // RGBA32F
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // R5G6B5
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // RGBA4
{ 16, 1, 1, 2, 1, 1, 0, 0 }, // RGB5A1
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // RGB10A2
{ 32, 1, 1, 4, 1, 1, 0, 0 }, // R11G11B10F
{ 0, 0, 0, 0, 1, 1, 0, 0 }, // UnknownDepth
{ 16, 1, 1, 2, 1, 1, 16, 0 }, // D16
{ 24, 1, 1, 3, 1, 1, 24, 0 }, // D24
{ 32, 1, 1, 4, 1, 1, 24, 8 }, // D24S8
{ 32, 1, 1, 4, 1, 1, 32, 0 }, // D32
{ 16, 1, 1, 2, 1, 1, 16, 0 }, // D16F
{ 24, 1, 1, 3, 1, 1, 24, 0 }, // D24F
{ 32, 1, 1, 4, 1, 1, 32, 0 }, // D32F
{ 8, 1, 1, 1, 1, 1, 0, 8 }, // D0S8
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_imageBlockInfo) );

View File

@ -45,6 +45,8 @@ namespace bgfx
uint8_t blockSize;
uint8_t minBlockX;
uint8_t minBlockY;
uint8_t depthBits;
uint8_t stencilBits;
};
///

View File

@ -203,7 +203,7 @@ namespace bgfx
{ DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
{ DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN }, // R1
{ DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN }, // R8
{ DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN }, // R16
{ DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN }, // R16
{ DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN }, // R16F
{ DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN }, // R32
{ DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN }, // R32F
@ -728,7 +728,40 @@ namespace bgfx
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
g_caps.formats[ii] = DXGI_FORMAT_UNKNOWN == s_textureFormat[ii].m_fmt ? 0 : 1;
uint8_t support = BGFX_CAPS_FORMAT_TEXTURE_NONE;
if (DXGI_FORMAT_UNKNOWN != s_textureFormat[ii].m_fmt)
{
D3D11_FEATURE_DATA_FORMAT_SUPPORT data; // D3D11_FEATURE_DATA_FORMAT_SUPPORT2
data.InFormat = s_textureFormat[ii].m_fmt;
HRESULT hr = m_device->CheckFeatureSupport(D3D11_FEATURE_FORMAT_SUPPORT, &data, sizeof(data) );
if (SUCCEEDED(hr) )
{
support |= 0 != (data.OutFormatSupport & (0
| D3D11_FORMAT_SUPPORT_TEXTURE2D
| D3D11_FORMAT_SUPPORT_TEXTURE3D
| D3D11_FORMAT_SUPPORT_TEXTURECUBE
) )
? BGFX_CAPS_FORMAT_TEXTURE_COLOR
: BGFX_CAPS_FORMAT_TEXTURE_NONE
;
support |= 0 != (data.OutFormatSupport & (0
| D3D11_FORMAT_SUPPORT_BUFFER
| D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER
| D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER
) )
? BGFX_CAPS_FORMAT_TEXTURE_VERTEX
: BGFX_CAPS_FORMAT_TEXTURE_NONE
;
}
else
{
BX_TRACE("CheckFeatureSupport failed with %x for format %s.", hr, getName(TextureFormat::Enum(ii) ) );
}
}
g_caps.formats[ii] = support;
}
// Init reserved part of view name.

View File

@ -10,7 +10,7 @@
#if BX_PLATFORM_WINDOWS
# if !BGFX_CONFIG_RENDERER_DIRECT3D9EX
# define D3D_DISABLE_9EX
//# define D3D_DISABLE_9EX
# endif // !BGFX_CONFIG_RENDERER_DIRECT3D9EX
# include <d3d9.h>

View File

@ -713,6 +713,17 @@ namespace bgfx
NULL
};
static const char* s_uisamplers[] =
{
"isampler2D",
"usampler2D",
"isampler3D",
"usampler3D",
"isamplerCube",
"usamplerCube",
NULL
};
static void GL_APIENTRY stubVertexAttribDivisor(GLuint /*_index*/, GLuint /*_divisor*/)
{
}
@ -2603,25 +2614,35 @@ namespace bgfx
GLSL_TYPE(GL_FLOAT_MAT2);
GLSL_TYPE(GL_FLOAT_MAT3);
GLSL_TYPE(GL_FLOAT_MAT4);
// GLSL_TYPE(GL_FLOAT_MAT2x3);
// GLSL_TYPE(GL_FLOAT_MAT2x4);
// GLSL_TYPE(GL_FLOAT_MAT3x2);
// GLSL_TYPE(GL_FLOAT_MAT3x4);
// GLSL_TYPE(GL_FLOAT_MAT4x2);
// GLSL_TYPE(GL_FLOAT_MAT4x3);
// GLSL_TYPE(GL_SAMPLER_1D);
GLSL_TYPE(GL_SAMPLER_2D);
GLSL_TYPE(GL_SAMPLER_2D);
GLSL_TYPE(GL_INT_SAMPLER_2D);
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_2D);
GLSL_TYPE(GL_SAMPLER_3D);
GLSL_TYPE(GL_INT_SAMPLER_3D);
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_3D);
GLSL_TYPE(GL_SAMPLER_CUBE);
// GLSL_TYPE(GL_SAMPLER_1D_SHADOW);
GLSL_TYPE(GL_INT_SAMPLER_CUBE);
GLSL_TYPE(GL_UNSIGNED_INT_SAMPLER_CUBE);
GLSL_TYPE(GL_SAMPLER_2D_SHADOW);
GLSL_TYPE(GL_IMAGE_1D);
GLSL_TYPE(GL_IMAGE_2D);
GLSL_TYPE(GL_IMAGE_3D);
GLSL_TYPE(GL_IMAGE_CUBE);
GLSL_TYPE(GL_INT_IMAGE_1D);
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_1D);
GLSL_TYPE(GL_IMAGE_2D);
GLSL_TYPE(GL_INT_IMAGE_2D);
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_2D);
GLSL_TYPE(GL_IMAGE_3D);
GLSL_TYPE(GL_INT_IMAGE_3D);
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_3D);
GLSL_TYPE(GL_IMAGE_CUBE);
GLSL_TYPE(GL_INT_IMAGE_CUBE);
GLSL_TYPE(GL_UNSIGNED_INT_IMAGE_CUBE);
}
@ -2687,27 +2708,34 @@ namespace bgfx
case GL_FLOAT_MAT4:
return UniformType::Uniform4x4fv;
// case GL_FLOAT_MAT2x3:
// case GL_FLOAT_MAT2x4:
// case GL_FLOAT_MAT3x2:
// case GL_FLOAT_MAT3x4:
// case GL_FLOAT_MAT4x2:
// case GL_FLOAT_MAT4x3:
// break;
// case GL_SAMPLER_1D:
case GL_SAMPLER_2D:
case GL_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_SAMPLER_3D:
case GL_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_SAMPLER_CUBE:
// case GL_SAMPLER_1D_SHADOW:
case GL_SAMPLER_2D_SHADOW:
case GL_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_SAMPLER_2D_SHADOW:
case GL_IMAGE_1D:
case GL_IMAGE_2D:
case GL_IMAGE_3D:
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_1D:
case GL_UNSIGNED_INT_IMAGE_1D:
case GL_IMAGE_2D:
case GL_INT_IMAGE_2D:
case GL_UNSIGNED_INT_IMAGE_2D:
case GL_IMAGE_3D:
case GL_INT_IMAGE_3D:
case GL_UNSIGNED_INT_IMAGE_3D:
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE:
return UniformType::Uniform1iv;
};
@ -2899,16 +2927,33 @@ namespace bgfx
switch (gltype)
{
case GL_SAMPLER_2D:
case GL_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_SAMPLER_3D:
case GL_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_SAMPLER_CUBE:
case GL_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_SAMPLER_2D_SHADOW:
case GL_IMAGE_1D:
case GL_IMAGE_2D:
case GL_IMAGE_3D:
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_1D:
case GL_UNSIGNED_INT_IMAGE_1D:
case GL_IMAGE_2D:
case GL_INT_IMAGE_2D:
case GL_UNSIGNED_INT_IMAGE_2D:
case GL_IMAGE_3D:
case GL_INT_IMAGE_3D:
case GL_UNSIGNED_INT_IMAGE_3D:
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE:
BX_TRACE("Sampler #%d at location %d.", m_numSamplers, loc);
m_sampler[m_numSamplers] = loc;
@ -3285,13 +3330,14 @@ namespace bgfx
blockHeight = blockInfo.blockHeight;
}
BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s%s."
BX_TRACE("Texture%-4s %3d: %s (requested: %s), %dx%dx%d%s."
, imageContainer.m_cubeMap ? "Cube" : (1 < imageContainer.m_depth ? "3D" : "2D")
, this - s_renderGL->m_textures
, getName( (TextureFormat::Enum)m_textureFormat)
, getName( (TextureFormat::Enum)m_requestedFormat)
, textureWidth
, textureHeight
, imageContainer.m_cubeMap ? "x6" : ""
, imageContainer.m_cubeMap ? 6 : (1 < imageContainer.m_depth ? imageContainer.m_depth : 0)
, 0 != (m_flags&BGFX_TEXTURE_RT_MASK) ? " (render target)" : ""
);
@ -3871,14 +3917,22 @@ namespace bgfx
else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
&& BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL <= 21) )
{
bool usesTextureLod = s_extension[Extension::ARB_shader_texture_lod].m_supported
bool usesTextureLod = true
&& s_extension[Extension::ARB_shader_texture_lod].m_supported
&& bx::findIdentifierMatch(code, s_ARB_shader_texture_lod)
;
bool usesIUsamplers = !!bx::findIdentifierMatch(code, s_uisamplers);
uint32_t version = usesIUsamplers ? 130 : (usesTextureLod ? 120 : 0);
if (0 != version)
{
writeStringf(&writer, "#version %d\n", version);
}
if (usesTextureLod)
{
writeString(&writer, "#version 120\n");
if (m_type == GL_FRAGMENT_SHADER)
{
writeString(&writer, "#extension GL_ARB_shader_texture_lod : enable\n");
@ -4072,9 +4126,22 @@ namespace bgfx
}
GLenum attachment = GL_COLOR_ATTACHMENT0 + colorIdx;
if (isDepth( (TextureFormat::Enum)texture.m_textureFormat) )
TextureFormat::Enum format = (TextureFormat::Enum)texture.m_textureFormat;
if (isDepth(format) )
{
attachment = GL_DEPTH_ATTACHMENT;
const ImageBlockInfo& info = getBlockInfo(format);
if (0 < info.stencilBits)
{
attachment = GL_DEPTH_STENCIL_ATTACHMENT;
}
else if (0 == info.depthBits)
{
attachment = GL_STENCIL_ATTACHMENT;
}
else
{
attachment = GL_DEPTH_ATTACHMENT;
}
}
else
{

View File

@ -424,6 +424,30 @@ typedef uint64_t GLuint64;
# define GL_COMPARE_REF_TO_TEXTURE 0x884E
#endif // GL_COMPARE_REF_TO_TEXTURE
#ifndef GL_INT_SAMPLER_2D
# define GL_INT_SAMPLER_2D 0x8DCA
#endif // GL_INT_SAMPLER_2D
#ifndef GL_UNSIGNED_INT_SAMPLER_2D
# define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
#endif // GL_UNSIGNED_INT_SAMPLER_2D
#ifndef GL_INT_SAMPLER_3D
# define GL_INT_SAMPLER_3D 0x8DCB
#endif // GL_INT_SAMPLER_3D
#ifndef GL_UNSIGNED_INT_SAMPLER_3D
# define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
#endif // GL_UNSIGNED_INT_SAMPLER_3D
#ifndef GL_INT_SAMPLER_CUBE
# define GL_INT_SAMPLER_CUBE 0x8DCC
#endif // GL_INT_SAMPLER_CUBEER_3D
#ifndef GL_UNSIGNED_INT_SAMPLER_CUBE
# define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
#endif // GL_UNSIGNED_INT_SAMPLER_CUBE
#ifndef GL_SAMPLER_2D_SHADOW
# define GL_SAMPLER_2D_SHADOW 0x8B62
#endif // GL_SAMPLER_2D_SHADOW
@ -484,6 +508,22 @@ typedef uint64_t GLuint64;
# define GL_IMAGE_CUBE 0x9050
#endif // GL_IMAGE_CUBE
#ifndef GL_INT_IMAGE_1D
# define GL_INT_IMAGE_1D 0x9057
#endif // GL_INT_IMAGE_1D
#ifndef GL_INT_IMAGE_2D
# define GL_INT_IMAGE_2D 0x9058
#endif // GL_INT_IMAGE_2D
#ifndef GL_INT_IMAGE_3D
# define GL_INT_IMAGE_3D 0x9059
#endif // GL_INT_IMAGE_3D
#ifndef GL_INT_IMAGE_CUBE
# define GL_INT_IMAGE_CUBE 0x905B
#endif // GL_INT_IMAGE_CUBE
#ifndef GL_UNSIGNED_INT_IMAGE_1D
# define GL_UNSIGNED_INT_IMAGE_1D 0x9062
#endif // GL_UNSIGNED_INT_IMAGE_1D

View File

@ -41,27 +41,21 @@ namespace bgfx
static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] =
{
#if BGFX_CONFIG_RENDERER_DIRECT3D9
&s_attribTypeSizeDx9,
#elif BGFX_CONFIG_RENDERER_DIRECT3D11 || BGFX_CONFIG_RENDERER_DIRECT3D12
&s_attribTypeSizeDx1x,
#elif BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_VULKAN
&s_attribTypeSizeGl,
#else
&s_attribTypeSizeDx9,
#endif // BGFX_CONFIG_RENDERER_
&s_attribTypeSizeDx9, // Null
&s_attribTypeSizeDx9, // Direct3D9
&s_attribTypeSizeDx1x, // Direct3D11
&s_attribTypeSizeDx1x, // Direct3D12
&s_attribTypeSizeGl, // OpenGLES
&s_attribTypeSizeGl, // OpenGL
&s_attribTypeSizeGl, // Vulkan
&s_attribTypeSizeDx9, // Count
};
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == bgfx::RendererType::Count);
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == RendererType::Count+1);
void initAttribTypeSizeTable(RendererType::Enum _type)
{
s_attribTypeSize[0] = s_attribTypeSize[_type];
s_attribTypeSize[0] = s_attribTypeSize[_type];
s_attribTypeSize[RendererType::Count] = s_attribTypeSize[_type];
}
void dbgPrintfVargs(const char* _format, va_list _argList)

View File

@ -751,7 +751,8 @@ int main(int _argc, const char* _argv[])
bool raw = cmdLine.hasArg('\0', "raw");
uint32_t gles = 0;
uint32_t glsl = 0;
uint32_t essl = 0;
uint32_t hlsl = 2;
uint32_t d3d = 11;
const char* profile = cmdLine.findOption('p', "profile");
@ -774,10 +775,14 @@ int main(int _argc, const char* _argv[])
{
hlsl = 5;
}
else
{
glsl = atoi(profile);
}
}
else
{
gles = 2;
essl = 2;
}
const char* bin2c = NULL;
@ -811,7 +816,7 @@ int main(int _argc, const char* _argv[])
bool preprocessOnly = cmdLine.hasArg("preprocess");
const char* includeDir = cmdLine.findOption('i');
Preprocessor preprocessor(filePath, 0 != gles, includeDir);
Preprocessor preprocessor(filePath, 0 != essl, includeDir);
std::string dir;
{
@ -839,43 +844,38 @@ int main(int _argc, const char* _argv[])
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT");
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX");
bool glsl = false;
char glslDefine[128];
bx::snprintf(glslDefine, BX_COUNTOF(glslDefine), "BGFX_SHADER_LANGUAGE_GLSL=%d", glsl);
if (0 == bx::stricmp(platform, "android") )
{
preprocessor.setDefine("BX_PLATFORM_ANDROID=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
}
else if (0 == bx::stricmp(platform, "asm.js") )
{
preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
}
else if (0 == bx::stricmp(platform, "ios") )
{
preprocessor.setDefine("BX_PLATFORM_IOS=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
}
else if (0 == bx::stricmp(platform, "linux") )
{
preprocessor.setDefine("BX_PLATFORM_LINUX=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
preprocessor.setDefine(glslDefine);
}
else if (0 == bx::stricmp(platform, "nacl") )
{
preprocessor.setDefine("BX_PLATFORM_NACL=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
}
else if (0 == bx::stricmp(platform, "osx") )
{
preprocessor.setDefine("BX_PLATFORM_OSX=1");
preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
glsl = true;
preprocessor.setDefine(glslDefine);
}
else if (0 == bx::stricmp(platform, "windows") )
{
@ -1120,7 +1120,7 @@ int main(int _argc, const char* _argv[])
bx::write(writer, outputHash);
}
if (glsl)
if (0 != glsl)
{
bx::write(writer, uint16_t(0) );
@ -1155,7 +1155,7 @@ int main(int _argc, const char* _argv[])
}
else
{
if (glsl)
if (0 != glsl)
{
}
else
@ -1269,18 +1269,17 @@ int main(int _argc, const char* _argv[])
bx::write(writer, BGFX_CHUNK_MAGIC_CSH);
bx::write(writer, outputHash);
if (glsl)
if (0 != glsl)
{
std::string code;
if (gles)
if (essl)
{
bx::stringPrintf(code, "#version 310 es\n");
}
else
{
int32_t version = atoi(profile);
bx::stringPrintf(code, "#version %d\n", version == 0 ? 430 : version);
bx::stringPrintf(code, "#version %d\n", glsl == 0 ? 430 : glsl);
}
code += preprocessor.m_preprocessed;
@ -1294,7 +1293,7 @@ int main(int _argc, const char* _argv[])
compiled = true;
#else
compiled = compileGLSLShader(cmdLine, gles, code, writer);
compiled = compileGLSLShader(cmdLine, essl, code, writer);
#endif // 0
}
else
@ -1339,15 +1338,19 @@ int main(int _argc, const char* _argv[])
}
else
{
if (glsl)
if (0 != glsl)
{
preprocessor.writef(
"#define ivec2 vec2\n"
"#define ivec3 vec3\n"
"#define ivec4 vec4\n"
);
if (120 == glsl
|| essl)
{
preprocessor.writef(
"#define ivec2 vec2\n"
"#define ivec3 vec3\n"
"#define ivec4 vec4\n"
);
}
if (0 == gles)
if (0 == essl)
{
// bgfx shadow2D/Proj behave like EXT_shadow_samplers
// not as GLSL language 1.2 specs shadow2D/Proj.
@ -1645,7 +1648,7 @@ int main(int _argc, const char* _argv[])
return EXIT_FAILURE;
}
if (glsl)
if (0 != glsl)
{
const char* profile = cmdLine.findOption('p', "profile");
if (NULL == profile)
@ -1697,16 +1700,15 @@ int main(int _argc, const char* _argv[])
bx::write(writer, outputHash);
}
if (glsl)
if (0 != glsl)
{
std::string code;
bool hasTextureLod = NULL != bx::findIdentifierMatch(input, s_ARB_shader_texture_lod /*EXT_shader_texture_lod*/);
if (0 == gles)
if (0 == essl)
{
bx::stringPrintf(code, "#version %s\n", profile);
int32_t version = atoi(profile);
bx::stringPrintf(code
, "#define bgfxShadow2D shadow2D\n"
@ -1714,7 +1716,7 @@ int main(int _argc, const char* _argv[])
);
if (hasTextureLod
&& 130 > version)
&& 130 > glsl)
{
bx::stringPrintf(code
, "#extension GL_ARB_shader_texture_lod : enable\n"
@ -1767,7 +1769,7 @@ int main(int _argc, const char* _argv[])
}
code += preprocessor.m_preprocessed;
compiled = compileGLSLShader(cmdLine, gles, code, writer);
compiled = compileGLSLShader(cmdLine, essl, code, writer);
}
else
{

View File

@ -19,11 +19,13 @@
#define BX_PLATFORM_LINUX 0
#define BX_PLATFORM_NACL 0
#define BX_PLATFORM_OSX 0
#define BX_PLATFORM_PS4 0
#define BX_PLATFORM_QNX 0
#define BX_PLATFORM_RPI 0
#define BX_PLATFORM_WINDOWS 0
#define BX_PLATFORM_WINRT 0
#define BX_PLATFORM_XBOX360 0
#define BX_PLATFORM_XBOXONE 0
#define BX_CPU_ARM 0
#define BX_CPU_JIT 0
@ -120,6 +122,9 @@
#if defined(_XBOX_VER)
# undef BX_PLATFORM_XBOX360
# define BX_PLATFORM_XBOX360 1
#elif defined (_DURANGO)
# undef BX_PLATFORM_XBOXONE
# define BX_PLATFORM_XBOXONE 1
#elif defined(_WIN32) || defined(_WIN64)
// http://msdn.microsoft.com/en-us/library/6sehtctf.aspx
# ifndef NOMINMAX
@ -173,6 +178,9 @@
#elif defined(EMSCRIPTEN)
# undef BX_PLATFORM_EMSCRIPTEN
# define BX_PLATFORM_EMSCRIPTEN 1
#elif defined(__ORBIS__)
# undef BX_PLATFORM_PS4
# define BX_PLATFORM_PS4 1
#elif defined(__QNX__)
# undef BX_PLATFORM_QNX
# define BX_PLATFORM_QNX 1
@ -242,6 +250,8 @@
BX_STRINGIZE(BX_PLATFORM_NACL)
#elif BX_PLATFORM_OSX
# define BX_PLATFORM_NAME "OSX"
#elif BX_PLATFORM_PS4
# define BX_PLATFORM_NAME "PlayStation 4"
#elif BX_PLATFORM_QNX
# define BX_PLATFORM_NAME "QNX"
#elif BX_PLATFORM_RPI
@ -250,6 +260,10 @@
# define BX_PLATFORM_NAME "Windows"
#elif BX_PLATFORM_WINRT
# define BX_PLATFORM_NAME "WinRT"
#elif BX_PLATFORM_XBOX360
# define BX_PLATFORM_NAME "Xbox 360"
#elif BX_PLATFORM_XBOXONE
# define BX_PLATFORM_NAME "Xbox One"
#endif // BX_PLATFORM_
#if BX_CPU_ARM

View File

@ -298,12 +298,12 @@ function toolchain(_buildDir, _libDir)
premake.vstudio.toolset = ("v110_xp")
location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
end
if ("vs2013-xp") == _OPTIONS["vs"] then
premake.vstudio.toolset = ("v120_xp")
location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
end
elseif _ACTION == "xcode4" then
if "osx" == _OPTIONS["xcode"] then
@ -414,7 +414,6 @@ function toolchain(_buildDir, _libDir)
defines { "WIN32" }
includedirs { path.join(bxDir, "include/compat/mingw") }
buildoptions {
"-std=c++11",
"-Wunused-value",
"-fdata-sections",
"-ffunction-sections",
@ -422,6 +421,9 @@ function toolchain(_buildDir, _libDir)
"-Wunused-value",
"-Wundef",
}
buildoptions_cpp {
"-std=c++0x",
}
linkoptions {
"-Wl,--gc-sections",
"-static-libgcc",
@ -486,11 +488,13 @@ function toolchain(_buildDir, _libDir)
configuration { "linux-*" }
buildoptions {
"-std=c++0x",
"-msse2",
"-Wunused-value",
"-Wundef",
}
buildoptions_cpp {
"-std=c++0x",
}
links {
"rt",
"dl",
@ -845,10 +849,12 @@ function toolchain(_buildDir, _libDir)
"__STDC_VERSION__=199901L",
}
buildoptions {
"-std=c++0x",
"-Wunused-value",
"-Wundef",
}
buildoptions_cpp {
"-std=c++0x",
}
includedirs {
"/opt/vc/include",
"/opt/vc/include/interface/vcos/pthreads",

Binary file not shown.

Binary file not shown.

Binary file not shown.

13
3rdparty/genie/.editorconfig vendored Normal file
View File

@ -0,0 +1,13 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
max_line_length = 100
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
max_line_length = 80

View File

@ -14,7 +14,7 @@ Supported project generators:
Download (stable)
-----------------
version 206 (commit e65d8143b1186496b9da03c6461a25402a2ee873)
version 225 (commit 2321131cbf61d5a13df44c255b8d18d73121149d)
Linux:
https://github.com/bkaradzic/bx/raw/master/tools/bin/linux/genie

View File

@ -3,8 +3,6 @@ ifndef config
config=release
endif
override undefine TARGET
ifndef verbose
SILENT = @
endif
@ -20,9 +18,11 @@ endif
ifeq (posix,$(SHELLTYPE))
MKDIR = $(SILENT) mkdir -p "$(1)"
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
RM= $(SILENT) rm -f "$(1)"
else
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))"
RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0
endif
CC = gcc
@ -40,68 +40,69 @@ endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/darwin
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -mmacosx-version-min=10.4
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -Wl,-x -mmacosx-version-min=10.4
LDDEPS +=
LIBS += $(LDDEPS) -framework CoreServices
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -115,68 +116,69 @@ endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/darwin
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -mmacosx-version-min=10.4
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -mmacosx-version-min=10.4
LDDEPS +=
LIBS += $(LDDEPS) -framework CoreServices
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -190,68 +192,69 @@ endif
ifeq ($(config),releaseuniv32)
OBJDIR = obj/Universal32/Release
TARGETDIR = ../../bin/darwin
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -Wl,-x -arch i386 -arch ppc -mmacosx-version-min=10.4
LDDEPS +=
LIBS += $(LDDEPS) -framework CoreServices
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -265,68 +268,69 @@ endif
ifeq ($(config),debuguniv32)
OBJDIR = obj/Universal32/Debug
TARGETDIR = ../../bin/darwin
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_MACOSX
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -arch i386 -arch ppc -mmacosx-version-min=10.4
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -arch i386 -arch ppc -mmacosx-version-min=10.4
LDDEPS +=
LIBS += $(LDDEPS) -framework CoreServices
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -360,9 +364,7 @@ $(TARGETDIR):
$(OBJDIRS):
@echo Creating $(OBJDIR)
-$(call MKDIR,$(OBJDIR))
-$(call MKDIR,$(OBJDIR)/src/host)
-$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src)
-$(call MKDIR,$@)
clean:
@echo Cleaning genie
@ -386,7 +388,7 @@ $(GCH): $(PCH)
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
endif
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -394,27 +396,23 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -426,19 +424,23 @@ $(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -450,79 +452,15 @@ $(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -530,19 +468,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -550,11 +492,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -562,23 +500,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -586,6 +528,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"

View File

@ -3,8 +3,6 @@ ifndef config
config=release
endif
override undefine TARGET
ifndef verbose
SILENT = @
endif
@ -20,9 +18,11 @@ endif
ifeq (posix,$(SHELLTYPE))
MKDIR = $(SILENT) mkdir -p "$(1)"
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
RM= $(SILENT) rm -f "$(1)"
else
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))"
RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0
endif
CC = gcc
@ -40,68 +40,69 @@ endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/linux
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
LDDEPS +=
LIBS += $(LDDEPS) -ldl -lm
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -115,68 +116,69 @@ endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/linux
TARGET = $(TARGETDIR)/genie
override TARGET = $(TARGETDIR)/genie
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
LDDEPS +=
LIBS += $(LDDEPS) -ldl -lm
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -189,8 +191,8 @@ endif
OBJDIRS := \
$(OBJDIR) \
$(OBJDIR)/src/host \
$(OBJDIR)/src/host/lua-5.2.3/src \
$(OBJDIR)/src/host \
RESOURCES := \
@ -210,9 +212,7 @@ $(TARGETDIR):
$(OBJDIRS):
@echo Creating $(OBJDIR)
-$(call MKDIR,$(OBJDIR))
-$(call MKDIR,$(OBJDIR)/src/host)
-$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src)
-$(call MKDIR,$@)
clean:
@echo Cleaning genie
@ -236,7 +236,7 @@ $(GCH): $(PCH)
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
endif
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -244,27 +244,23 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -276,19 +272,23 @@ $(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -300,79 +300,15 @@ $(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -380,19 +316,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -400,11 +340,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -412,23 +348,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -436,6 +376,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"

View File

@ -3,8 +3,6 @@ ifndef config
config=release
endif
override undefine TARGET
ifndef verbose
SILENT = @
endif
@ -20,9 +18,11 @@ endif
ifeq (posix,$(SHELLTYPE))
MKDIR = $(SILENT) mkdir -p "$(1)"
COPY = $(SILENT) cp -fR "$(1)" "$(2)"
RM= $(SILENT) rm -f "$(1)"
else
MKDIR = $(SILENT) mkdir "$(subst /,\\,$(1))" 2> nul || exit 0
COPY = $(SILENT) copy /Y "$(subst /,\\,$(1))" "$(subst /,\\,$(2))"
RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0
endif
CC = gcc
@ -40,68 +40,69 @@ endif
ifeq ($(config),release)
OBJDIR = obj/Release
TARGETDIR = ../../bin/windows
TARGET = $(TARGETDIR)/genie.exe
override TARGET = $(TARGETDIR)/genie.exe
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -s
LDDEPS +=
LIBS += $(LDDEPS) -lole32
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -115,68 +116,69 @@ endif
ifeq ($(config),debug)
OBJDIR = obj/Debug
TARGETDIR = ../../bin/windows
TARGET = $(TARGETDIR)/genie.exe
override TARGET = $(TARGETDIR)/genie.exe
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE
INCLUDES += -I../../src/host/lua-5.2.3/src
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L.
LDDEPS +=
LIBS += $(LDDEPS) -lole32
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
OBJECTS := \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/os_stat.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_chdir.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_isfile.o \
$(OBJDIR)/src/host/os_copyfile.o \
$(OBJDIR)/src/host/scripts.o \
$(OBJDIR)/src/host/string_endswith.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/os_getversion.o \
$(OBJDIR)/src/host/premake_main.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/string_hash.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_rmdir.o \
$(OBJDIR)/src/host/os_match.o \
$(OBJDIR)/src/host/premake.o \
$(OBJDIR)/src/host/os_isdir.o \
$(OBJDIR)/src/host/os_uuid.o \
$(OBJDIR)/src/host/os_pathsearch.o \
$(OBJDIR)/src/host/os_getcwd.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/os_mkdir.o \
$(OBJDIR)/src/host/path_isabsolute.o \
$(OBJDIR)/src/host/os_is64bit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lparser.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstring.o \
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o \
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o \
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o \
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o \
define PREBUILDCMDS
@ -189,8 +191,8 @@ endif
OBJDIRS := \
$(OBJDIR) \
$(OBJDIR)/src/host/lua-5.2.3/src \
$(OBJDIR)/src/host \
$(OBJDIR)/src/host/lua-5.2.3/src \
RESOURCES := \
@ -210,9 +212,7 @@ $(TARGETDIR):
$(OBJDIRS):
@echo Creating $(OBJDIR)
-$(call MKDIR,$(OBJDIR))
-$(call MKDIR,$(OBJDIR)/src/host/lua-5.2.3/src)
-$(call MKDIR,$(OBJDIR)/src/host)
-$(call MKDIR,$@)
clean:
@echo Cleaning genie
@ -236,7 +236,7 @@ $(GCH): $(PCH)
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
endif
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -244,27 +244,23 @@ $(OBJDIR)/src/host/os_stat.o: ../../src/host/os_stat.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_chdir.o: ../../src/host/os_chdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_isfile.o: ../../src/host/os_isfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_copyfile.o: ../../src/host/os_copyfile.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -276,19 +272,23 @@ $(OBJDIR)/src/host/string_endswith.o: ../../src/host/string_endswith.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getversion.o: ../../src/host/os_getversion.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/premake_main.o: ../../src/host/premake_main.c
$(OBJDIR)/src/host/string_hash.o: ../../src/host/string_hash.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_rmdir.o: ../../src/host/os_rmdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_match.o: ../../src/host/os_match.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -300,79 +300,15 @@ $(OBJDIR)/src/host/os_isdir.o: ../../src/host/os_isdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_uuid.o: ../../src/host/os_uuid.c
$(OBJDIR)/src/host/os_mkdir.o: ../../src/host/os_mkdir.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_pathsearch.o: ../../src/host/os_pathsearch.c
$(OBJDIR)/src/host/path_isabsolute.o: ../../src/host/path_isabsolute.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/os_getcwd.o: ../../src/host/os_getcwd.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
$(OBJDIR)/src/host/os_is64bit.o: ../../src/host/os_is64bit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -380,19 +316,23 @@ $(OBJDIR)/src/host/lua-5.2.3/src/ldump.o: ../../src/host/lua-5.2.3/src/ldump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lvm.o: ../../src/host/lua-5.2.3/src/lvm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltable.o: ../../src/host/lua-5.2.3/src/ltable.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstrlib.o: ../../src/host/lua-5.2.3/src/lstrlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
$(OBJDIR)/src/host/lua-5.2.3/src/liolib.o: ../../src/host/lua-5.2.3/src/liolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
$(OBJDIR)/src/host/lua-5.2.3/src/lcode.o: ../../src/host/lua-5.2.3/src/lcode.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -400,11 +340,7 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lparser.o: ../../src/host/lua-5.2.3/src/lparser
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
$(OBJDIR)/src/host/lua-5.2.3/src/loadlib.o: ../../src/host/lua-5.2.3/src/loadlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -412,23 +348,27 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lbitlib.o: ../../src/host/lua-5.2.3/src/lbitlib
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lzio.o: ../../src/host/lua-5.2.3/src/lzio.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldblib.o: ../../src/host/lua-5.2.3/src/ldblib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmathlib.o: ../../src/host/lua-5.2.3/src/lmathlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lfunc.o: ../../src/host/lua-5.2.3/src/lfunc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lmem.o: ../../src/host/lua-5.2.3/src/lmem.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
$(OBJDIR)/src/host/lua-5.2.3/src/lgc.o: ../../src/host/lua-5.2.3/src/lgc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
@ -436,6 +376,66 @@ $(OBJDIR)/src/host/lua-5.2.3/src/lstring.o: ../../src/host/lua-5.2.3/src/lstring
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/linit.o: ../../src/host/lua-5.2.3/src/linit.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltm.o: ../../src/host/lua-5.2.3/src/ltm.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lapi.o: ../../src/host/lua-5.2.3/src/lapi.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lctype.o: ../../src/host/lua-5.2.3/src/lctype.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lstate.o: ../../src/host/lua-5.2.3/src/lstate.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lbaselib.o: ../../src/host/lua-5.2.3/src/lbaselib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ltablib.o: ../../src/host/lua-5.2.3/src/ltablib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lauxlib.o: ../../src/host/lua-5.2.3/src/lauxlib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lcorolib.o: ../../src/host/lua-5.2.3/src/lcorolib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/llex.o: ../../src/host/lua-5.2.3/src/llex.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldo.o: ../../src/host/lua-5.2.3/src/ldo.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lundump.o: ../../src/host/lua-5.2.3/src/lundump.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lopcodes.o: ../../src/host/lua-5.2.3/src/lopcodes.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/loslib.o: ../../src/host/lua-5.2.3/src/loslib.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/lobject.o: ../../src/host/lua-5.2.3/src/lobject.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"
$(OBJDIR)/src/host/lua-5.2.3/src/ldebug.o: ../../src/host/lua-5.2.3/src/ldebug.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<"

View File

@ -41,7 +41,12 @@ release-linux: $(GENIE)
$(SILENT) $(GENIE) release
$(SILENT) make -C build/gmake.darwin clean all CC=x86_64-apple-darwin13-clang++
$(SILENT) make -C build/gmake.linux clean all
$(SILENT) make -C build/gmake.windows clean all CC=x86_64-w64-mingw32-gcc
$(SILENT) make -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc
$(SILENT) git checkout src/host/version.h
release: release-$(OS)
dist: release
cp bin/linux/genie ../bx/tools/bin/linux/
cp bin/windows/genie.exe ../bx/tools/bin/windows/
cp bin/darwin/genie ../bx/tools/bin/darwin/

View File

@ -7,8 +7,8 @@
-- default when folks build using the makefile. That way they don't have to
-- worry about the /scripts argument and all that.
--
premake.make.undefine = { "TARGET" }
premake.make.override = { "TARGET" }
solution "genie"
configurations {
"Release",
@ -33,15 +33,15 @@
"../**.lua",
"../src/**.h",
"../src/**.c",
"../src/host/scripts.c"
"../src/host/scripts.c",
}
excludes {
removefiles {
"../src/premake.lua",
"../src/host/lua-5.2.3/src/lua.c",
"../src/host/lua-5.2.3/src/luac.c",
"../src/host/lua-5.2.3/**.lua",
"../src/host/lua-5.2.3/etc/*.c"
"../src/host/lua-5.2.3/etc/*.c",
}
configuration "Debug"

View File

@ -5,7 +5,7 @@
--
premake.make.cpp = { }
premake.make.undefine = { }
premake.make.override = { }
local cpp = premake.make.cpp
local make = premake.make
@ -89,8 +89,10 @@
if (not prj.options.ArchiveSplit) then
_p('\t$(SILENT) $(LINKCMD) $(OBJECTS)')
else
_p('\t$(call RM,$(TARGET))')
_p('\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')
end
_p('\t$(SILENT) $(LINKCMD_NDX)')
end
else
if prj.msglinking then
_p('\t@echo ' .. prj.msglinking)
@ -111,10 +113,7 @@
if (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, "SkipCreatingMessage")) then
_p('\t@echo Creating $(OBJDIR)')
end
_p('\t-$(call MKDIR,$(OBJDIR))')
for dir, _ in pairs(objdirs) do
_p('\t-$(call MKDIR,$(OBJDIR)/%s)', dir)
end
_p('\t-$(call MKDIR,$@)')
_p('')
-- Mac OS X specific targets
@ -174,10 +173,7 @@
_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))
_p('endif')
_p('')
for _, variable in ipairs(premake.make.undefine) do
_p('override undefine '.. variable)
end
_p('')
_p('ifndef verbose')
_p(' SILENT = @')
_p('endif')
@ -196,9 +192,11 @@
_p('ifeq (posix,$(SHELLTYPE))')
_p(' MKDIR = $(SILENT) mkdir -p "$(1)"')
_p(' COPY = $(SILENT) cp -fR "$(1)" "$(2)"')
_p(' RM = $(SILENT) rm -f "$(1)"')
_p('else')
_p(' MKDIR = $(SILENT) mkdir "$(subst /,\\\\,$(1))" 2> nul || exit 0')
_p(' COPY = $(SILENT) copy /Y "$(subst /,\\\\,$(1))" "$(subst /,\\\\,$(2))"')
_p(' RM = $(SILENT) del /F "$(subst /,\\\\,$(1))" 2> nul || exit 0')
_p('endif')
_p('')
@ -228,9 +226,9 @@
-- if this platform requires a special compiler or linker, list it here
cpp.platformtools(cfg, cc)
_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(' ' .. (table.contains(premake.make.override,"OBJDIR") and "override " or "") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))
_p(' ' .. (table.contains(premake.make.override,"TARGETDIR") and "override " or "") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))
_p(' ' .. (table.contains(premake.make.override,"TARGET") and "override " or "") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))
_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))
_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))
@ -241,7 +239,7 @@
cpp.flags(cfg, cc)
-- write out libraries, linker flags, and the link command
cpp.linker(cfg, cc)
cpp.linker(prj, cfg, cc)
-- add objects for compilation, and remove any that are excluded per config.
_p(' OBJECTS := \\')
@ -329,8 +327,8 @@
_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " "))
_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))
_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))
_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',
make.list(table.join(cc.getdefines(cfg.resdefines),
@ -343,7 +341,7 @@
-- and the linker command.
--
function cpp.linker(cfg, cc)
function cpp.linker(prj, cfg, cc)
-- Patch #3401184 changed the order
_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))
@ -354,10 +352,20 @@
if cfg.platform:startswith("Universal") then
_p(' LINKCMD = libtool -o $(TARGET)')
else
if cc.llvm then
_p(' LINKCMD = $(AR) rcs $(TARGET)')
if (not prj.options.ArchiveSplit) then
if cc.llvm then
_p(' LINKCMD = $(AR) rcs $(TARGET)')
else
_p(' LINKCMD = $(AR) -rcs $(TARGET)')
end
else
_p(' LINKCMD = $(AR) -rcs $(TARGET)')
if cc.llvm then
_p(' LINKCMD = $(AR) qc $(TARGET)')
_p(' LINKCMD_NDX= $(AR) cs $(TARGET)')
else
_p(' LINKCMD = $(AR) -qc $(TARGET)')
_p(' LINKCMD_NDX= $(AR) -cs $(TARGET)')
end
end
end
else

View File

@ -11,7 +11,7 @@
--
local toolsets = {
vs2010 = "v90",
vs2010 = "v100",
vs2012 = "v110",
vs2013 = "v120",
vs2015 = "v140"

View File

@ -262,20 +262,20 @@
local function compile_language(cfg)
if cfg.options.ForceCPP then
_p(3,'<CompileAs>CompileAsCpp</CompileAs>')
_p(3,'<CompileAs>CompileAsCpp</CompileAs>')
else
if cfg.language == "C" then
_p(3,'<CompileAs>CompileAsC</CompileAs>')
end
end
end
local function forcedinclude_files(indent,cfg)
if #cfg.forcedincludes > 0 then
_p(indent,'<ForcedIncludeFiles>%s</ForcedIncludeFiles>'
,premake.esc(path.translate(table.concat(cfg.forcedincludes, ";"), '\\')))
end
end
end
local function vs10_clcompile(cfg)
_p(2,'<ClCompile>')
@ -343,7 +343,7 @@
end
compile_language(cfg)
forcedinclude_files(3,cfg);
_p(2,'</ClCompile>')
end
@ -484,6 +484,15 @@
function exists(table, fine)
for _, value in ipairs(table) do
if value == find then return true end
end
return false
end
--
-- Retrieve a list of files for a particular build group, one of
-- "ClInclude", "ClCompile", "ResourceCompile", and "None".
@ -505,7 +514,9 @@
if path.iscppfile(file.name) then
table.insert(sortedfiles.ClCompile, file)
elseif path.iscppheader(file.name) then
table.insert(sortedfiles.ClInclude, file)
if not exists(prj.removefiles, file) then
table.insert(sortedfiles.ClInclude, file)
end
elseif path.isresourcefile(file.name) then
table.insert(sortedfiles.ResourceCompile, file)
else
@ -594,13 +605,36 @@
end
end
-- Per configuration excludes
for _, vsconfig in ipairs(configs) do
local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)
for _, exclude in ipairs(cfg.excludes) do
-- Global exclude
local excluded = false
for _, exclude in ipairs(prj.excludes) do
if exclude == file.name then
for _, vsconfig in ipairs(configs) do
local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)
_p(3, '<ExcludedFromBuild '
.. if_config_and_platform()
.. '>true</ExcludedFromBuild>'
, premake.esc(vsconfig.name)
)
end
excluded = true
break
end
end
if exclude == file.name then
_p(3, '<ExcludedFromBuild ' .. if_config_and_platform() .. '>true</ExcludedFromBuild>', premake.esc(vsconfig.name))
if not excluded then
-- Per configuration excludes
for _, vsconfig in ipairs(configs) do
local cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)
for _, exclude in ipairs(cfg.excludes) do
if exclude == file.name then
_p(3, '<ExcludedFromBuild '
.. if_config_and_platform()
.. '>true</ExcludedFromBuild>'
, premake.esc(vsconfig.name)
)
end
end
end
end
@ -739,7 +773,7 @@
io.eol = "\r\n"
_p('<?xml version="1.0" encoding="utf-8"?>')
_p('<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">')
_p(1,'<Identity Name="' .. prj.uuid .. '"')
_p(2,'Publisher="CN=Unknown"')
_p(2,'Version="1.0.0.0" />')
@ -777,4 +811,4 @@
_p(1,'</Applications>')
_p('</Package>')
end
end

View File

@ -17,7 +17,7 @@
kind = "string",
scope = "config",
},
basedir =
{
kind = "path",
@ -47,19 +47,19 @@
kind = "list",
scope = "config",
},
buildoptions_cpp =
{
kind = "list",
scope = "config",
},
buildoptions_objc =
{
kind = "list",
scope = "config",
},
configurations =
{
kind = "list",
@ -109,6 +109,12 @@
scope = "config",
},
removefiles =
{
kind = "filelist",
scope = "config",
},
flags =
{
kind = "list",
@ -189,7 +195,7 @@
}
},
forcedincludes =
forcedincludes =
{
kind = "absolutefilelist",
scope = "config",
@ -305,7 +311,7 @@
kind = "list",
scope = "config",
},
messageskip =
{
@ -335,31 +341,31 @@
{
kind = "string",
scope = "config",
},
},
msgcompile =
{
kind = "string",
scope = "config",
},
},
msgcompile_objc =
{
kind = "string",
scope = "config",
},
},
msgresource =
{
kind = "string",
scope = "config",
},
},
msglinking =
{
kind = "string",
scope = "config",
},
},
objdir =
{
@ -536,7 +542,7 @@
premake.check_paths = false
--
-- Check to see if a value exists in a list of values, using a
-- case-insensitive match. If the value does exist, the canonical
@ -640,7 +646,7 @@
if value then
add(value, 5)
end
return obj[fieldname]
end
@ -664,7 +670,7 @@
if value:find("*") then
local arr = matchfunc(value);
if (premake.check_paths) and (#arr == 0) then
error("Can't find matching files for pattern :" .. value)
error("Can't find matching files for pattern :" .. value)
end
makeabsolute(arr, depth + 1)
else
@ -770,7 +776,7 @@
end
end
-- find the container for the value
-- find the container for the value
local container, err = premake.getobject(scope)
if (not container) then
error(err, 3)
@ -804,10 +810,10 @@
end
-- list value types get a remove() call too
if info.kind == "list" or
info.kind == "dirlist" or
if info.kind == "list" or
info.kind == "dirlist" or
info.kind == "filelist" or
info.kind == "absolutefilelist"
info.kind == "absolutefilelist"
then
_G["remove"..name] = function(value)
premake.remove(name, value)
@ -895,7 +901,7 @@
-- the path to create groups from (i.e. "Examples/Simple")
-- @param sln
-- the solution to add the groups to
-- @returns
-- @returns
-- the group object for the deepest folder
--
@ -960,7 +966,7 @@
prj.basedir = os.getcwd()
prj.uuid = os.uuid(prj.name)
prj.blocks = { }
prj.usage = isUsage
prj.usage = isUsage
prj.group = group
return prj;
@ -985,46 +991,46 @@
error("no active solution", 2)
end
-- if this is a new project, or the project in that slot doesn't have a usage, create it
if((not sln.projects[name]) or
((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then
premake.CurrentContainer = createproject(name, sln, true)
else
premake.CurrentContainer = iff(sln.projects[name].usage,
sln.projects[name], sln.projects[name].usageProj)
end
-- add an empty, global configuration to the project
configuration { }
return premake.CurrentContainer
end
function project(name)
if (not name) then
--Only return non-usage projects
if(type(premake.CurrentContainer) ~= "project") then return nil end
if(premake.CurrentContainer.usage) then return nil end
return premake.CurrentContainer
-- if this is a new project, or the project in that slot doesn't have a usage, create it
if((not sln.projects[name]) or
((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then
premake.CurrentContainer = createproject(name, sln, true)
else
premake.CurrentContainer = iff(sln.projects[name].usage,
sln.projects[name], sln.projects[name].usageProj)
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
-- add an empty, global configuration to the project
configuration { }
-- if this is a new project, or the old project is a usage project, create it
if((not sln.projects[name]) or sln.projects[name].usage) then
premake.CurrentContainer = createproject(name, sln)
else
premake.CurrentContainer = sln.projects[name];
end
return premake.CurrentContainer
end
function project(name)
if (not name) then
--Only return non-usage projects
if(type(premake.CurrentContainer) ~= "project") then return nil end
if(premake.CurrentContainer.usage) then return nil end
return premake.CurrentContainer
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, or the old project is a usage project, create it
if((not sln.projects[name]) or sln.projects[name].usage) then
premake.CurrentContainer = createproject(name, sln)
else
premake.CurrentContainer = sln.projects[name];
end
-- add an empty, global configuration to the project
configuration { }
@ -1055,7 +1061,7 @@
function group(name)
if not name then
if not name then
return premake.CurrentGroup
end
premake.CurrentGroup = name

View File

@ -2,8 +2,8 @@
-- base/bake.lua
--
-- Takes all the configuration information provided by the project scripts
-- and stored in the solution->project->block hierarchy and flattens it all
-- down into one object per configuration. These objects are cached with the
-- and stored in the 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 eachconfig().
--
-- Copyright (c) 2008-2011 Jason Perkins and the Premake project
@ -15,7 +15,7 @@
-- do not copy these fields into the configurations
local nocopy =
local nocopy =
{
blocks = true,
keywords = true,
@ -25,11 +25,11 @@
-- do not cascade these fields from projects to configurations
local nocascade =
local nocascade =
{
makesettings = true,
}
-- leave these paths as absolute, rather than converting to project relative
local keeprelative =
@ -47,7 +47,7 @@
function premake.getactiveterms()
local terms = { _action = _ACTION:lower(), os = os.get() }
-- add option keys or values
for key, value in pairs(_OPTIONS) do
if value ~= "" then
@ -56,15 +56,15 @@
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
-- the values; on a match, the corresponding key is returned. This
-- enables testing for required values in iskeywordsmatch(), below.
--
@ -73,7 +73,7 @@
if keyword:startswith("not ") then
return not premake.iskeywordmatch(keyword:sub(5), terms)
end
for _, pattern in ipairs(keyword:explode(" or ")) do
for termkey, term in pairs(terms) do
if term:match(pattern) == term then
@ -82,9 +82,9 @@
end
end
end
--
-- Checks a set of configuration block keywords against a list of terms.
-- The required flag is used by the file configurations: only blocks
@ -104,7 +104,7 @@
hasrequired = true
end
end
if terms.required and not hasrequired then
return false
else
@ -125,15 +125,15 @@
local function adjustpaths(location, obj)
function adjustpathlist(list)
for i, p in ipairs(list) do
list[i] = path.getrelative(location, p)
list[i] = path.getrelative(location, p)
end
end
for name, value in pairs(obj) do
local field = premake.fields[name]
if field and value and not keeprelative[name] then
if field.kind == "path" then
obj[name] = path.getrelative(location, value)
obj[name] = path.getrelative(location, value)
elseif field.kind == "dirlist" or field.kind == "filelist" then
adjustpathlist(value)
elseif field.kind == "keypath" then
@ -144,8 +144,8 @@
end
end
end
--
-- Merge all of the fields from one object into another. String values are overwritten,
@ -176,21 +176,21 @@
local function removevalues(tbl, removes)
for i=#tbl,1,-1 do
for _, pattern in ipairs(removes) do
if pattern == tbl[i] then
table.remove(tbl, i)
break
end
end
end
for _, pattern in ipairs(removes) do
if pattern == tbl[i] then
table.remove(tbl, i)
break
end
end
end
end
local function mergeobject(dest, src)
-- if there's nothing to add, quick out
if not src then
return
if not src then
return
end
for fieldname, value in pairs(src) do
if not nocopy[fieldname] then
-- fields that are included in the API are merged...
@ -207,7 +207,7 @@
else
dest[fieldname] = value
end
-- ...everything else is just copied as-is
else
dest[fieldname] = value
@ -215,8 +215,8 @@
end
end
end
--
-- Merges the settings from a solution's or project's list of configuration blocks,
@ -245,33 +245,33 @@
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
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)
if (cfg.kind and not cfg.terms.kind) then
if (cfg.kind and not cfg.terms.kind) then
cfg.terms['kind'] = cfg.kind:lower()
terms['kind'] = cfg.kind:lower()
end
end
end
-- package it all up and add it to the result set
cfg.name = cfgname
cfg.platform = pltname
@ -280,9 +280,9 @@
end
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
@ -300,15 +300,15 @@
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
-- 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.
-- build a project-level configuration.
merge(result, obj, basis, terms)--this adjusts terms
-- now build configurations for each build config/platform pair
@ -322,7 +322,7 @@
end
end
end
return result
end
@ -339,12 +339,12 @@
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
@ -355,7 +355,7 @@
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)
@ -367,7 +367,7 @@
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
@ -376,21 +376,17 @@
local dir
local start = iif(cfg.name, 2, 1)
for v = start, num_variations do
for v = start, iif(cfg.flags.SingleOutputDir,num_variations-1,num_variations) do
dir = cfg_dirs[cfg][v]
if hit_counts[dir] == 1 then break end
end
if (cfg.flags.SingleOutputDir) then
cfg.objectsdir = cfg.objdir or cfg.project.objdir or "obj"
else
cfg.objectsdir = path.getrelative(cfg.location, dir)
end
cfg.objectsdir = path.getrelative(cfg.location, dir)
end
end
end
end
end
--
@ -414,24 +410,24 @@
end
end
end
end
end
local function getCfgKind(cfg)
if(cfg.kind) then
return cfg.kind;
end
if(cfg.project.__configs[""] and cfg.project.__configs[""].kind) then
return cfg.project.__configs[""].kind;
end
return nil
end
local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)
if(not cfg) then return end
local foundUsePrjs = {};
for _, useName in ipairs(cfg[searchField]) do
local testName = useName:lower();
@ -447,7 +443,7 @@
end
end
end
--Must connect to a usage project.
if(theUseProj) then
foundList[testName] = true;
@ -462,7 +458,7 @@
end
end
end
for _, usePrj in ipairs(foundUsePrjs) do
--Links can only recurse through static libraries.
if((searchField ~= "links") or
@ -472,7 +468,7 @@
end
end
end
--
-- This function will recursively get all projects that the given configuration has in its "uses"
-- field. The return values are a list of tables. Each table in that list contains the following:
@ -490,27 +486,27 @@
local dstArray = {};
local foundList = {};
foundList[cfg.project.name:lower()] = true;
--First, follow the uses recursively.
getprojrec(dstArray, foundList, cfg, cfgname, "uses", false);
--Next, go through all of the usage projects and recursively get their links.
--But only if they're not already there. Get the links as linkage-only.
local linkArray = {};
for prjName, prjEntry in pairs(dstArray) do
getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,
getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,
"links", true);
end
--Copy from linkArray into dstArray.
for prjName, prjEntry in pairs(linkArray) do
dstArray[prjName] = prjEntry;
end
return dstArray;
end
local function isnameofproj(cfg, strName)
local sln = cfg.project.solution;
local strTest = strName:lower();
@ -519,18 +515,18 @@
return true;
end
end
return false;
end
--
-- Copies the field from dstCfg to srcCfg.
--
local function copydependentfield(srcCfg, dstCfg, strSrcField)
local srcField = premake.fields[strSrcField];
local strDstField = strSrcField;
if type(srcCfg[strSrcField]) == "table" then
--handle paths.
if (srcField.kind == "dirlist" or srcField.kind == "filelist") and
@ -564,8 +560,8 @@
end
end
end
--
-- This function will take the list of project entries and apply their usage project data
-- to the given configuration. It will copy compiling information for the projects that are
@ -573,15 +569,15 @@
-- the source project is not a static library. It won't copy linking information
-- if the project is in this solution; instead it will add that project to the configuration's
-- links field, expecting that Premake will handle the rest.
--
--
local function copyusagedata(cfg, cfgname, linkToProjs)
local myPrj = cfg.project;
local bIsStaticLib = (getCfgKind(cfg) == "StaticLib");
for prjName, prjEntry in pairs(linkToProjs) do
local srcPrj = prjEntry.usageProj;
local srcCfg = srcPrj.__configs[cfgname];
for name, field in pairs(premake.fields) do
if(srcCfg[name]) then
if(field.usagecopy) then
@ -598,7 +594,7 @@
end
end
end
if((not bIsStaticLib) and prjEntry.proj) then
table.insert(cfg.links, prjEntry.proj.name);
end
@ -609,9 +605,9 @@
--
-- Main function, controls the process of flattening the configurations.
--
function premake.bake.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
@ -623,9 +619,9 @@
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
-- 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
@ -634,8 +630,8 @@
bake.postprocess(prj, cfg)
end
end
end
end
-- This loop finds the projects that a configuration is connected to
-- via its "uses" field. It will then copy any usage project information from that
-- usage project to the configuration in question.
@ -648,7 +644,7 @@
end
end
end
end
end
-- Remove all usage projects.
for sln in premake.solution.each() do
@ -658,20 +654,20 @@
table.insert(removeList, 1, index); --Add in reverse order.
end
end
for _, index in ipairs(removeList) do
table.remove(sln.projects, index);
end
end
-- assign unique object directories to each configuration
builduniquedirs()
-- walk it again and build the targets and unique directories
buildtargets(cfg)
end
--
-- Post-process a project configuration, applying path fix-ups and other adjustments
@ -687,10 +683,10 @@
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
@ -698,28 +694,28 @@
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
local removed = false
for _, removefname in ipairs(cfg.removefiles) do
removed = (fname == removefname)
if (removed) then break end
end
if (not excluded) then
if (not removed) then
table.insert(files, fname)
end
end
cfg.files = files
-- fixup the data
-- fixup the data
for name, field in pairs(premake.fields) do
-- re-key flag fields for faster lookups
if field.isflags then

View File

@ -64,38 +64,38 @@ const char* builtin_scripts[] = {
"premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" \nor config.isoptimizedbuild(cfg.flags)\nor cfg.flags.NoIncrementalLink then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\n",
/* base/bake.lua */
"premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy = \n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade = \n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched t"
"hen\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p) \nend\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value) \nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value)\nend\nelse\nfor _, item in ipairs(src) do\nif not tbl[item] then\ntable.insert(tbl, ite"
"m)\ntbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\n for _, pattern in ipairs(removes) do\n if pattern == tbl[i] then\n table.remove(tbl, i)\n break\n end\n end\n end\nend\nlocal function mergeobject(dest, src)\nif not src then \nreturn \nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend"
"\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then \nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then \ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nf"
"or _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_local, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, "
"2, 1)\nfor v = start, num_variations do\ndir = cfg_dirs[cfg][v]\nif hit_counts[dir] == 1 then break end\nend\nif (cfg.flags.SingleOutputDir) then\ncfg.objectsdir = cfg.objdir or cfg.project.objdir or \"obj\"\nelse\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n \n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].k"
"ind;\n end\n \n return nil\n end\n \n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n \n local foundUsePrjs = {};\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n \n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n \n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind("
"usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n \n --\n -- This function will recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local func"
"tion getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n \n --First, follow the uses recursively.\n getprojrec(dstArray, foundList, cfg, cfgname, \"uses\", false);\n \n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname, \n \"links\", true);\n end\n \n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n \n return dstArray;\n end\n \n \n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n \n return false;\n e"
"nd\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n \n if type(srcCfg[strSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n"
" dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n \n --\n -- This function will take the list of project entries and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n \n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n \n for name, field"
" in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n \n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\n"
"local basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nloca"
"l platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }\nfor _, fname in ipairs(cfg.files) do\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (fname == exclude)\nif (excluded) then break end\nend\nif (not excluded) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
"premake.bake = { }\nlocal bake = premake.bake\nlocal nocopy =\n{\nblocks = true,\nkeywords = true,\nprojects = true,\n__configs = true,\n}\nlocal nocascade =\n{\nmakesettings = true,\n}\nlocal keeprelative =\n{\nbasedir = true,\nlocation = true,\n}\nfunction premake.getactiveterms()\nlocal terms = { _action = _ACTION:lower(), os = os.get() }\nfor key, value in pairs(_OPTIONS) do\nif value ~= \"\" then\ntable.insert(terms, value:lower())\nelse\ntable.insert(terms, key:lower())\nend\nend\nreturn terms\nend\nfunction premake.iskeywordmatch(keyword, terms)\nif keyword:startswith(\"not \") then\nreturn not premake.iskeywordmatch(keyword:sub(5), terms)\nend\nfor _, pattern in ipairs(keyword:explode(\" or \")) do\nfor termkey, term in pairs(terms) do\nif term:match(pattern) == term then\nreturn termkey\nend\nend\nend\nend\nfunction premake.iskeywordsmatch(keywords, terms)\nlocal hasrequired = false\nfor _, keyword in ipairs(keywords) do\nlocal matched = premake.iskeywordmatch(keyword, terms)\nif not matched the"
"n\nreturn false\nend\nif matched == \"required\" then\nhasrequired = true\nend\nend\nif terms.required and not hasrequired then\nreturn false\nelse\nreturn true\nend\nend\nlocal function adjustpaths(location, obj)\nfunction adjustpathlist(list)\nfor i, p in ipairs(list) do\nlist[i] = path.getrelative(location, p)\nend\nend\nfor name, value in pairs(obj) do\nlocal field = premake.fields[name]\nif field and value and not keeprelative[name] then\nif field.kind == \"path\" then\nobj[name] = path.getrelative(location, value)\nelseif field.kind == \"dirlist\" or field.kind == \"filelist\" then\nadjustpathlist(value)\nelseif field.kind == \"keypath\" then\nfor k,v in pairs(value) do\nadjustpathlist(v)\nend\nend\nend\nend\nend\nlocal function mergefield(kind, dest, src)\nlocal tbl = dest or { }\nif kind == \"keyvalue\" or kind == \"keypath\" then\nfor key, value in pairs(src) do\ntbl[key] = mergefield(\"list\", tbl[key], value)\nend\nelse\nfor _, item in ipairs(src) do\nif not tbl[item] then\ntable.insert(tbl, item)\n"
"tbl[item] = item\nend\nend\nend\nreturn tbl\nend\nlocal function removevalues(tbl, removes)\nfor i=#tbl,1,-1 do\nfor _, pattern in ipairs(removes) do\nif pattern == tbl[i] then\ntable.remove(tbl, i)\nbreak\nend\nend\nend\nend\nlocal function mergeobject(dest, src)\nif not src then\nreturn\nend\nfor fieldname, value in pairs(src) do\nif not nocopy[fieldname] then\nlocal field = premake.fields[fieldname]\nif field then\nif type(value) == \"table\" then\ndest[fieldname] = mergefield(field.kind, dest[fieldname], value)\nif src.removes then\nremoves = src.removes[fieldname]\nif removes then\nremovevalues(dest[fieldname], removes)\nend\nend\nelse\ndest[fieldname] = value\nend\nelse\ndest[fieldname] = value\nend\nend\nend\nend\nlocal function merge(dest, obj, basis, terms, cfgname, pltname)\nlocal key = cfgname or \"\"\npltname = pltname or \"Native\"\nif pltname ~= \"Native\" then\nkey = key .. pltname\nend\nterms.config = (cfgname or \"\"):lower()\nterms.platform = pltname:lower()\nlocal cfg = {}\nmergeobject(cfg, "
"basis[key])\nadjustpaths(obj.location, cfg)\nmergeobject(cfg, obj)\nif (cfg.kind) then\nterms['kind']=cfg.kind:lower()\nend\nfor _, blk in ipairs(obj.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, terms))then\nmergeobject(cfg, blk)\nif (cfg.kind and not cfg.terms.kind) then\ncfg.terms['kind'] = cfg.kind:lower()\nterms['kind'] = cfg.kind:lower()\nend\nend\nend\ncfg.name = cfgname\ncfg.platform = pltname\nfor k,v in pairs(terms) do\ncfg.terms[k] =v\nend\ndest[key] = cfg\nend\nlocal function collapse(obj, basis)\nlocal result = {}\nbasis = basis or {}\nlocal sln = obj.solution or obj\nlocal terms = premake.getactiveterms()\nmerge(result, obj, basis, terms)--this adjusts terms\nfor _, cfgname in ipairs(sln.configurations) do\nlocal terms_local = {}\nfor k,v in pairs(terms)do terms_local[k]=v end\nmerge(result, obj, basis, terms_local, cfgname, \"Native\")--terms cam also be adjusted here\nfor _, pltname in ipairs(sln.platforms or {}) do\nif pltname ~= \"Native\" then\nmerge(result, obj, basis,terms_lo"
"cal, cfgname, pltname)--terms also here\nend\nend\nend\nreturn result\nend\nlocal function builduniquedirs()\nlocal num_variations = 4\nlocal cfg_dirs = {}\nlocal hit_counts = {}\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dirs = { }\ndirs[1] = path.getabsolute(path.join(cfg.location, cfg.objdir or cfg.project.objdir or \"obj\"))\ndirs[2] = path.join(dirs[1], iif(cfg.platform == \"Native\", \"\", cfg.platform))\ndirs[3] = path.join(dirs[2], cfg.name)\ndirs[4] = path.join(dirs[3], cfg.project.name)\ncfg_dirs[cfg] = dirs\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, num_variations do\nlocal d = dirs[v]\nhit_counts[d] = (hit_counts[d] or 0) + 1\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal dir\nlocal start = iif(cfg.name, 2, 1)\nfor v = start, iif(cfg.flags.SingleOutputDir,num_variations-1,num_variations) do\ndir = cfg_dirs[cfg][v]\n"
"if hit_counts[dir] == 1 then break end\nend\ncfg.objectsdir = path.getrelative(cfg.location, dir)\nend\nend\nend\nend\nlocal function buildtargets()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nfor _, cfg in pairs(prj.__configs) do\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\ncfg.buildtarget = premake.gettarget(cfg, \"build\", pathstyle, namestyle, cfg.system)\ncfg.linktarget = premake.gettarget(cfg, \"link\", pathstyle, namestyle, cfg.system)\nif pathstyle == \"windows\" then\ncfg.objectsdir = path.translate(cfg.objectsdir, \"\\\\\")\nend\nend\nend\nend\nend\n local function getCfgKind(cfg)\n if(cfg.kind) then\n return cfg.kind;\n end\n if(cfg.project.__configs[\"\"] and cfg.project.__configs[\"\"].kind) then\n return cfg.project.__configs[\"\"].kind;\n end\n return nil\n end\n local function getprojrec(dstArray, foundList, cfg, cfgname, searchField, bLinkage)\n if(not cfg) then return end\n local foundUsePrjs = {};"
"\n for _, useName in ipairs(cfg[searchField]) do\n local testName = useName:lower();\n if((not foundList[testName])) then\n local theProj = nil;\n local theUseProj = nil;\n for _, prj in ipairs(cfg.project.solution.projects) do\n if (prj.name:lower() == testName) then\n if(prj.usage) then\n theUseProj = prj;\n else\n theProj = prj;\n end\n end\n end\n --Must connect to a usage project.\n if(theUseProj) then\n foundList[testName] = true;\n local prjEntry = {\n name = testName,\n proj = theProj,\n usageProj = theUseProj,\n bLinkageOnly = bLinkage,\n };\n dstArray[testName] = prjEntry;\n table.insert(foundUsePrjs, theUseProj);\n end\n end\n end\n for _, usePrj in ipairs(foundUsePrjs) do\n --Links can only recurse through static libraries.\n if((searchField ~= \"links\") or\n (getCfgKind(usePrj.__configs[cfgname]) == \"StaticLib\")) then\n getprojrec(dstArray, foundList, usePrj.__configs[cfgname],\n cfgname, searchField, bLinkage);\n end\n end\n end\n --\n -- This function wi"
"ll recursively get all projects that the given configuration has in its \"uses\"\n -- field. The return values are a list of tables. Each table in that list contains the following:\n --name = The lowercase name of the project.\n --proj = The project. Can be nil if it is usage-only.\n --usageProj = The usage project. Can't be nil, as using a project that has no\n -- usage project is not put into the list.\n --bLinkageOnly = If this is true, then only the linkage information should be copied.\n -- The recursion will only look at the \"uses\" field on *usage* projects.\n -- This function will also add projects to the list that are mentioned in the \"links\"\n -- field of usage projects. These will only copy linker information, but they will recurse.\n -- through other \"links\" fields.\n --\n local function getprojectsconnections(cfg, cfgname)\n local dstArray = {};\n local foundList = {};\n foundList[cfg.project.name:lower()] = true;\n --First, follow the uses recursively.\n getprojrec(dstArray,"
" foundList, cfg, cfgname, \"uses\", false);\n --Next, go through all of the usage projects and recursively get their links.\n --But only if they're not already there. Get the links as linkage-only.\n local linkArray = {};\n for prjName, prjEntry in pairs(dstArray) do\n getprojrec(linkArray, foundList, prjEntry.usageProj.__configs[cfgname], cfgname,\n \"links\", true);\n end\n --Copy from linkArray into dstArray.\n for prjName, prjEntry in pairs(linkArray) do\n dstArray[prjName] = prjEntry;\n end\n return dstArray;\n end\n local function isnameofproj(cfg, strName)\n local sln = cfg.project.solution;\n local strTest = strName:lower();\n for prjIx, prj in ipairs(sln.projects) do\n if (prj.name:lower() == strTest) then\n return true;\n end\n end\n return false;\n end\n --\n -- Copies the field from dstCfg to srcCfg.\n --\n local function copydependentfield(srcCfg, dstCfg, strSrcField)\n local srcField = premake.fields[strSrcField];\n local strDstField = strSrcField;\n if type(srcCfg[s"
"trSrcField]) == \"table\" then\n --handle paths.\n if (srcField.kind == \"dirlist\" or srcField.kind == \"filelist\") and\n (not keeprelative[strSrcField]) then\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField],\n path.rebase(p, srcCfg.project.location, dstCfg.project.location))\n end\n else\n if(strSrcField == \"links\") then\n for i,p in ipairs(srcCfg[strSrcField]) do\n if(not isnameofproj(dstCfg, p)) then\n table.insert(dstCfg[strDstField], p)\n else\n printf(\"Failed to copy '%s' from proj '%s'.\",\n p, srcCfg.project.name);\n end\n end\n else\n for i,p in ipairs(srcCfg[strSrcField]) do\n table.insert(dstCfg[strDstField], p)\n end\n end\n end\n else\n if(srcField.kind == \"path\" and (not keeprelative[strSrcField])) then\n dstCfg[strDstField] = path.rebase(srcCfg[strSrcField],\n prj.location, dstCfg.project.location);\n else\n dstCfg[strDstField] = srcCfg[strSrcField];\n end\n end\n end\n --\n -- This function will take the list of project entr"
"ies and apply their usage project data\n -- to the given configuration. It will copy compiling information for the projects that are\n -- not listed as linkage-only. It will copy the linking information for projects only if\n -- the source project is not a static library. It won't copy linking information\n -- if the project is in this solution; instead it will add that project to the configuration's\n -- links field, expecting that Premake will handle the rest.\n --\n local function copyusagedata(cfg, cfgname, linkToProjs)\n local myPrj = cfg.project;\n local bIsStaticLib = (getCfgKind(cfg) == \"StaticLib\");\n for prjName, prjEntry in pairs(linkToProjs) do\n local srcPrj = prjEntry.usageProj;\n local srcCfg = srcPrj.__configs[cfgname];\n for name, field in pairs(premake.fields) do\n if(srcCfg[name]) then\n if(field.usagecopy) then\n if(not prjEntry.bLinkageOnly) then\n copydependentfield(srcCfg, cfg, name)\n end\n elseif(field.linkagecopy) then\n --Copy the linkage data if we're building "
"a non-static thing\n --and this is a pure usage project. If it's not pure-usage, then\n --we will simply put the project's name in the links field later.\n if((not bIsStaticLib) and (not prjEntry.proj)) then\n copydependentfield(srcCfg, cfg, name)\n end\n end\n end\n end\n if((not bIsStaticLib) and prjEntry.proj) then\n table.insert(cfg.links, prjEntry.proj.name);\n end\n end\n end\nfunction premake.bake.buildconfigs()\nfor sln in premake.solution.each() do\nfor _, prj in ipairs(sln.projects) do\nprj.location = prj.location or sln.location or prj.basedir\nadjustpaths(prj.location, prj)\nfor _, blk in ipairs(prj.blocks) do\nadjustpaths(prj.location, blk)\nend\nend\nsln.location = sln.location or sln.basedir\nend\nfor sln in premake.solution.each() do\nlocal basis = collapse(sln)\nfor _, prj in ipairs(sln.projects) do\nprj.__configs = collapse(prj, basis)\nfor _, cfg in pairs(prj.__configs) do\nbake.postprocess(prj, cfg)\nend\nend\nend\nfor sln in premake.solution.each() do\nfor prjIx, prj in ipairs"
"(sln.projects) do\nif(not prj.usage) then\nfor cfgname, cfg in pairs(prj.__configs) do\nlocal usesPrjs = getprojectsconnections(cfg, cfgname);\ncopyusagedata(cfg, cfgname, usesPrjs)\nend\nend\nend\nend\nfor sln in premake.solution.each() do\nlocal removeList = {};\nfor index, prj in ipairs(sln.projects) do\nif(prj.usage) then\ntable.insert(removeList, 1, index); --Add in reverse order.\nend\nend\nfor _, index in ipairs(removeList) do\ntable.remove(sln.projects, index);\nend\nend\nbuilduniquedirs()\nbuildtargets(cfg)\nend\nfunction premake.bake.postprocess(prj, cfg)\ncfg.project = prj\ncfg.shortname = premake.getconfigname(cfg.name, cfg.platform, true)\ncfg.longname = premake.getconfigname(cfg.name, cfg.platform)\ncfg.location = cfg.location or cfg.basedir\nlocal platform = premake.platforms[cfg.platform]\nif platform.iscrosscompiler then\ncfg.system = cfg.platform\nelse\ncfg.system = os.get()\nend\nif cfg.kind == \"SharedLib\" and platform.nosharedlibs then\ncfg.kind = \"StaticLib\"\nend\nlocal files = { }"
"\nfor _, fname in ipairs(cfg.files) do\nlocal removed = false\nfor _, removefname in ipairs(cfg.removefiles) do\nremoved = (fname == removefname)\nif (removed) then break end\nend\nif (not removed) then\ntable.insert(files, fname)\nend\nend\ncfg.files = files\nfor name, field in pairs(premake.fields) do\nif field.isflags then\nlocal values = cfg[name]\nfor _, flag in ipairs(values) do values[flag] = true end\nend\nend\ncfg.__fileconfigs = { }\nfor _, fname in ipairs(cfg.files) do\ncfg.terms.required = fname:lower()\nlocal fcfg = {}\nfor _, blk in ipairs(cfg.project.blocks) do\nif (premake.iskeywordsmatch(blk.keywords, cfg.terms)) then\nmergeobject(fcfg, blk)\nend\nend\nfcfg.name = fname\ncfg.__fileconfigs[fname] = fcfg\ntable.insert(cfg.__fileconfigs, fcfg)\nend\nend\n",
/* base/api.lua */
"premake.fields =\n{\narchivesplit_size =\n{\nkind = \"string\",\nscope = \"config\",\n},\nbasedir =\n{\nkind = \"path\",\nscope = \"container\",\n},\nbuildaction =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"Compile\",\n\"Copy\",\n\"Embed\",\n\"None\"\n}\n},\nbuildoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_c =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_cpp =\n{\nkind = \"list\",\nscope = \"config\",\n},\nbuildoptions_objc =\n{\nkind = \"list\",\nscope = \"config\",\n},\nconfigurations =\n{\nkind = \"list\",\nscope = \"solution\",\n},\ndebugargs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndebugdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ndebugenvs =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\ndeploymentoptions =\n{\nkind = \"list\",\nscope = \"config\",\nusagecopy = true,\n},\nexcludes =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nfiles =\n{\nkind = \"filelist"
"\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nlocal lowervalue = value:lower()\nlowervalue = englishToAmericanSpell"
"ing[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes = \n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"config\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"Static"
"Lib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving "
"=\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcomma"
"nds =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"["
"ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer = premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif "
"type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, depth)\nif (type(value) == \"table\") then\nfor _, item in ipairs(val"
"ue) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fieldname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"inval"
"id value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") and value then\nif type(value) ~= \"string\" then\nerror(\"string "
"value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or \n info.kind == \"dirlist\" or \n info.kind == \"filelist\" or\n info.kind == \"absolutefilelist\" \nthen\n_G[\"remove\"..name] = function(va"
"lue)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function creategroupsfrompath(inpath, sln)\nif inpath == nil then return nil en"
"d\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.usage = isUsage\nprj.group = group\nreturn prj;\nend\n"
"function usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\n -- if this is a new project, or the project in that slot doesn't have a usage, create it\n if((not sln.projects[name]) or\n ((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\n premake.CurrentContainer = createproject(name, sln, true)\n else\n premake.CurrentContainer = iff(sln.projects[name].usage,\n sln.projects[name], sln.projects[name].usageProj)\n end\n -- add an empty, global configuration to the project\n configuration { }\n return premake.CurrentContainer\n end\n function project(name)\n if (not name) then\n --Only return non-usa"
"ge projects\n if(type(premake.CurrentContainer) ~= \"project\") then return nil end\n if(premake.CurrentContainer.usage) then return nil end\n return premake.CurrentContainer\nend\n -- identify the parent solution\n local sln\n if (type(premake.CurrentContainer) == \"project\") then\n sln = premake.CurrentContainer.solution\n else\n sln = premake.CurrentContainer\n end\n if (type(sln) ~= \"solution\") then\n error(\"no active solution\", 2)\n end\n -- if this is a new project, or the old project is a usage project, create it\n if((not sln.projects[name]) or sln.projects[name].usage) then\n premake.CurrentContainer = createproject(name, sln)\n else\n premake.CurrentContainer = sln.projects[name];\n end\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get("
"name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then \nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
"\",\nscope = \"config\",\n},\nremovefiles =\n{\nkind = \"filelist\",\nscope = \"config\",\n},\nflags =\n{\nkind = \"list\",\nscope = \"config\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_flags = {\nATL = 1,\nDebugEnvsDontMerge = 1,\nDebugEnvsInherit = 1,\nEnableMinimalRebuild = 1,\nEnableSSE = 1,\nEnableSSE2 = 1,\nExtraWarnings = 1,\nFatalWarnings = 1,\nFloatFast = 1,\nFloatStrict = 1,\nManaged = 1,\nMFC = 1,\nNativeWChar = 1,\nNo64BitChecks = 1,\nNoEditAndContinue = 1,\nNoExceptions = 1,\nNoFramePointer = 1,\nNoImportLib = 1,\nNoIncrementalLink = 1,\nNoManifest = 1,\nNoMultiProcessorCompilation = 1,\nNoNativeWChar = 1,\nNoPCH = 1,\nNoRTTI = 1,\nSingleOutputDir = 1,\nOptimize = 1,\nOptimizeSize = 1,\nOptimizeSpeed = 1,\nSEH = 1,\nStaticATL = 1,\nStaticRuntime = 1,\nSymbols = 1,\nUnicode = 1,\nUnsafe = 1,\nUnsignedChar = 1,\nWinMain = 1,\n}\nlocal englishToAmericanSpelling =\n{\noptimise = 'optimize',\noptimisesize = 'optimizesize',\noptimisespeed = 'optimizespeed',\n}\nloc"
"al lowervalue = value:lower()\nlowervalue = englishToAmericanSpelling[lowervalue] or lowervalue\nfor v, _ in pairs(allowed_flags) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid flag\"\nend,\n},\nframework =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"1.0\",\n\"1.1\",\n\"2.0\",\n\"3.0\",\n\"3.5\",\n\"4.0\",\n\"4.5\",\n}\n},\nforcedincludes =\n{\nkind = \"absolutefilelist\",\nscope = \"config\",\n},\nimagepath =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimageoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nimplibdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\nimplibextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibname =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nimplibsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\nincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nusagecopy = true,\n},\nkind =\n{\nkind = \"string\",\nscope = \"co"
"nfig\",\nallowed = {\n\"ConsoleApp\",\n\"WindowedApp\",\n\"StaticLib\",\n\"SharedLib\"\n}\n},\nlanguage =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = {\n\"C\",\n\"C++\",\n\"C#\"\n}\n},\nlibdirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\nlinkagecopy = true,\n},\nlinkoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nlinks =\n{\nkind = \"list\",\nscope = \"config\",\nallowed = function(value)\nif value:find('/', nil, true) then\nvalue = path.getabsolute(value)\nend\nreturn value\nend,\nlinkagecopy = true,\n},\nlocation =\n{\nkind = \"path\",\nscope = \"container\",\n},\nmakesettings =\n{\nkind = \"list\",\nscope = \"config\",\n},\nmessageskip =\n{\nkind = \"list\",\nscope = \"solution\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_messages = {\nSkipCreatingMessage = 1,\nSkipBuildingMessage = 1,\nSkipCleaningMessage = 1,\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_messages) do\nif v:lower() == lowervalue then\nreturn v\nend\nend"
"\nreturn nil, \"invalid message to skip\"\nend,\n},\nmsgarchiving =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgcompile_objc =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsgresource =\n{\nkind = \"string\",\nscope = \"config\",\n},\nmsglinking =\n{\nkind = \"string\",\nscope = \"config\",\n},\nobjdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\noptions =\n{\nkind = \"list\",\nscope = \"container\",\nisflags = true,\nusagecopy = true,\nallowed = function(value)\nlocal allowed_options = {\nForceCPP = 1,\nArchiveSplit = 1\n}\nlocal lowervalue = value:lower()\nfor v, _ in pairs(allowed_options) do\nif v:lower() == lowervalue then\nreturn v\nend\nend\nreturn nil, \"invalid option\"\nend,\n},\npchheader =\n{\nkind = \"string\",\nscope = \"config\",\n},\npchsource =\n{\nkind = \"path\",\nscope = \"config\",\n},\nplatforms =\n{\nkind = \"list\",\nscope = \"solution\",\nallowed = table.keys(premake.platforms),\n},\npostbuildcomman"
"ds =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprebuildcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nprelinkcommands =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresdefines =\n{\nkind = \"list\",\nscope = \"config\",\n},\nresincludedirs =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nresoptions =\n{\nkind = \"list\",\nscope = \"config\",\n},\nstartproject =\n{\nkind = \"string\",\nscope = \"solution\",\n},\ntargetdir =\n{\nkind = \"path\",\nscope = \"config\",\n},\ntargetsubdir =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetextension =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetname =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetprefix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntargetsuffix =\n{\nkind = \"string\",\nscope = \"config\",\n},\ntrimpaths =\n{\nkind = \"dirlist\",\nscope = \"config\",\n},\nuuid =\n{\nkind = \"string\",\nscope = \"container\",\nallowed = function(value)\nlocal ok = true\nif (#value ~= 36) then ok = false "
"end\nfor i=1,36 do\nlocal ch = value:sub(i,i)\nif (not ch:find(\"[ABCDEFabcdef0123456789-]\")) then ok = false end\nend\nif (value:sub(9,9) ~= \"-\") then ok = false end\nif (value:sub(14,14) ~= \"-\") then ok = false end\nif (value:sub(19,19) ~= \"-\") then ok = false end\nif (value:sub(24,24) ~= \"-\") then ok = false end\nif (not ok) then\nreturn nil, \"invalid UUID\"\nend\nreturn value:upper()\nend\n},\nuses =\n{\nkind = \"list\",\nscope = \"config\",\n},\nvpaths =\n{\nkind = \"keypath\",\nscope = \"container\",\n},\n}\npremake.check_paths = false\nfunction premake.checkvalue(value, allowed)\nif (allowed) then\nif (type(allowed) == \"function\") then\nreturn allowed(value)\nelse\nfor _,v in ipairs(allowed) do\nif (value:lower() == v:lower()) then\nreturn v\nend\nend\nreturn nil, \"invalid value '\" .. value .. \"'\"\nend\nelse\nreturn value\nend\nend\nfunction premake.getobject(t)\nlocal container\nif (t == \"container\" or t == \"solution\") then\ncontainer = premake.CurrentContainer\nelse\ncontainer ="
" premake.CurrentConfiguration\nend\nif t == \"solution\" then\nif type(container) == \"project\" then\ncontainer = container.solution\nend\nif type(container) ~= \"solution\" then\ncontainer = nil\nend\nend\nlocal msg\nif (not container) then\nif (t == \"container\") then\nmsg = \"no active solution or project\"\nelseif (t == \"solution\") then\nmsg = \"no active solution\"\nelse\nmsg = \"no active solution, project, or configuration\"\nend\nend\nreturn container, msg\nend\nfunction premake.setarray(obj, fieldname, value, allowed)\nobj[fieldname] = obj[fieldname] or {}\nlocal function add(value, depth)\nif type(value) == \"table\" then\nfor _,v in ipairs(value) do\nadd(v, depth + 1)\nend\nelse\nvalue, err = premake.checkvalue(value, allowed)\nif not value then\nerror(err, depth)\nend\ntable.insert(obj[fieldname], value)\nend\nend\nif value then\nadd(value, 5)\nend\nreturn obj[fieldname]\nend\nlocal function domatchedarray(ctype, fieldname, value, matchfunc)\nlocal result = { }\nfunction makeabsolute(value, dep"
"th)\nif (type(value) == \"table\") then\nfor _, item in ipairs(value) do\nmakeabsolute(item, depth + 1)\nend\nelseif type(value) == \"string\" then\nif value:find(\"*\") then\nlocal arr = matchfunc(value);\nif (premake.check_paths) and (#arr == 0) then\nerror(\"Can't find matching files for pattern :\" .. value)\nend\nmakeabsolute(arr, depth + 1)\nelse\ntable.insert(result, path.getabsolute(value))\nend\nelse\nerror(\"Invalid value in list: expected string, got \" .. type(value), depth)\nend\nend\nmakeabsolute(value, 3)\nreturn premake.setarray(ctype, fieldname, result)\nend\nfunction premake.setdirarray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchdirs)\nend\nfunction premake.setfilearray(ctype, fieldname, value)\nreturn domatchedarray(ctype, fieldname, value, os.matchfiles)\nend\nfunction premake.setkeyvalue(ctype, fieldname, values)\nlocal container, err = premake.getobject(ctype)\nif not container then\nerror(err, 4)\nend\nif not container[fieldname] then\ncontainer[fiel"
"dname] = {}\nend\nif type(values) ~= \"table\" then\nerror(\"invalid value; table expected\", 4)\nend\nlocal field = container[fieldname]\nfor key,value in pairs(values) do\nif not field[key] then\nfield[key] = {}\nend\ntable.insertflat(field[key], value)\nend\nreturn field\nend\nfunction premake.setstring(ctype, fieldname, value, allowed)\nlocal container, err = premake.getobject(ctype)\nif (not container) then\nerror(err, 4)\nend\nif (value) then\nvalue, err = premake.checkvalue(value, allowed)\nif (not value) then\nerror(err, 4)\nend\ncontainer[fieldname] = value\nend\nreturn container[fieldname]\nend\nfunction premake.remove(fieldname, value)\nlocal cfg = premake.CurrentConfiguration\ncfg.removes = cfg.removes or {}\ncfg.removes[fieldname] = premake.setarray(cfg.removes, fieldname, value)\nend\nlocal function accessor(name, value)\nlocal kind = premake.fields[name].kind\nlocal scope = premake.fields[name].scope\nlocal allowed = premake.fields[name].allowed\nif (kind == \"string\" or kind == \"path\") "
"and value then\nif type(value) ~= \"string\" then\nerror(\"string value expected\", 3)\nend\nend\nlocal container, err = premake.getobject(scope)\nif (not container) then\nerror(err, 3)\nend\nif kind == \"string\" then\nreturn premake.setstring(scope, name, value, allowed)\nelseif kind == \"path\" then\nif value then value = path.getabsolute(value) end\nreturn premake.setstring(scope, name, value)\nelseif kind == \"list\" then\nreturn premake.setarray(container, name, value, allowed)\nelseif kind == \"dirlist\" then\nreturn premake.setdirarray(container, name, value)\nelseif kind == \"filelist\" or kind == \"absolutefilelist\" then\nreturn premake.setfilearray(container, name, value)\nelseif kind == \"keyvalue\" or kind == \"keypath\" then\nreturn premake.setkeyvalue(scope, name, value)\nend\nend\nfor name, info in pairs(premake.fields) do\n_G[name] = function(value)\nreturn accessor(name, value)\nend\nif info.kind == \"list\" or\n info.kind == \"dirlist\" or\n info.kind == \"filelist\" or\n info.kind =="
" \"absolutefilelist\"\nthen\n_G[\"remove\"..name] = function(value)\npremake.remove(name, value)\nend\nend\nend\nfunction configuration(terms)\nif not terms then\nreturn premake.CurrentConfiguration\nend\nlocal container, err = premake.getobject(\"container\")\nif (not container) then\nerror(err, 2)\nend\nlocal cfg = { }\ncfg.terms = table.flatten({terms})\ntable.insert(container.blocks, cfg)\npremake.CurrentConfiguration = cfg\ncfg.keywords = { }\nfor _, word in ipairs(cfg.terms) do\ntable.insert(cfg.keywords, path.wildcards(word):lower())\nend\nfor name, field in pairs(premake.fields) do\nif (field.kind ~= \"string\" and field.kind ~= \"path\") then\ncfg[name] = { }\nend\nend\nreturn cfg\nend\nlocal function creategroup(name, sln, parent, inpath)\nlocal group = {}\nsetmetatable(group, {\n__type = \"group\"\n})\ntable.insert(sln.groups, group)\nsln.groups[inpath] = group\ngroup.solution = sln\ngroup.name = name\ngroup.uuid = os.uuid(group.name)\ngroup.parent = parent\nreturn group\nend\nlocal function createg"
"roupsfrompath(inpath, sln)\nif inpath == nil then return nil end\ninpath = path.translate(inpath, \"/\")\nlocal groups = string.explode(inpath, \"/\")\nlocal curpath = \"\"\nlocal lastgroup = nil\nfor i, v in ipairs(groups) do\ncurpath = curpath .. \"/\" .. v:lower()\nlocal group = sln.groups[curpath]\nif group == nil then\ngroup = creategroup(v, sln, lastgroup, curpath)\nend\nlastgroup = group\nend\nreturn lastgroup\nend\nlocal function createproject(name, sln, isUsage)\nlocal prj = {}\nsetmetatable(prj, {\n__type = \"project\",\n})\ntable.insert(sln.projects, prj)\nif(isUsage) then\nif(sln.projects[name]) then\nsln.projects[name].usageProj = prj;\nelse\nsln.projects[name] = prj\nend\nelse\nif(sln.projects[name]) then\nprj.usageProj = sln.projects[name];\nend\nsln.projects[name] = prj\nend\nlocal group = creategroupsfrompath(premake.CurrentGroup, sln)\nprj.solution = sln\nprj.name = name\nprj.basedir = os.getcwd()\nprj.uuid = os.uuid(prj.name)\nprj.blocks = { }\nprj.us"
"age = isUsage\nprj.group = group\nreturn prj;\nend\nfunction usage(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(not premake.CurrentContainer.usage) then return nil end\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or\n((not sln.projects[name].usage) and (not sln.projects[name].usageProj))) then\npremake.CurrentContainer = createproject(name, sln, true)\nelse\npremake.CurrentContainer = iff(sln.projects[name].usage,\nsln.projects[name], sln.projects[name].usageProj)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction project(name)\nif (not name) then\nif(type(premake.CurrentContainer) ~= \"project\") then return nil end\nif(premake.CurrentContainer.usage) then return nil end"
"\nreturn premake.CurrentContainer\nend\nlocal sln\nif (type(premake.CurrentContainer) == \"project\") then\nsln = premake.CurrentContainer.solution\nelse\nsln = premake.CurrentContainer\nend\nif (type(sln) ~= \"solution\") then\nerror(\"no active solution\", 2)\nend\nif((not sln.projects[name]) or sln.projects[name].usage) then\npremake.CurrentContainer = createproject(name, sln)\nelse\npremake.CurrentContainer = sln.projects[name];\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction solution(name)\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then\nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.Curren"
"tGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
/* base/cmdline.lua */
"newoption \n{\ntrigger = \"cc\",\nvalue = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\", \"OpenWatcom\" },\n}\n}\nnewoption\n{\ntrigger = \"dotnet\",\nvalue = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\", \"Microsoft .NET (csc)\" },\n{ \"mono\", \"Novell Mono (mcs)\" },\n{ \"pnet\", \"Portable.NET (cscc)\" },\n}\n}\nnewoption\n{\ntrigger = \"file\",\nvalue = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger = \"os\",\nvalue = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\", \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\", \"Linux\" },\n{ \"macosx\", \"Apple Mac OS X\" },\n{ \"windows\", \"Microsoft Windows\" },\n}\n}\nnewoption\n{"
@ -179,17 +179,17 @@ const char* builtin_scripts[] = {
"ative(sln.location, prj.location)), _MAKE.esc(_MAKE.getmakefilename(prj, true)))\n_p('')\nend\n_p('clean:')\nfor _ ,prj in ipairs(sln.projects) do\n_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)))\nend\n_p('')\n_p('help:')\n_p(1,'@echo \"Usage: make [config=name] [target]\"')\n_p(1,'@echo \"\"')\n_p(1,'@echo \"CONFIGURATIONS:\"')\nlocal cfgpairs = { }\nfor _, platform in ipairs(platforms) do\nfor _, cfgname in ipairs(sln.configurations) do\n_p(1,'@echo \" %s\"', premake.getconfigname(cfgname, platform, true))\nend\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"TARGETS:\"')\n_p(1,'@echo \" all (default)\"')\n_p(1,'@echo \" clean\"')\nfor _, prj in ipairs(sln.projects) do\n_p(1,'@echo \" %s\"', prj.name)\nend\n_p(1,'@echo \"\"')\n_p(1,'@echo \"For more information, see http://industriousone.com/premake/quick-start\"')\nend\n",
/* actions/make/make_cpp.lua */
"premake.make.cpp = { }\npremake.make.undefine = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nlocal objdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('al"
"l: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then \nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\nend\nelse\nif prj.msglinking the"
"n\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(OBJDIR)')\nend\n_p('\\t-$(call MKDIR,$(OBJDIR))')\nfor dir, _ in pairs(objdirs) do\n_p('\\t-$(call MKDIR,$(OBJDIR)/%s)', dir)\nend\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,"
"\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\nfor _, variable in ipairs(premake.make.undefine) do\n_p('override undefine '.. variable)\nend\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHEL"
"LTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COPY = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p(' TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list("
"cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", "
"\"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.b"
"uildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX"
"\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppf"
"ile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$"
"@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
"premake.make.cpp = { }\npremake.make.override = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nlocal objdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('al"
"l: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchiving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then \nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\n_"
"p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(OBJDIR)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n"
"_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p(' -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p(' config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p(' SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p(' SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p(' MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p(' COP"
"Y = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p(' RM= $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p(' MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p(' COPY = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p(' RM = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p(' ifdef WINDRES')\n_p(' RESCOMP = $(WINDRES)')\n_p(' else')\n_p(' RESCOMP = windres')\n_p(' endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") .. 'OBJDIR = %s', _MAKE.esc(cfg.objectsdir))\n_p(' ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR = %s', _MAKE.esc(cfg.buildtarget.directory)"
")\n_p(' ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") .. 'TARGET = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p(' DEFINES +=%s', make.list(cc.getdefines(cfg.defines)))\n_p(' INCLUDES +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\n_p(' OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nlocal excluded = false\nfor _, exclude in ipairs(cfg.excludes) do\nexcluded = (exclude == file)\nif (excluded) then break end\nend\nif excluded == false then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p(' define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_"
"p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p(' define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p(' CC = %s', platform.cc)\nend\nif platform.cxx then\n_p(' CXX = %s', platform.cxx)\nend\nif platform.ar then\n_p(' AR = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p(' FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p(' FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p(' ALL_CFLAGS "
" += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p(' ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n make.list(table.join(cc.getdefines(cfg.resdefines),\n cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\n_p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p(' LDDEPS +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p(' LIBS += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif c"
"fg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p(' LINKCMD = libtool -o $(TARGET)')\nelse\nif (not prj.options.ArchiveSplit) then\nif cc.llvm then\n_p(' LINKCMD = $(AR) rcs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -rcs $(TARGET)')\nend\nelse\nif cc.llvm then\n_p(' LINKCMD = $(AR) qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) cs $(TARGET)')\nelse\n_p(' LINKCMD = $(AR) -qc $(TARGET)')\n_p(' LINKCMD_NDX= $(AR) -cs $(TARGET)')\nend\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p(' LINKCMD = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbrea"
"k\nend\nend\n_p(' PCH = %s', _MAKE.esc(pch))\n_p(' GCH = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.i"
"scfile(file) and not prj.options.ForceCPP, \"o\")\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
/* actions/make/make_csharp.lua */
"local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n local name = cfg.buildtarget.basename .. \".\"\n local dir = path.getdirectory(fname)\n if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
@ -202,12 +202,12 @@ const char* builtin_scripts[] = {
"ild commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' endef')\n_p('endif')\n_p('')\nend\n",
/* actions/vstudio/_vstudio.lua */
"premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v90\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\"\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\"\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\nl"
"ocal platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%%"
".ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\nf"
"unction vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcproj\", vstudio.vc200x.generate)\npremake.generate(prj, \"%%.vcproj.user\", vstudio.vc200x.generate_user)\nend\nend,"
"\noncleansolution = vstudio.cleansolution,\noncleanproject = vstudio.cleanproject,\noncleantarget = vstudio.cleantarget,\nvstudio = {\nproductVersion = \"9.0.21022\",\nsolutionVersion = \"10\",\ntoolsVersion = \"3.5\",\n}\n}\nnewaction\n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\"},\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, \""
"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", vstudio.vc2010.generate_filters)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nproductVersion = \"8.0.30703\",\nsolutionVersion = \"11\",\ntargetFramework = \"4.0\",\ntoolsVersion = \"4.0\",\n}\n}\n",
"premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\"\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany = \"Any CPU\",\nmixed = \"Mixed Platforms\",\nNative = \"Win32\",\nx86 = \"x86\",\nx32 = \"Win32\",\nx64 = \"x64\",\nPS3 = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM = \"ARM\"\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mixed\")\nend\nif hasdotnet and (_ACTION < \"vs2010\" or not hascpp) then\ntable.insert(platforms, 1, \"any\")\nend\nif _ACTION > \"vs2008\" then\n"
"local platforms2010 = { }\nfor _, platform in ipairs(platforms) do\nif vstudio.platforms[platform] == \"Win32\" then\nif hascpp then\ntable.insert(platforms2010, platform)\nend\nif hasdotnet then\ntable.insert(platforms2010, \"x86\")\nend\nelse\ntable.insert(platforms2010, platform)\nend\nend\nplatforms = platforms2010\nend\nfor _, buildcfg in ipairs(sln.configurations) do\nfor _, platform in ipairs(platforms) do\nlocal entry = { }\nentry.src_buildcfg = buildcfg\nentry.src_platform = platform\nif platform ~= \"PS3\" or _ACTION > \"vs2008\" then\nentry.buildcfg = buildcfg\nentry.platform = vstudio.platforms[platform]\nelse\nentry.buildcfg = platform .. \" \" .. buildcfg\nentry.platform = \"Win32\"\nend\nentry.name = entry.buildcfg .. \"|\" .. entry.platform\nentry.isreal = (platform ~= \"any\" and platform ~= \"mixed\")\ntable.insert(cfgs, entry)\nend\nend\nreturn cfgs\nend\nfunction vstudio.cleansolution(sln)\npremake.clean.file(sln, \"%%.sln\")\npremake.clean.file(sln, \"%%.suo\")\npremake.clean.file(sln, \"%"
"%.ncb\")\npremake.clean.file(sln, \"%%.userprefs\")\npremake.clean.file(sln, \"%%.usertasks\")\nend\nfunction vstudio.cleanproject(prj)\nlocal fname = premake.project.getfilename(prj, \"%%\")\nos.remove(fname .. \".vcproj\")\nos.remove(fname .. \".vcproj.user\")\nos.remove(fname .. \".vcxproj\")\nos.remove(fname .. \".vcxproj.user\")\nos.remove(fname .. \".vcxproj.filters\")\nos.remove(fname .. \".csproj\")\nos.remove(fname .. \".csproj.user\")\nos.remove(fname .. \".pidb\")\nos.remove(fname .. \".sdf\")\nend\nfunction vstudio.cleantarget(name)\nos.remove(name .. \".pdb\")\nos.remove(name .. \".idb\")\nos.remove(name .. \".ilk\")\nos.remove(name .. \".vshost.exe\")\nos.remove(name .. \".exe.manifest\")\nend\nfunction vstudio.projectfile(prj)\nlocal pattern\nif prj.language == \"C#\" then\npattern = \"%%.csproj\"\nelse\npattern = iif(_ACTION > \"vs2008\", \"%%.vcxproj\", \"%%.vcproj\")\nend\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn fname\nend\n"
"function vstudio.tool(prj)\nif (prj.language == \"C#\") then\nreturn \"FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\"\nelse\nreturn \"8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942\"\nend\nend\nnewaction {\ntrigger = \"vs2008\",\nshortname = \"Visual Studio 2008\",\ndescription = \"Generate Microsoft Visual Studio 2008 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\" },\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcproj\", vstudio.vc200x.generate)\npremake.generate(prj, \"%%.vcproj.user\", vstudio.vc200x.generate_user)\nend\nend"
",\noncleansolution = vstudio.cleansolution,\noncleanproject = vstudio.cleanproject,\noncleantarget = vstudio.cleantarget,\nvstudio = {\nproductVersion = \"9.0.21022\",\nsolutionVersion = \"10\",\ntoolsVersion = \"3.5\",\n}\n}\nnewaction\n{\ntrigger = \"vs2010\",\nshortname = \"Visual Studio 2010\",\ndescription = \"Generate Microsoft Visual Studio 2010 project files\",\nos = \"windows\",\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\nvalid_languages = { \"C\", \"C++\", \"C#\"},\nvalid_tools = {\ncc = { \"msc\" },\ndotnet = { \"msnet\" },\n},\nonsolution = function(sln)\npremake.generate(sln, \"%%.sln\", vstudio.sln2005.generate)\nend,\nonproject = function(prj)\nif premake.isdotnetproject(prj) then\npremake.generate(prj, \"%%.csproj\", vstudio.cs2005.generate)\npremake.generate(prj, \"%%.csproj.user\", vstudio.cs2005.generate_user)\nelse\npremake.generate(prj, \"%%.vcxproj\", premake.vs2010_vcxproj)\npremake.generate(prj, "
"\"%%.vcxproj.user\", premake.vs2010_vcxproj_user)\npremake.generate(prj, \"%%.vcxproj.filters\", vstudio.vc2010.generate_filters)\nend\nend,\noncleansolution = premake.vstudio.cleansolution,\noncleanproject = premake.vstudio.cleanproject,\noncleantarget = premake.vstudio.cleantarget,\nvstudio = {\nproductVersion = \"8.0.30703\",\nsolutionVersion = \"11\",\ntargetFramework = \"4.0\",\ntoolsVersion = \"4.0\",\n}\n}\n",
/* actions/vstudio/vs200x_vcproj.lua */
"premake.vstudio.vc200x = { }\nlocal vc200x = premake.vstudio.vc200x\nlocal tree = premake.tree\nlocal function bool(value)\nreturn iif(value, \"true\", \"false\")\nend\nfunction vc200x.optimization(cfg)\nlocal result = 0\nfor _, value in ipairs(cfg.flags) do\nif (value == \"Optimize\") then\nresult = 3\nelseif (value == \"OptimizeSize\") then\nresult = 1\nelseif (value == \"OptimizeSpeed\") then\nresult = 2\nend\nend\nreturn result\nend\nfunction vc200x.header(element)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"Windows-1252\"?>')\n_p('<%s', element)\n_p(1,'ProjectType=\"Visual C++\"')\n_p(1,'Version=\"9.00\"')\nend\nfunction vc200x.Configuration(name, cfg)\n_p(2,'<Configuration')\n_p(3,'Name=\"%s\"', premake.esc(name))\n_p(3,'OutputDirectory=\"%s\"', premake.esc(cfg.buildtarget.directory))\n_p(3,'IntermediateDirectory=\"%s\"', premake.esc(cfg.objectsdir))\nlocal cfgtype\nif (cfg.kind == \"SharedLib\") then\ncfgtype = 2\nelseif (cfg.kind == \"StaticLib\") then\ncfgtype = 4\nelse\ncfgtype = 1\nen"
@ -263,15 +263,16 @@ const char* builtin_scripts[] = {
"seFileName>'\n, path.getbasename(cfg.buildtarget.name))\nend\nif cfg.flags.NoFramePointer then\n_p(3,'<OmitFramePointers>true</OmitFramePointers>')\nend\ncompile_language(cfg)\nforcedinclude_files(3,cfg);\n_p(2,'</ClCompile>')\nend\nlocal function event_hooks(cfg)\nif #cfg.postbuildcommands> 0 then\n _p(2,'<PostBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PostBuildEvent>')\nend\nif #cfg.prebuildcommands> 0 then\n _p(2,'<PreBuildEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreBuildEvent>')\nend\nif #cfg.prelinkcommands> 0 then\n _p(2,'<PreLinkEvent>')\n_p(3,'<Command>%s</Command>',premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")))\n_p(2,'</PreLinkEvent>')\nend\nend\nlocal function additional_options(indent,cfg)\nif #cfg.linkoptions > 0 then\n_p(indent,'<AdditionalOptions>%s %%(AdditionalOptions)</AdditionalOptions>',\ntable"
".concat(premake.esc(cfg.linkoptions), \" \"))\nend\nend\nlocal function link_target_machine(index,cfg)\nlocal platforms = {x32 = 'MachineX86', x64 = 'MachineX64'}\nif platforms[cfg.platform] then\n_p(index,'<TargetMachine>%s</TargetMachine>', platforms[cfg.platform])\nend\nend\nlocal function item_def_lib(cfg)\n -- The Xbox360 project files are stored in another place in the project file.\nif cfg.kind == 'StaticLib' and cfg.platform ~= \"Xbox360\" then\n_p(1,'<Lib>')\n_p(2,'<OutputFile>$(OutDir)%s</OutputFile>',cfg.buildtarget.name)\nadditional_options(2,cfg)\nlink_target_machine(2,cfg)\n_p(1,'</Lib>')\nend\nend\nlocal function import_lib(cfg)\nif cfg.kind == \"SharedLib\" then\nlocal implibname = cfg.linktarget.fullpath\n_p(3,'<ImportLibrary>%s</ImportLibrary>',iif(cfg.flags.NoImportLib, cfg.objectsdir .. \"\\\\\" .. path.getname(implibname), implibname))\nend\nend\nfunction vc2010.link(cfg)\n_p(2,'<Link>')\n_p(3,'<SubSystem>%s</SubSystem>', iif(cfg.kind == \"ConsoleApp\", \"Console\", \"Windows\"))\n_p"
"(3,'<GenerateDebugInformation>%s</GenerateDebugInformation>', tostring(cfg.flags.Symbols ~= nil))\nif premake.config.isoptimizedbuild(cfg.flags) then\n_p(3,'<EnableCOMDATFolding>true</EnableCOMDATFolding>')\n_p(3,'<OptimizeReferences>true</OptimizeReferences>')\nend\nif cfg.kind ~= 'StaticLib' then\nvc2010.additionalDependencies(cfg)\n_p(3,'<OutputFile>$(OutDir)%s</OutputFile>', cfg.buildtarget.name)\nif #cfg.libdirs > 0 then\n_p(3,'<AdditionalLibraryDirectories>%s;%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>',\npremake.esc(path.translate(table.concat(cfg.libdirs, ';'), '\\\\')))\nend\nif vc2010.config_type(cfg) == 'Application' and not cfg.flags.WinMain and not cfg.flags.Managed then\nif cfg.flags.Unicode then\n_p(3,'<EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>')\nelse\n_p(3,'<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>')\nend\nend\nimport_lib(cfg)\nlocal deffile = premake.findfile(cfg, \".def\")\nif deffile then\n_p(3,'<ModuleDefinitionFile>%s</ModuleDefinitionFile>', deffil"
"e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'</Link>')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable.concat(links, \";\"))\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},\nClInclude = {},\nNone = {},\nResourceCompile = {},\n AppxManifest = {}\n}\nlocal foundAppxManifest = false\nfo"
"r file in premake.project.eachfile(prj) do\nif path.iscppfile(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\ntable.insert(sortedfiles.ClInclude, file)\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelse\n local ext = path.getextension(file.name):lower()\n if ext == \".appxmanifest\" then\nfoundAppxManifest = true\n table.insert(sortedfiles.AppxManifest, file)\n else\n table.insert(sortedfiles.None, file)\n end\nend\nend\nif vstudio.toolset == \"v120_wp81\" and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \".appxmanifest\"\nfcfg.vpath = premake.project.getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(pr"
"j)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\n vc2010.simplefilesgroup(prj, \"AppxManifest\")\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n if subtype then\n _p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n _p(3,'<SubType>%s</SubType>', subtype)\n _p(2,'</%s>', section)\n else\n _p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\n end\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup(prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in i"
"pairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\n_p(3, '<ObjectFileName>$(IntDir)%s.obj</ObjectFileName>'\n, premake.esc(path.translate(path.trimdots(path.removeext(file.name))))\n)\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend\nend\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nfor _, exclude in ipairs(cfg.excludes) do\nif ex"
"clude == file.name then\n_p(3, '<ExcludedFromBuild ' .. if_config_and_platform() .. '>true</ExcludedFromBuild>', premake.esc(vsconfig.name))\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettin"
"gs\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.getdependencies(prj)\nif #deps > 0 then\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDir"
"ectory>', path.translate(cfg.debugdir, '\\\\'))\n_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')\nend\nif cfg.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(cfg.debugenvs, \"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' </PropertyGroup>')\n"
"end\n_p('</Project>')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">')\n_p(1,'<Identity Name=\"' .. prj.uuid .. '\"')\n_p(2,'Publisher=\"CN=Unknown\"')\n_p(2,'Version=\"1.0.0.0\" />')\n_p(1,'<mp:PhoneIdentity PhoneProductId=\"' .. prj.uuid .. '\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\n_p(1,'<Properties>')\n_p(2,'<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2,'<PublisherDisplayName>Unknown</PublisherDisplayName>')\n_p(2,'<Logo>EmptyLogo.png</Logo>')\n_p(1,'</Properties>')\n_p(1,'<Prerequisites>')\n_p(2,'<OSMinVersion>6.3.1</OSMinVersion>')\n_p(2,'<OSMaxVersionTested>6.3.1</OSMaxVersionTested>')\n_p(1,'</Prerequisites>')\n_p(1,'<Resou"
"rces>')\n_p(2,'<Resource Language=\"x-generate\"/>')\n_p(1,'</Resources>')\n_p(1,'<Applications>')\n_p(2,'<Application Id=\"App\"')\n_p(3,'Executable=\"$targetnametoken$.exe\"')\n_p(3,'EntryPoint=\"App\">')\n_p(3,'<m3:VisualElements')\n_p(4,'DisplayName=\"Blah\"')\n_p(4,'Square150x150Logo=\"Assets\\\\Logo.png\"')\n_p(4,'Square44x44Logo=\"Assets\\\\SmallLogo.png\"')\n_p(4,'Description=\"Blah\"')\n_p(4,'ForegroundText=\"light\"')\n_p(4,'BackgroundColor=\"transparent\">')\n_p(3,'</m3:VisualElements>')\n_p(2,'</Application>')\n_p(1,'</Applications>')\n_p('</Package>')\nend",
"e)\nend\nlink_target_machine(3,cfg)\nadditional_options(3,cfg)\nend\n_p(2,'</Link>')\nend\nfunction vc2010.additionalDependencies(cfg)\nlocal links = premake.getlinks(cfg, \"system\", \"fullpath\")\nif #links > 0 then\n_p(3,'<AdditionalDependencies>%s;%%(AdditionalDependencies)</AdditionalDependencies>',\ntable.concat(links, \";\"))\nend\nend\nlocal function item_definitions(prj)\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(1,'<ItemDefinitionGroup ' ..if_config_and_platform() ..'>'\n,premake.esc(cfginfo.name))\nvs10_clcompile(cfg)\nresource_compile(cfg)\nitem_def_lib(cfg)\nvc2010.link(cfg)\nevent_hooks(cfg)\n_p(1,'</ItemDefinitionGroup>')\nend\nend\nfunction exists(table, fine)\nfor _, value in ipairs(table) do\nif value == find then return true end\nend\nreturn false\nend\nfunction vc2010.getfilegroup(prj, group)\nlocal sortedfiles = prj.vc2010sortedfiles\nif not sortedfiles then\nsortedfiles = {\nClCompile = {},"
"\nClInclude = {},\nNone = {},\nResourceCompile = {},\n AppxManifest = {}\n}\nlocal foundAppxManifest = false\nfor file in premake.project.eachfile(prj) do\nif path.iscppfile(file.name) then\ntable.insert(sortedfiles.ClCompile, file)\nelseif path.iscppheader(file.name) then\nif not exists(prj.removefiles, file) then\ntable.insert(sortedfiles.ClInclude, file)\nend\nelseif path.isresourcefile(file.name) then\ntable.insert(sortedfiles.ResourceCompile, file)\nelse\n local ext = path.getextension(file.name):lower()\n if ext == \".appxmanifest\" then\nfoundAppxManifest = true\n table.insert(sortedfiles.AppxManifest, file)\n else\n table.insert(sortedfiles.None, file)\n end\nend\nend\nif vstudio.toolset == \"v120_wp81\" and prj.kind == \"WindowedApp\" and not foundAppxManifest then\nvstudio.needAppxManifest = true\nlocal fcfg = {}\nfcfg.name = prj.name .. \".appxmanifest\"\nfcfg.vpath = premake.project."
"getvpath(prj, fcfg.name)\ntable.insert(sortedfiles.AppxManifest, fcfg)\nend\nprj.vc2010sortedfiles = sortedfiles\nend\nreturn sortedfiles[group]\nend\nfunction vc2010.files(prj)\nvc2010.simplefilesgroup(prj, \"ClInclude\")\nvc2010.compilerfilesgroup(prj)\nvc2010.simplefilesgroup(prj, \"None\")\nvc2010.simplefilesgroup(prj, \"ResourceCompile\")\n vc2010.simplefilesgroup(prj, \"AppxManifest\")\nend\nfunction vc2010.simplefilesgroup(prj, section, subtype)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\n if subtype then\n _p(2,'<%s Include=\\\"%s\\\">', section, path.translate(file.name, \"\\\\\"))\n _p(3,'<SubType>%s</SubType>', subtype)\n _p(2,'</%s>', section)\n else\n _p(2,'<%s Include=\\\"%s\\\" />', section, path.translate(file.name, \"\\\\\"))\n end\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.compilerfilesgroup("
"prj)\nlocal configs = prj.solution.vstudio_configs\nlocal files = vc2010.getfilegroup(prj, \"ClCompile\")\nif #files > 0 then\nlocal config_mappings = {}\nfor _, cfginfo in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nif cfg.pchheader and cfg.pchsource and not cfg.flags.NoPCH then\nconfig_mappings[cfginfo] = path.translate(cfg.pchsource, \"\\\\\")\nend\nend\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal translatedpath = path.translate(file.name, \"\\\\\")\n_p(2, '<ClCompile Include=\\\"%s\\\">', translatedpath)\n_p(3, '<ObjectFileName>$(IntDir)%s.obj</ObjectFileName>'\n, premake.esc(path.translate(path.trimdots(path.removeext(file.name))))\n)\nfor _, cfginfo in ipairs(configs) do\nif config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then\n_p(3,'<PrecompiledHeader '.. if_config_and_platform() .. '>Create</PrecompiledHeader>', premake.esc(cfginfo.name))\nconfig_mappings[cfginfo] = nil --only one source file per pch\nend"
"\nend\nlocal excluded = false\nfor _, exclude in ipairs(prj.excludes) do\nif exclude == file.name then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nexcluded = true\nbreak\nend\nend\nif not excluded then\nfor _, vsconfig in ipairs(configs) do\nlocal cfg = premake.getconfig(prj, vsconfig.src_buildcfg, vsconfig.src_platform)\nfor _, exclude in ipairs(cfg.excludes) do\nif exclude == file.name then\n_p(3, '<ExcludedFromBuild '\n.. if_config_and_platform()\n.. '>true</ExcludedFromBuild>'\n, premake.esc(vsconfig.name)\n)\nend\nend\nend\nend\n_p(2,'</ClCompile>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.header(targets)\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\nlocal t = \"\"\nif targets then\nt = ' DefaultTargets=\"' .. targets .. '\"'\nend\n_p('<Project%s ToolsVersion=\"4.0"
"\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">', t)\nend\nfunction premake.vs2010_vcxproj(prj)\nio.indent = \" \"\nvc2010.header(\"Build\")\nvs2010_config(prj)\nvs2010_globals(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.Default.props\" />')\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\nvc2010.configurationPropertyGroup(cfg, cfginfo)\nend\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.props\" />')\n_p(1,'<ImportGroup Label=\"ExtensionSettings\">')\n_p(1,'</ImportGroup>')\nimport_props(prj)\n_p(1,'<PropertyGroup Label=\"UserMacros\" />')\nvc2010.outputProperties(prj)\nitem_definitions(prj)\nvc2010.files(prj)\nvc2010.projectReferences(prj)\n_p(1,'<Import Project=\"$(VCTargetsPath)\\\\Microsoft.Cpp.targets\" />')\n_p(1,'<ImportGroup Label=\"ExtensionTargets\">')\n_p(1,'</ImportGroup>')\n_p('</Project>')\nend\nfunction vc2010.projectReferences(prj)\nlocal deps = premake.g"
"etdependencies(prj)\nif #deps > 0 then\n_p(1,'<ItemGroup>')\nfor _, dep in ipairs(deps) do\nlocal deppath = path.getrelative(prj.location, vstudio.projectfile(dep))\n_p(2,'<ProjectReference Include=\\\"%s\\\">', path.translate(deppath, \"\\\\\"))\n_p(3,'<Project>{%s}</Project>', dep.uuid)\nif vstudio.toolset == \"v120_wp81\" then\n_p(3,'<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')\nend\n_p(2,'</ProjectReference>')\nend\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.debugdir(cfg)\nif cfg.debugdir then\n_p(' <LocalDebuggerWorkingDirectory>%s</LocalDebuggerWorkingDirectory>', path.translate(cfg.debugdir, '\\\\'))\n_p(' <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')\nend\nif cfg.debugargs then\n_p(' <LocalDebuggerCommandArguments>%s</LocalDebuggerCommandArguments>', table.concat(cfg.debugargs, \" \"))\nend\nend\nfunction vc2010.debugenvs(cfg)\nif cfg.debugenvs and #cfg.debugenvs > 0 then\n_p(2,'<LocalDebuggerEnvironment>%s%s</LocalDebuggerEnvironment>',table.concat(cfg.debugenvs, "
"\"\\n\")\n,iif(cfg.flags.DebugEnvsInherit,'\\n$(LocalDebuggerEnvironment)','')\n)\nif cfg.flags.DebugEnvsDontMerge then\n_p(2,'<LocalDebuggerMergeEnvironment>false</LocalDebuggerMergeEnvironment>')\nend\nend\nend\nfunction premake.vs2010_vcxproj_user(prj)\nio.indent = \" \"\nvc2010.header()\nfor _, cfginfo in ipairs(prj.solution.vstudio_configs) do\nlocal cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)\n_p(' <PropertyGroup '.. if_config_and_platform() ..'>', premake.esc(cfginfo.name))\nvc2010.debugdir(cfg)\nvc2010.debugenvs(cfg)\n_p(' </PropertyGroup>')\nend\n_p('</Project>')\nend\nfunction premake.vs2010_appxmanifest(prj)\nio.indent = \" \"\nio.eol = \"\\r\\n\"\n_p('<?xml version=\"1.0\" encoding=\"utf-8\"?>')\n_p('<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">')\n_p(1,'<Ide"
"ntity Name=\"' .. prj.uuid .. '\"')\n_p(2,'Publisher=\"CN=Unknown\"')\n_p(2,'Version=\"1.0.0.0\" />')\n_p(1,'<mp:PhoneIdentity PhoneProductId=\"' .. prj.uuid .. '\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>')\n_p(1,'<Properties>')\n_p(2,'<DisplayName>' .. prj.name .. '</DisplayName>')\n_p(2,'<PublisherDisplayName>Unknown</PublisherDisplayName>')\n_p(2,'<Logo>EmptyLogo.png</Logo>')\n_p(1,'</Properties>')\n_p(1,'<Prerequisites>')\n_p(2,'<OSMinVersion>6.3.1</OSMinVersion>')\n_p(2,'<OSMaxVersionTested>6.3.1</OSMaxVersionTested>')\n_p(1,'</Prerequisites>')\n_p(1,'<Resources>')\n_p(2,'<Resource Language=\"x-generate\"/>')\n_p(1,'</Resources>')\n_p(1,'<Applications>')\n_p(2,'<Application Id=\"App\"')\n_p(3,'Executable=\"$targetnametoken$.exe\"')\n_p(3,'EntryPoint=\"App\">')\n_p(3,'<m3:VisualElements')\n_p(4,'DisplayName=\"Blah\"')\n_p(4,'Square150x150Logo=\"Assets\\\\Logo.png\"')\n_p(4,'Square44x44Logo=\"Assets\\\\SmallLogo.png\"')\n_p(4,'Description=\"Blah\"')\n_p(4,'ForegroundText=\"light\"')\n_p("
"4,'BackgroundColor=\"transparent\">')\n_p(3,'</m3:VisualElements>')\n_p(2,'</Application>')\n_p(1,'</Applications>')\n_p('</Package>')\nend\n",
/* actions/vstudio/vs2010_vcxproj_filters.lua */
"local vc2010 = premake.vstudio.vc2010\nlocal project = premake.project\nfunction vc2010.filteridgroup(prj)\nlocal filters = { }\nlocal filterfound = false\nfor file in project.eachfile(prj) do\nlocal folders = string.explode(file.vpath, \"/\", true)\nlocal path = \"\"\nfor i = 1, #folders - 1 do\nif not filterfound then\nfilterfound = true\n_p(1,'<ItemGroup>')\nend\npath = path .. folders[i]\nif not filters[path] then\nfilters[path] = true\n_p(2, '<Filter Include=\"%s\">', path)\n_p(3, '<UniqueIdentifier>{%s}</UniqueIdentifier>', os.uuid())\n_p(2, '</Filter>')\nend\npath = path .. \"\\\\\"\nend\nend\nif filterfound then\n_p(1,'</ItemGroup>')\nend\nend\nfunction vc2010.filefiltergroup(prj, section)\nlocal files = vc2010.getfilegroup(prj, section)\nif #files > 0 then\n_p(1,'<ItemGroup>')\nfor _, file in ipairs(files) do\nlocal filter\nif file.name ~= file.vpath then\nfilter = path.getdirectory(file.vpath)\nelse\nfilter = path.getdirectory(file.name)\nend\nif filter ~= \".\" then\n_p(2,'<%s Include=\\\"%s\\\">', "

View File

@ -729,6 +729,9 @@
#ifdef __ANDROID__
#define l_getlocaledecpoint() '.'
#endif
#endif

View File

@ -1,5 +1,30 @@
# Mongoose Release Notes
## Release 5.6, 2015-03-17
Changes in Libmongoose library:
- Added `-dav_root` configuration option that gives an ability to mount
a different root directory (not document_root)
- Fixes for build under Win23 and MinGW
- Bugfix: Double dots removal
- Bugfix: final chunked response double-send
- Fixed compilation in 64-bit environments
- Added OS/2 compatibility
- Added `getaddrinfo()` call and `NS_ENABLE_GETADDRINFO`
- Various SSL-related fixes
- Added integer overflow protection in `iobuf_append()` and `deliver_websocket_frame()`
- Fixed NetBSD build
- Enabled `NS_ENABLE_IPV6` build for Visual Studio 2008+
- Enhanced comma detection in `parse_header()`
- Fixed unchanged memory accesses on ARM
- Added ability to use custom memory allocator through NS_MALLOC, NS_FREE, NS_REALLOC
Changes in Mongoose binary:
- Added `-start_browser` option to disable automatic browser launch
- Added experimental SSL support. To listen on HTTPS port, use `ssl://PORT:SSL_CERT` format. For example, to listen on HTTP port 8080 and HTTPS port 8043, use `-listening_port 8080,ssl://8043:ssl_cert.pem`
## Release 5.5, October 28 2014
Changes in Libmongoose library:

1
3rdparty/mongoose/examples/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.exe

View File

@ -3,13 +3,18 @@
SUBDIRS = $(sort $(filter-out csharp/, $(dir $(wildcard */))))
X = $(SUBDIRS)
ifdef WINDIR
# appending the Winsock2 library at the end of the compiler
# invocation
CFLAGS_EXTRA += -lws2_32
endif
.PHONY: $(SUBDIRS)
all: $(SUBDIRS)
$(SUBDIRS):
@$(MAKE) -C $@
@$(MAKE) CFLAGS_EXTRA="$(CFLAGS_EXTRA)" -C $@
clean:
for d in $(SUBDIRS) ; do $(MAKE) -C $$d clean ; done
for d in $(SUBDIRS) ; do $(MAKE) -C $$d clean ; done

View File

@ -71,12 +71,7 @@ static char server_name[50]; // Set by init_server_name()
static char s_config_file[PATH_MAX]; // Set by process_command_line_arguments
static struct mg_server *server; // Set by start_mongoose()
static const char *s_default_document_root = ".";
#ifndef NS_ENABLE_SSL
static const char *s_default_listening_port = "8080";
#else
static const char *s_default_listening_port = "ssl://8443:certs/cert.pem";
#endif
static char **s_argv = { NULL };
static void set_options(char *argv[]);
@ -101,11 +96,8 @@ static void __cdecl signal_handler(int sig_num) {
}
static void vnotify(const char *fmt, va_list ap, int must_exit) {
char msg[200];
vsnprintf(msg, sizeof(msg), fmt, ap);
fprintf(stderr, "%s\n", msg);
vfprintf(stderr, fmt, ap);
fputc('\n', stderr);
if (must_exit) {
exit(EXIT_FAILURE);
}

View File

@ -34,8 +34,6 @@
//
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/>.
//
// $Date: 2014-09-28 05:04:41 UTC $
#ifndef NS_SKELETON_HEADER_INCLUDED
#define NS_SKELETON_HEADER_INCLUDED
@ -46,7 +44,9 @@
#undef _UNICODE // Use multibyte encoding on Windows
#define _MBCS // Use multibyte encoding on Windows
#define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+
#endif
#undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h
#ifdef __Linux__
#define _XOPEN_SOURCE 600 // For flockfile() on Linux
@ -63,6 +63,14 @@
#pragma warning (disable : 4204) // missing c99 support
#endif
#ifndef MONGOOSE_ENABLE_THREADS
#define NS_DISABLE_THREADS
#endif
#ifdef __OS2__
#define _MMAP_DECLARED // Prevent dummy mmap() declaration in stdio.h
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
@ -80,6 +88,8 @@
#ifdef _WIN32
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib") // Linking with winsock library
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
@ -262,7 +272,7 @@ struct ns_connection *ns_bind(struct ns_mgr *, const char *,
struct ns_connection *ns_connect(struct ns_mgr *, const char *,
ns_callback_t, void *);
int ns_send(struct ns_connection *, const void *buf, int len);
int ns_send(struct ns_connection *, const void *buf, size_t len);
int ns_printf(struct ns_connection *, const char *fmt, ...);
int ns_vprintf(struct ns_connection *, const char *fmt, va_list ap);
@ -612,8 +622,6 @@ static int ns_resolve2(const char *host, struct in_addr *ina) {
int rv = 0;
struct addrinfo hints, *servinfo, *p;
struct sockaddr_in *h = NULL;
char *ip = NS_MALLOC(17);
memset(ip, '\0', 17);
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_INET;
@ -699,8 +707,8 @@ static int ns_parse_address(const char *str, union socket_address *sa,
sa->sin.sin_port = htons((uint16_t) port);
}
if (*use_ssl && (sscanf(str + len, ":%99[^:]:%99[^:]%n", cert, ca, &n) == 2 ||
sscanf(str + len, ":%99[^:]%n", cert, &n) == 1)) {
if (*use_ssl && (sscanf(str + len, ":%99[^:,]:%99[^:,]%n", cert, ca, &n) == 2 ||
sscanf(str + len, ":%99[^:,]%n", cert, &n) == 1)) {
len += n;
}
@ -1017,14 +1025,14 @@ static void ns_write_to_socket(struct ns_connection *conn) {
}
}
int ns_send(struct ns_connection *conn, const void *buf, int len) {
int ns_send(struct ns_connection *conn, const void *buf, size_t len) {
return (int) ns_out(conn, buf, len);
}
static void ns_handle_udp(struct ns_connection *ls) {
struct ns_connection nc;
char buf[NS_UDP_RECEIVE_BUFFER_SIZE];
int n;
ssize_t n;
socklen_t s_len = sizeof(nc.sa);
memset(&nc, 0, sizeof(nc));
@ -1381,7 +1389,7 @@ typedef pid_t process_id_t;
struct vec {
const char *ptr;
int len;
size_t len;
};
// For directory listing and WevDAV support
@ -1404,6 +1412,7 @@ enum {
CGI_PATTERN,
#endif
DAV_AUTH_FILE,
DAV_ROOT,
DOCUMENT_ROOT,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
ENABLE_DIRECTORY_LISTING,
@ -1442,6 +1451,7 @@ static const char *static_config_options[] = {
"cgi_pattern", DEFAULT_CGI_PATTERN,
#endif
"dav_auth_file", NULL,
"dav_root", NULL,
"document_root", NULL,
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
"enable_directory_listing", "yes",
@ -1501,7 +1511,7 @@ struct connection {
char *request;
int64_t num_bytes_recv; // Total number of bytes received
int64_t cl; // Reply content length, for Range support
int request_len; // Request length, including last \r\n after last header
ssize_t request_len; // Request length, including last \r\n after last header
};
#define MG_CONN_2_CONN(c) ((struct connection *) ((char *) (c) - \
@ -1743,9 +1753,9 @@ static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) {
// -1 if request is malformed
// 0 if request is not yet fully buffered
// >0 actual request length, including last \r\n\r\n
static int get_request_len(const char *s, int buf_len) {
static int get_request_len(const char *s, size_t buf_len) {
const unsigned char *buf = (unsigned char *) s;
int i;
size_t i;
for (i = 0; i < buf_len; i++) {
// Control characters are not allowed but >=128 are.
@ -2336,7 +2346,7 @@ static void on_cgi_data(struct ns_connection *nc) {
// If reply has not been parsed yet, parse it
if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) {
struct iobuf *io = &conn->ns_conn->send_iobuf;
int s_len = sizeof(cgi_status) - 1;
size_t s_len = sizeof(cgi_status) - 1;
int len = get_request_len(io->buf + s_len, io->len - s_len);
char buf[MAX_REQUEST_SIZE], *s = buf;
@ -2428,7 +2438,9 @@ static void remove_double_dots_and_double_slashes(char *s) {
// Skip all following slashes, backslashes and double-dots
while (s[0] != '\0') {
if (s[0] == '/' || s[0] == '\\') { s++; }
else if (s[0] == '.' && s[1] == '.') { s += 2; }
else if (s[0] == '.' && (s[1] == '/' || s[1] == '\\')) { s += 2; }
else if (s[0] == '.' && s[1] == '.' && s[2] == '\0') { s += 2; }
else if (s[0] == '.' && s[1] == '.' && (s[2] == '/' || s[2] == '\\')) { s += 3; }
else { break; }
}
}
@ -2436,13 +2448,14 @@ static void remove_double_dots_and_double_slashes(char *s) {
*p = '\0';
}
int mg_url_decode(const char *src, int src_len, char *dst,
int dst_len, int is_form_url_encoded) {
int i, j, a, b;
#define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W')
int mg_url_decode(const char *src, size_t src_len, char *dst,
size_t dst_len, int is_form_url_encoded) {
size_t i, j = 0;
int a, b;
#define HEXTOI(x) (isdigit(x) ? (x) - '0' : (x) - 'W')
for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) {
if (src[i] == '%' && i < src_len - 2 &&
if (src[i] == '%' && i + 2 < src_len &&
isxdigit(* (const unsigned char *) (src + i + 1)) &&
isxdigit(* (const unsigned char *) (src + i + 2))) {
a = tolower(* (const unsigned char *) (src + i + 1));
@ -2464,14 +2477,16 @@ int mg_url_decode(const char *src, int src_len, char *dst,
static int is_valid_http_method(const char *s) {
return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") ||
!strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
!strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL");
!strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL") ||
!strcmp(s, "PATCH");
}
// Parse HTTP request, fill in mg_request structure.
// This function modifies the buffer by NUL-terminating
// HTTP request components, header names and header values.
// Note that len must point to the last \n of HTTP headers.
static int parse_http_message(char *buf, int len, struct mg_connection *ri) {
static size_t parse_http_message(char *buf, size_t len,
struct mg_connection *ri) {
int is_request, n;
// Reset the connection. Make sure that we don't touch fields that are
@ -2479,6 +2494,8 @@ static int parse_http_message(char *buf, int len, struct mg_connection *ri) {
ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL;
ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0;
if (len < 1) return ~0;
buf[len - 1] = '\0';
// RFC says that all initial whitespaces should be ingored
@ -2494,7 +2511,7 @@ static int parse_http_message(char *buf, int len, struct mg_connection *ri) {
is_request = is_valid_http_method(ri->request_method);
if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) ||
(!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) {
len = -1;
len = ~0;
} else {
if (is_request) {
ri->http_version += 5;
@ -2553,7 +2570,7 @@ const char *mg_get_header(const struct mg_connection *ri, const char *s) {
}
// Perform case-insensitive match of string against pattern
int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
int mg_match_prefix(const char *pattern, ssize_t pattern_len, const char *str) {
const char *or_str;
int len, res, i = 0, j = 0;
@ -2625,6 +2642,12 @@ void mg_template(struct mg_connection *conn, const char *s,
}
#ifndef MONGOOSE_NO_FILESYSTEM
static int is_dav_request(const struct connection *conn) {
const char *s = conn->mg_conn.request_method;
return !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
!strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND");
}
static int must_hide_file(struct connection *conn, const char *path) {
const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$";
const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN];
@ -2637,19 +2660,24 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf,
size_t buf_len, file_stat_t *st) {
struct vec a, b;
const char *rewrites = conn->server->config_options[URL_REWRITES];
const char *root = conn->server->config_options[DOCUMENT_ROOT];
const char *root =
#ifndef MONGOOSE_NO_DAV
is_dav_request(conn) && conn->server->config_options[DAV_ROOT] != NULL ?
conn->server->config_options[DAV_ROOT] :
#endif
conn->server->config_options[DOCUMENT_ROOT];
#ifndef MONGOOSE_NO_CGI
const char *cgi_pat = conn->server->config_options[CGI_PATTERN];
char *p;
#endif
const char *uri = conn->mg_conn.uri;
const char *domain = mg_get_header(&conn->mg_conn, "Host");
int match_len, root_len = root == NULL ? 0 : strlen(root);
size_t match_len, root_len = root == NULL ? 0 : strlen(root);
// Perform virtual hosting rewrites
if (rewrites != NULL && domain != NULL) {
const char *colon = strchr(domain, ':');
int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain;
size_t domain_len = colon == NULL ? strlen(domain) : colon - domain;
while ((rewrites = next_option(rewrites, &a, &b)) != NULL) {
if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 &&
@ -2709,7 +2737,7 @@ static int should_keep_alive(const struct mg_connection *conn) {
(header == NULL && http_version && !strcmp(http_version, "1.1")));
}
size_t mg_write(struct mg_connection *c, const void *buf, int len) {
size_t mg_write(struct mg_connection *c, const void *buf, size_t len) {
struct connection *conn = MG_CONN_2_CONN(c);
ns_send(conn->ns_conn, buf, len);
return conn->ns_conn->send_iobuf.len;
@ -2873,8 +2901,8 @@ static void SHA1Init(SHA1_CTX *context) {
}
static void SHA1Update(SHA1_CTX *context, const unsigned char *data,
uint32_t len) {
uint32_t i, j;
size_t len) {
size_t i, j;
j = context->count[0];
if ((context->count[0] += len << 3) < j)
@ -2962,7 +2990,7 @@ static void send_websocket_handshake(struct mg_connection *conn,
mg_write(conn, buf, strlen(buf));
}
static int deliver_websocket_frame(struct connection *conn) {
static size_t deliver_websocket_frame(struct connection *conn) {
// Having buf unsigned char * is important, as it is used below in arithmetic
unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf;
size_t i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0,
@ -3241,7 +3269,8 @@ static int find_index_file(struct connection *conn, char *path,
const char *list = conn->server->config_options[INDEX_FILES];
file_stat_t st;
struct vec filename_vec;
size_t n = strlen(path), found = 0;
size_t n = strlen(path);
int found = 0;
// The 'path' given to us points to the directory. Remove all trailing
// directory separator characters from the end of the path, and
@ -3255,8 +3284,12 @@ static int find_index_file(struct connection *conn, char *path,
// path and see if the file exists. If it exists, break the loop
while ((list = next_option(list, &filename_vec, NULL)) != NULL) {
if (path_len <= n + 2) {
continue;
}
// Ignore too long entries that may overflow path buffer
if (filename_vec.len > (int) (path_len - (n + 2)))
if (filename_vec.len > (path_len - (n + 2)))
continue;
// Prepare full path to the index file
@ -3324,7 +3357,8 @@ static void open_file_endpoint(struct connection *conn, const char *path,
// Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
gmt_time_string(date, sizeof(date), &curtime);
gmt_time_string(lm, sizeof(lm), &st->st_mtime);
time_t t = st->st_mtime;
gmt_time_string(lm, sizeof(lm), &t);
construct_etag(etag, sizeof(etag), st);
n = mg_snprintf(headers, sizeof(headers),
@ -3499,7 +3533,7 @@ static int scan_directory(struct connection *conn, const char *dir,
return arr_ind;
}
int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) {
size_t mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) {
static const char *dont_escape = "._-$,;~()";
static const char *hex = "0123456789abcdef";
size_t i = 0, j = 0;
@ -3544,7 +3578,8 @@ static void print_dir_entry(const struct dir_entry *de) {
mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824);
}
}
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime));
time_t t = de->st.st_mtime;
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&t));
mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href));
mg_printf_data(&de->conn->mg_conn,
"<tr><td><a href=\"%s%s\">%s%s</a></td>"
@ -3615,8 +3650,8 @@ static void send_directory_listing(struct connection *conn, const char *dir) {
static void print_props(struct connection *conn, const char *uri,
file_stat_t *stp) {
char mtime[64];
gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime);
time_t t = stp->st_mtime;
gmt_time_string(mtime, sizeof(mtime), &t);
mg_printf(&conn->mg_conn,
"<d:response>"
"<d:href>%s</d:href>"
@ -3796,7 +3831,7 @@ static void handle_put(struct connection *conn, const char *path) {
static void forward_put_data(struct connection *conn) {
struct iobuf *io = &conn->ns_conn->recv_iobuf;
size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write
int n = write(conn->endpoint.fd, io->buf, k); // Write them!
size_t n = write(conn->endpoint.fd, io->buf, k); // Write them!
if (n > 0) {
iobuf_remove(io, n);
conn->cl -= n;
@ -4175,17 +4210,12 @@ static int is_authorized_for_dav(struct connection *conn) {
return authorized;
}
static int is_dav_request(const struct connection *conn) {
const char *s = conn->mg_conn.request_method;
return !strcmp(s, "PUT") || !strcmp(s, "DELETE") ||
!strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND");
}
#endif // MONGOOSE_NO_AUTH
static int parse_header(const char *str, int str_len, const char *var_name,
static int parse_header(const char *str, size_t str_len, const char *var_name,
char *buf, size_t buf_size) {
int ch = ' ', ch1 = ',', len = 0, n = strlen(var_name);
int ch = ' ', ch1 = ',', len = 0;
size_t n = strlen(var_name);
const char *p, *end = str + str_len, *s = NULL;
if (buf != NULL && buf_size > 0) buf[0] = '\0';
@ -4226,7 +4256,7 @@ static void send_ssi_file(struct mg_connection *, const char *, FILE *, int);
static void send_file_data(struct mg_connection *conn, FILE *fp) {
char buf[IOBUF_SIZE];
int n;
size_t n;
while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) {
mg_write(conn, buf, n);
}
@ -4898,7 +4928,7 @@ static void close_local_endpoint(struct connection *conn) {
static void transfer_file_data(struct connection *conn) {
char buf[IOBUF_SIZE];
int n;
size_t n;
// If output buffer is too big, don't send anything. Wait until
// mongoose drains already buffered data to the client.
@ -4919,7 +4949,7 @@ static void transfer_file_data(struct connection *conn) {
}
}
int mg_poll_server(struct mg_server *server, int milliseconds) {
time_t mg_poll_server(struct mg_server *server, int milliseconds) {
return ns_mgr_poll(&server->ns_mgr, milliseconds);
}
@ -5115,20 +5145,38 @@ const char *mg_set_option(struct mg_server *server, const char *name,
DBG(("%s [%s]", name, *v));
if (ind == LISTENING_PORT) {
char buf[500] = "";
size_t n = 0;
struct vec vec;
/*
* Ports can be specified as 0, meaning that OS has to choose any
* free port that is available. In order to pass chosen port number to
* the user, we rewrite all 0 port to chosen values.
*/
while ((value = next_option(value, &vec, NULL)) != NULL) {
struct ns_connection *c = ns_bind(&server->ns_mgr, vec.ptr,
mg_ev_handler, NULL);
if (c== NULL) {
if (c == NULL) {
error_msg = "Cannot bind to port";
break;
} else {
char buf[100];
ns_sock_to_str(c->sock, buf, sizeof(buf), 2);
NS_FREE(*v);
*v = mg_strdup(buf);
char buf2[50], cert[100], ca[100];
union socket_address sa;
int proto, use_ssl;
ns_parse_address(vec.ptr, &sa, &proto, &use_ssl, cert, ca);
ns_sock_to_str(c->sock, buf2, sizeof(buf2),
memchr(vec.ptr, ':', vec.len) == NULL ? 2 : 3);
n += snprintf(buf + n, sizeof(buf) - n, "%s%s%s%s%s%s%s",
n > 0 ? "," : "",
use_ssl ? "ssl://" : "",
buf2, cert[0] ? ":" : "", cert, ca[0] ? ":" : "", ca);
}
}
buf[sizeof(buf) - 1] = '\0';
NS_FREE(*v);
*v = mg_strdup(buf);
#ifndef MONGOOSE_NO_FILESYSTEM
} else if (ind == HEXDUMP_FILE) {
server->ns_mgr.hexdump_file = *v;

View File

@ -22,6 +22,7 @@
#include <stdio.h> // required for FILE
#include <stddef.h> // required for size_t
#include <sys/types.h> // required for time_t
#ifdef __cplusplus
extern "C" {
@ -88,7 +89,7 @@ enum {
struct mg_server *mg_create_server(void *server_param, mg_handler_t handler);
void mg_destroy_server(struct mg_server **);
const char *mg_set_option(struct mg_server *, const char *opt, const char *val);
int mg_poll_server(struct mg_server *, int milliseconds);
time_t mg_poll_server(struct mg_server *, int milliseconds);
const char **mg_get_valid_option_names(void);
const char *mg_get_option(const struct mg_server *server, const char *name);
void mg_copy_listeners(struct mg_server *from, struct mg_server *to);
@ -102,7 +103,7 @@ void mg_send_status(struct mg_connection *, int status_code);
void mg_send_header(struct mg_connection *, const char *name, const char *val);
size_t mg_send_data(struct mg_connection *, const void *data, int data_len);
size_t mg_printf_data(struct mg_connection *, const char *format, ...);
size_t mg_write(struct mg_connection *, const void *buf, int len);
size_t mg_write(struct mg_connection *, const void *buf, size_t len);
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...);
size_t mg_websocket_write(struct mg_connection *, int opcode,
@ -128,8 +129,8 @@ int mg_parse_multipart(const char *buf, int buf_len,
void *mg_start_thread(void *(*func)(void *), void *param);
char *mg_md5(char buf[33], ...);
int mg_authorize_digest(struct mg_connection *c, FILE *fp);
int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len);
int mg_url_decode(const char *src, int src_len, char *dst, int dst_len, int);
size_t mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len);
int mg_url_decode(const char *src, size_t src_len, char *dst, size_t dst_len, int);
int mg_terminate_ssl(struct mg_connection *c, const char *cert);
int mg_forward(struct mg_connection *c, const char *addr);
void *mg_mmap(FILE *fp, size_t size);

View File

@ -120,8 +120,8 @@ static const char *test_parse_http_message() {
ASSERT(strcmp(ri.http_version, "1.1") == 0);
ASSERT(ri.num_headers == 0);
ASSERT(parse_http_message(req2, sizeof(req2) - 1, &ri) == -1);
ASSERT(parse_http_message(req6, 0, &ri) == -1);
ASSERT(parse_http_message(req2, sizeof(req2) - 1, &ri) == (size_t) ~0);
ASSERT(parse_http_message(req6, 0, &ri) == (size_t) ~0);
ASSERT(parse_http_message(req8, sizeof(req8) - 1, &ri) == sizeof(req8) - 1);
// TODO(lsm): Fix this. Header value may span multiple lines.
@ -198,17 +198,19 @@ static const char *test_match_prefix(void) {
}
static const char *test_remove_double_dots() {
struct { char before[20], after[20]; } data[] = {
struct { char before[30], after[30]; } data[] = {
{"////a", "/a"},
{"/.....", "/."},
{"/......", "/"},
{"/.....", "/....."},
{"/......", "/......"},
{"...", "..."},
{"/...///", "/./"},
{"/...///", "/.../"},
{"/a...///", "/a.../"},
{"/.x", "/.x"},
{"/\\", "/"},
{"/a\\", "/a\\"},
{"/a\\\\...", "/a\\."},
{"/a\\\\...", "/a\\..."},
{"foo/x..y/././y/../../..", "foo/x..y/y/"},
{"foo/..x", "foo/..x"},
};
size_t i;
@ -261,6 +263,7 @@ static const char *test_url_decode(void) {
ASSERT(strcmp(buf, "a ") == 0);
ASSERT(mg_url_decode("%61", 1, buf, sizeof(buf), 1) == 1);
printf("[%s]\n", buf);
ASSERT(strcmp(buf, "%") == 0);
ASSERT(mg_url_decode("%61", 2, buf, sizeof(buf), 1) == 2);

154
docs/luaengine.md Normal file
View File

@ -0,0 +1,154 @@
# Scripting MAME via LUA
## Introduction
It is now possible to externally drive MAME via LUA scripts.
This feature initially appeared in version 0.148, when a minimal `luaengine`
was implemented. Nowadays, the LUA interface is rich enough
to let you inspect and manipulate devices state, access CPU
registers, read and write memory, and draw a custom HUD on screen.
Internally, MAME makes extensive use of `luabridge` to implement
this feature: the idea is to transparently expose as many of
the useful internals as possible.
Finally, a warning: LUA API is not yet declared stable and may
suddenly change without prior notice.
However, we expose methods to let you know at runtime which API
version you are running against, and you can introspect most of the
objects at runtime.
## Features
The API is not yet complete, but this is a partial list of capabilities
currently available to LUA scripts:
* machine metadata (app version, current rom, rom details)
* machine control (starting, pausing, resetting, stopping)
* machine hooks (on frame painting and on user events)
* devices introspection (device tree listing, memory and register enumeration)
* screens introspection (screens listing, screen details, frames counting)
* screen HUD drawing (text, lines, boxes on multiple screens)
* memory read/write (8/16/32/64 bits, signed and unsigned)
* registers and states control (states enumeration, get and set)
## Usage
MAME supports external scripting via LUA (>= 5.3) scripts, either
written on the interactive console or loaded as a file.
To reach the console, just run MAME with `-console`; you will be
greeted by a naked `>` prompt where you can input your script.
To load a whole script at once, store it in a plaintext file and
pass it via the `-autoboot_script`. Please note that script
loading may be delayed (few seconds by default), but you can
override the default with the `-autoboot_delay` argument.
To control the execution of your code, you can use a loop-based or
an event-based approach. The former is not encouraged as it is
resource-intensive and makes control flow unnecessarily complex.
Instead, we suggest to register custom hooks to be invoked on specific
events (eg. at each frame rendering).
## Walktrough
Let's first run MAME in a terminal to reach the LUA console:
```
$ mame -console YOUR_ROM
M.A.M.E. v0.158 (Feb 5 2015) - Multiple Arcade Machine Emulator
Copyright Nicola Salmoria and the MAME team
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>
```
At this point, your game is probably running in demo mode, let's pause it:
```
> emu.pause()
>
```
Even without textual feedback on the console, you'll notice the game is now paused.
In general, commands are quiet and only print back error messages.
You can check at runtime which version of MAME you are running, with:
```
> print(emu.app_name() .. " " .. emu.app_version())
mame 0.158
```
We now start exploring screen related methods. First, let's enumerate available screens:
```
> for i,v in pairs(manager:machine().screens) do print(i) end
:screen
```
`manager:machine()` is the root object of your currently running machine:
we will be using this often. `screens` is a table with all available screens;
most machines only have one main screen.
In our case, the main and only screen is tagged as `:screen`, and we can further
inspect it:
```
> -- let's define a shorthand for the main screen
> s = manager:machine().screens[":screen"]
> print(s:width() .. "x" .. s:height())
320x224
```
We have several methods to draw on the screen a HUD composed of lines, boxes and text:
```
> -- we define a HUD-drawing function, and then call it
> function draw_hud()
>> s:draw_text(40, 40, "foo"); -- (x0, y0, msg)
>> s:draw_box(20, 20, 80, 80, 0, 0xff00ffff); -- (x0, y0, x1, y1, fill-color, line-color)
>> s:draw_line(20, 20, 80, 80, 0xff00ffff); -- (x0, y0, x1, y1, line-color)
>> end
> draw_hud();
```
This will draw some useless art on the screen. However, when unpausing the game, your HUD
needs to be refreshed otherwise it will just disappear. In order to do this, you have to register
your hook to be called on every frame repaint:
```
> emu.sethook(draw_hud, "frame")
```
Similarly to screens, you can inspect all the devices attached to a
machine:
```
> for k,v in pairs(manager:machine().devices) do print(k) end
:audiocpu
:maincpu
:saveram
:screen
:palette
[...]
```
On some of them, you can also inspect and manipulate memory and state:
```
> cpu = manager:machine().devices[":maincpu"]
> -- enumerate, read and write state registers
> for k,v in pairs(cpu.state) do print(k) end
D5
SP
A4
A3
D0
PC
[...]
> print(cpu.state["D0"].value)
303
> cpu.state["D0"].value = 255
> print(cpu.state["D0"].value)
255
```
```
> -- inspect memory
> for k,v in pairs(cpu.spaces) do print(k) end
program
> mem = cpu.spaces["program"]
> print(mem:read_i8(0xC000))
41
```

View File

@ -648,7 +648,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</part>
</software>
<software name="barbie">
<software name="barbiesm">
<description>Barbie Super Model (Prototype)</description>
<year>1993</year>
<publisher>Hi Tech Expressions</publisher>
@ -3222,7 +3222,7 @@ a certain item) -->
</software>
<software name="hyokkohj">
<description>Hyokkori Hyoutanjima - Hyoutanjima no Daikoukai (Jpn)</description>
<description>Hyokkori Hyoutan-jima - Hyoutan-jima no Daikoukai (Jpn)</description>
<year>1992</year>
<publisher>Sega</publisher>
<info name="serial" value="G-3218"/>

View File

@ -10,8 +10,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="2004.bin" size="0x20000" crc="ff4a99e2" sha1="b5dea250829224ce8cf18ec310ad503cb928667f" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="2004.bin" size="131072" crc="ff4a99e2" sha1="b5dea250829224ce8cf18ec310ad503cb928667f" offset="0x00000" />
</dataarea>
</part>
</software>
@ -21,8 +21,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="adventure legend carlo.bin" size="0x20000" crc="7d61d215" sha1="741684b5379d4be732a98beace5d09f37ff19bbf" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="adventure legend carlo.bin" size="131072" crc="7d61d215" sha1="741684b5379d4be732a98beace5d09f37ff19bbf" offset="0x00000" />
</dataarea>
</part>
</software>
@ -32,8 +32,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="aries.bin" size="0x20000" crc="b854f1f2" sha1="1ad7a325aba2cf3593165b53e7ae3973388335f7" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="aries.bin" size="131072" crc="b854f1f2" sha1="1ad7a325aba2cf3593165b53e7ae3973388335f7" offset="0x00000" />
</dataarea>
</part>
</software>
@ -43,8 +43,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="dino adventure legend.bin" size="0x20000" crc="2df0c1e6" sha1="df4b5dc80a758d9e3c9b00384e3099ad8331faad" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="dino adventure legend.bin" size="131072" crc="2df0c1e6" sha1="df4b5dc80a758d9e3c9b00384e3099ad8331faad" offset="0x00000" />
</dataarea>
</part>
</software>
@ -54,8 +54,30 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="duck man.bin" size="0x20000" crc="9d12950a" sha1="376606097f66105d1a9e97e9793362f6f1e3b1a7" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="duck man.bin" size="131072" crc="9d12950a" sha1="376606097f66105d1a9e97e9793362f6f1e3b1a7" offset="0x00000" />
</dataarea>
</part>
</software>
<software name="f1_2k4" supported="no">
<description>F1-2004 Racing</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="131072">
<rom name="f1-2004 racing.bin" size="131072" crc="dae3a18d" sha1="939931d1eed8a353fb0cd065612479b52ee36242" offset="0x00000" />
</dataarea>
</part>
</software>
<software name="feichun7" supported="no">
<description>Feichuan VII</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="131072">
<rom name="feichuan vii.bin" size="131072" crc="f94715f1" sha1="98b1cd7d3d1fe1b1341bef0b2f7d4ae0052fdb01" offset="0x00000" />
</dataarea>
</part>
</software>
@ -65,8 +87,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="happy ball.bin" size="0x20000" crc="79d4e738" sha1="fc14712260ed6e3d6313055046546d37b7c838d2" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="happy ball.bin" size="131072" crc="79d4e738" sha1="fc14712260ed6e3d6313055046546d37b7c838d2" offset="0x00000" />
</dataarea>
</part>
</software>
@ -76,8 +98,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="happy killer.bin" size="0x20000" crc="9fd7ec65" sha1="705309829ee87689793c15be1f781d52471908d6" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="happy killer.bin" size="131072" crc="9fd7ec65" sha1="705309829ee87689793c15be1f781d52471908d6" offset="0x00000" />
</dataarea>
</part>
</software>
@ -87,8 +109,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="lanneret.bin" size="0x20000" crc="249df6a5" sha1="bcf92ab85cc97ffe94d6a363a87b0b5de62c3c66" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="lanneret.bin" size="131072" crc="249df6a5" sha1="bcf92ab85cc97ffe94d6a363a87b0b5de62c3c66" offset="0x00000" />
</dataarea>
</part>
</software>
@ -98,8 +120,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="penguin.bin" size="0x20000" crc="8c7b81c9" sha1="2f253b6ab6f6b9fc114ffca120d13df2e1e5f860" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="penguin.bin" size="131072" crc="8c7b81c9" sha1="2f253b6ab6f6b9fc114ffca120d13df2e1e5f860" offset="0x00000" />
</dataarea>
</part>
</software>
@ -109,19 +131,30 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="popper.bin" size="0x20000" crc="a704617b" sha1="314931548578303e5e80a2bcb03c92472cb014d9" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="popper.bin" size="131072" crc="a704617b" sha1="314931548578303e5e80a2bcb03c92472cb014d9" offset="0x00000" />
</dataarea>
</part>
</software>
<software name="sthero" supported="no">
<software name="soldier" supported="no">
<description>Soldier</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="131072">
<rom name="soldier.bin" size="131072" crc="0a1ac0ed" sha1="590e2ed2b72ad2e3a8c1d6b115c7c9acabf9aa63" offset="0x00000" />
</dataarea>
</part>
</software>
<software name="shero" supported="no">
<description>Street Hero</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="street hero.bin" size="0x20000" crc="9e0fe489" sha1="2c442126999e4b112a48e42a82dfa9ad9d6efa22" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="street hero.bin" size="131072" crc="9e0fe489" sha1="2c442126999e4b112a48e42a82dfa9ad9d6efa22" offset="0x00000" />
</dataarea>
</part>
</software>
@ -131,8 +164,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="supermotor.bin" size="0x20000" crc="6290b94b" sha1="0c3011da35170241637907bb23d79355db38f343" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="supermotor.bin" size="131072" crc="6290b94b" sha1="0c3011da35170241637907bb23d79355db38f343" offset="0x00000" />
</dataarea>
</part>
</software>
@ -142,12 +175,10 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="0x20000">
<rom name="trojan legend.bin" size="0x20000" crc="7ce3975e" sha1="e925e4f28efc85ce69fb504b85a98a60883aa30d" offset="0x00000" />
<dataarea name="rom" size="131072">
<rom name="trojan legend.bin" size="131072" crc="7ce3975e" sha1="e925e4f28efc85ce69fb504b85a98a60883aa30d" offset="0x00000" />
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -12294,6 +12294,17 @@ Note: In the AGB-E05-XX and AGB-E06-XX pcbs, the chip name is hidden under the b
</part>
</software>
<software name="dune">
<description>Frank Herbert's Dune - Ornithopter Assault (Prototype)</description>
<year>200?</year>
<publisher>Cryo</publisher>
<part name="cart" interface="gba_cart">
<dataarea name="rom" size="4194304">
<rom name="dune-ornithopter-assault-gba-cancelled.bin" size="4194304" crc="298d627b" sha1="1d317fb050f6d5b850f4b88b72f3420cb175edf3" offset="000000" />
</dataarea>
</part>
</software>
<software name="eyebehol">
<description>Dungeons &amp; Dragons - Eye of the Beholder (Euro)</description>
<year>2002</year>

View File

@ -23650,6 +23650,21 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
-->
<software name="emochndx" supported="partial">
<description>Emo Cheng DX (Chi)</description>
<year>200?</year>
<publisher>Sintax</publisher>
<part name="cart" interface="gameboy_cart">
<feature name="slot" value="rom_licheng" />
<!-- cartridge ram -->
<dataarea name="rom" size="4194304">
<rom name="e mo cheng dx (sintax) (unl).bin" size="4194304" crc="5c388c6d" sha1="7919fe7b54a5bc53ebacc13dd338be9e841dadf7" offset="0" />
</dataarea>
<dataarea name="nvram" size="32768">
</dataarea>
</part>
</software>
<software name="shuihusslc" cloneof="shuihuss">
<description>Shui Hu Shen Shou (Chi, Li Cheng)</description>
<year>200?</year>
@ -24104,7 +24119,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
<feature name="slot" value="rom_sintax" />
<!-- cartridge ram -->
<dataarea name="rom" size="2097152">
<rom name="digimon crystal ii (unlicensed, english) [raw dump].gbc" size="2097152" crc="685e76df" sha1="4e981044ac3a40d7a9cd63b79d5982b4b4e670a5" offset="0" />
<rom name="digimon crystal ii (unlicensed, english) [raw dump].bin" size="2097152" crc="685e76df" sha1="4e981044ac3a40d7a9cd63b79d5982b4b4e670a5" offset="0" />
</dataarea>
<dataarea name="nvram" size="32768">
</dataarea>
@ -24120,7 +24135,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
<feature name="slot" value="rom_sintax" />
<!-- cartridge ram -->
<dataarea name="rom" size="2097152">
<rom name="lao fuzi chuanqi (unlicensed, chinese) [raw dump].gbc" size="2097152" crc="aeca45be" sha1="b7193fcb8b9b8958a2522be0d1a3874cffc1e1db" offset="0" />
<rom name="lao fuzi chuanqi (unlicensed, chinese) [raw dump].bin" size="2097152" crc="aeca45be" sha1="b7193fcb8b9b8958a2522be0d1a3874cffc1e1db" offset="0" />
</dataarea>
<dataarea name="nvram" size="32768">
</dataarea>
@ -24136,7 +24151,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
<feature name="slot" value="rom_sintax" />
<!-- cartridge ram -->
<dataarea name="rom" size="2097152">
<rom name="yuenan zhanyi x - shenru dihou (unlicensed, chinese) [raw dump].gbc" size="2097152" crc="602951a6" sha1="6703e9f68b989c976e93bd2eb63f884ceaff63f1" offset="0" />
<rom name="yuenan zhanyi x - shenru dihou (unlicensed, chinese) [raw dump].bin" size="2097152" crc="602951a6" sha1="6703e9f68b989c976e93bd2eb63f884ceaff63f1" offset="0" />
</dataarea>
<dataarea name="nvram" size="32768">
</dataarea>
@ -24152,7 +24167,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
<feature name="slot" value="rom_sintax" />
<!-- cartridge ram -->
<dataarea name="rom" size="2097152">
<rom name="qi long zhu z 3 (dragon ball - advance adventure) (unlicensed, chinese) [raw dump].gbc" size="2097152" crc="ccfdd63a" sha1="4f3b63cd11522b6fb291661f4d918601d95138e0" offset="0" />
<rom name="qi long zhu z 3 (dragon ball - advance adventure) (unlicensed, chinese) [raw dump].bin" size="2097152" crc="ccfdd63a" sha1="4f3b63cd11522b6fb291661f4d918601d95138e0" offset="0" />
</dataarea>
<dataarea name="nvram" size="32768">
</dataarea>
@ -24353,7 +24368,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
</part>
</software>
<!-- this is a sprite hack (based on Golden Sun by Camelot) of another syntax game "Castlevania DX", currently undumped -->
<!-- this is a sprite hack (based on Golden Sun by Camelot) of another sintax game "Castlevania DX", currently undumped -->
<!-- ingame title uses 黃金の太陽, so I romanized it in the Jpn way rather than in the Chinese way... -->
<software name="hjtaiyou">
<description>Pian Wai Zhang Huang Jin no Taiyou - Feng Yin De Yuan Gu Lian Jin Shu (Chi)</description>
@ -24370,7 +24385,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
</part>
</software>
<!-- this is a sprite hack (based on Dragon Quest by Enix) of another syntax game "Castlevania DX", currently undumped -->
<!-- this is a sprite hack (based on Dragon Quest by Enix) of another sintax game "Castlevania DX", currently undumped -->
<software name="dquest8">
<description>Yong Zhe Dou E Long VIII (Chi)</description>
<year>200?</year>
@ -24607,7 +24622,7 @@ These were produced between 2000 and 2001 by Rocket Games, run by Datel Design
<software name="taikong" cloneof="firmbaby">
<!-- 4MB rom with crc 5b49af92 is taizou's cracked version running on base MBC5 -->
<description>Tai Kong Bao Bei (Chi, Syntax)</description>
<description>Tai Kong Bao Bei (Chi, Sintax)</description>
<year>200?</year>
<publisher>Sintax</publisher>
<info name="alt_title" value="太空寶貝"/>

View File

@ -9583,7 +9583,7 @@ Info on Sega chip labels (from Sunbeam / Digital Corruption)
<!-- Only Euro is confirmed -->
<software name="skitchin">
<description>Skitchin (Euro, USA)</description>
<description>Skitchin' (Euro, USA)</description>
<year>1993</year>
<publisher>Electronic Arts</publisher>
<part name="cart" interface="megadriv_cart">
@ -9748,7 +9748,7 @@ but dumps still have to be confirmed.
</software>
<software name="aaahhrmu" cloneof="aaahhrm">
<description>AAAHH!!! Real Monsters (USA)</description>
<description>Aaahh!!! Real Monsters (USA)</description>
<year>1995</year>
<publisher>Viacom New Media</publisher>
<part name="cart" interface="megadriv_cart">
@ -9759,7 +9759,7 @@ but dumps still have to be confirmed.
</software>
<software name="aaahhrmup" cloneof="aaahhrm">
<description>AAAHH!!! Real Monsters (USA, Prototype 19950707)</description>
<description>Aaahh!!! Real Monsters (USA, Prototype 19950707)</description>
<year>1995</year>
<publisher>Viacom New Media</publisher>
<part name="cart" interface="megadriv_cart">
@ -10336,7 +10336,7 @@ but dumps still have to be confirmed.
</software>
<software name="ootwp" cloneof="anotherw">
<description>Out of this World (Prototype)</description>
<description>Out of This World (Prototype)</description>
<year>1993</year>
<publisher>Virgin Games</publisher>
<part name="cart" interface="megadriv_cart">
@ -12991,6 +12991,17 @@ but dumps still have to be confirmed.
</part>
</software>
<software name="xfirep" cloneof="xfire">
<description>Cross Fire (USA, Prototype)</description>
<year>1991</year>
<publisher>Kyugo Boueki</publisher>
<part name="cart" interface="megadriv_cart">
<dataarea name="rom" width="16" endianness="big" size="524288">
<rom name="crossfire-gen-beta.bin" size="524288" crc="ff9e9f45" sha1="f33995fbb6d5378de0ce246c237e28fd7de1a3d9" offset="0x000000"/>
</dataarea>
</part>
</software>
<software name="superair" cloneof="xfire">
<description>Super Airwolf (Jpn)</description>
<year>1991</year>
@ -16197,7 +16208,7 @@ but dumps still have to be confirmed.
</software>
<software name="hyokkohj" supported="partial">
<description>Hyokkori Hyoutan Jima - Daitouryou o Mezase! (Jpn)</description>
<description>Hyokkori Hyoutan-jima - Daitouryou o Mezase! (Jpn)</description>
<year>1992</year>
<publisher>Sega</publisher>
<info name="serial" value="G-4075"/>

File diff suppressed because it is too large Load Diff

View File

@ -9657,6 +9657,20 @@ ExtractDisk [08]"下巻 ユーザー " -> "aaa_08.d88"
</part>
</software>
<software name="doordmk2a" cloneof="doordmk2">
<description>Door Door mkII (Alt)</description>
<year>1985</year>
<publisher>エニックス (Enix)</publisher>
<!-- PC8801 -->
<info name="release" value="198502xx"/>
<info name="alt_title" value="ドアドア mk2"/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348624">
<rom name="door door mkii (alt).d88" size="348624" crc="50c65512" sha1="247a29b6f40fe90851c569f50660b877cca8258f" offset="0" />
</dataarea>
</part>
</software>
<software name="dororo">
<description>Dororo - Jigoku Emaki no Shou</description>
<year>1988</year>

File diff suppressed because it is too large Load Diff

View File

@ -92,6 +92,18 @@
</part>
</software>
<software name="mcterm095" cloneof="mcterm">
<description>McTerm 0.95</description>
<year>1980</year>
<publisher>Madison Computer</publisher>
<part name="rom" interface="pet_9000_rom">
<dataarea name="rom" size="0x800">
<rom name="mcterm095-9000.bin" size="0x800" crc="4ef176ea" sha1="b7e66e229a077067b7b88bb2f740ed8be4ca5658" offset="0" />
</dataarea>
</part>
</software>
<software name="mcterm120" cloneof="mcterm">
<description>McTerm 1.20</description>
<year>1981</year>

View File

@ -25,8 +25,6 @@ Published by Sega/Sega Toys (HPC-6*** serial codes)
* クッキングピコ セット - Cooking Pico Set (Sega Toys - 1999xxxx - HPC-6076)
* スージーちゃんとマービー おてつだい だ~いすき! - Susie-chan to Mabi - Otetsudai Daisuki! (Sega Toys - 200010xx - HPC-6089)
* パソコン接続キット ピコタウンにでかけよう! - Pasokon Setsuzoku Kit PicoTown ni Dekakeyou! (Sega Toys - 20010601 - HPC-6097)
* アンパンマンのはじめてマウスピコ アンパンマンとパソコンれんしゅう! <同梱> - Anpanman no Hajimete Mouse Pico with Anpanman to Pasokon renshuu! (Sega Toys - 20020124 - HPC-6102)
* ECCジュニアの はじめてえいご Vol.3 - Happy Birthday, Patty! パティちゃんのお誕生日 - ECC Junior no Hajimete Eigo Vol. 3 - Happy Birthday, Patty! - Patty-chan no Otanjoubi (Sega Toys - 20020307 - HPC-6105)
* ECCジュニアの はじめてえいご Vol.4 - Patty Loves Animals 動物大好き、パティちゃん - ECC Junior no Hajimete Eigo Vol. 4 - Patty Loves Animals - Doubutsu Daisuki, Patty-chan (Sega Toys - 200207xx - HPC-6106)
* ECCジュニアの はじめてえいご Vol.5 - Merry Christmas, Patty! メリークリスマス、パティちゃん - ECC Junior no Hajimete Eigo Vol. 5 - Merry Christmas, Patty! - Merry Christmas, Patty-chan (Sega Toys - 200207xx - HPC-6107)
* ECCジュニアの はじめてえいご Vol.6 - Patty Goes to the Amusement Park パティちゃん遊園地に行く - ECC Junior no Hajimete Eigo Vol. 6 - Patty Goes to the Amusement Park - Patty-chan Yuuenchi ni Iku (Sega Toys - 200207xx - HPC-6108)
@ -440,6 +438,26 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher)
</part>
</software>
<software name="anpanpc">
<description>Anpanman to Pasokon Renshuu! (Jpn)</description>
<year>2002</year>
<publisher>Sega Toys</publisher>
<info name="serial" value="HPC-6102"/>
<info name="release" value="20020124"/>
<info name="alt_title" value="アンパンマンのはじめてマウスピコ アンパンマンとパソコンれんしゅう! ~ Anpanman no Hajimete Mouse Pico with Anpanman to Pasokon renshuu!"/>
<part name="cart" interface="pico_cart">
<feature name="pcb" value="9B1-2???" />
<feature name="ic1" value="9K0-0050" />
<feature name="ic2" value="HC32" />
<feature name="ic3" value="HC74" />
<feature name="ic4" value="HC125" />
<feature name="ic5" value="9K0-0003" />
<dataarea name="rom" size="2097152">
<rom name="9k0-0050.ic1" size="2097152" crc="7080cc7a" sha1="0df483eaa1ab7d1c56b0a2ede6b385ed14393e46" offset="000000" loadflag="load16_word_swap" />
</dataarea>
</part>
</software>
<software name="nadja">
<description>Ashita no Nadja (Jpn)</description>
<year>2003</year>
@ -1165,8 +1183,8 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher)
<feature name="pcb" value="9B1-0006B" />
<feature name="u1" value="EPOXY BLOCK U1" />
<feature name="u2" value="74HC00D" />
<dataarea name="rom" size="2097152">
<rom name="epoxy block u1.u1" size="2097152" crc="8e13270b" sha1="7c9e0a595cd0d53b970d8d4a1037d668c36dd103" offset="0" loadflag="load16_word_swap" />
<dataarea name="rom" size="4194304">
<rom name="epoxy block u1.u1" size="4194304" crc="2650e0c1" sha1="2e69a43afe121ad394667fb784bc7203d9df2a12" offset="0" loadflag="load16_word_swap" />
</dataarea>
</part>
</software>
@ -1182,8 +1200,25 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher)
<feature name="pcb" value="9B1-0005B" />
<feature name="u1" value="EPOXY BLOCK U1" />
<feature name="u2" value="74HC00D" />
<dataarea name="rom" size="2097152">
<rom name="epoxy block u1.u1" size="2097152" crc="97a5b8d7" sha1="c9c19b1c4e21e4a7f2a65cd4c810b0b7194107bf" offset="0" loadflag="load16_word_swap" />
<dataarea name="rom" size="4194304">
<rom name="epoxy block u1.u1" size="4194304" crc="c867237a" sha1="f69cc420cc178d1efd9c76c853a9aa8d8cc24091" offset="0" loadflag="load16_word_swap" />
</dataarea>
</part>
</software>
<software name="ecc3">
<description>ECC Junior no Hajimete Eigo Vol. 3 - Happy Birthday, Patty! - Patty-chan no o-Tanjoubi (Jpn)</description>
<year>2002</year>
<publisher>Sega Toys</publisher>
<info name="serial" value="HPC-6105" />
<info name="release" value="20020307"/>
<info name="alt_title" value="ECCジュニアの はじめてえいご Vol.3 - Happy Birthday, Patty! パティちゃんのお誕生日"/>
<part name="cart" interface="pico_cart">
<feature name="pcb" value="9B1-0005A" />
<feature name="ic1" value="9K0-0059" />
<feature name="ic2" value="HC00" />
<dataarea name="rom" size="4194304">
<rom name="9k0-0059.ic1" size="4194304" crc="a7faf67c" sha1="25527816ebea51395b1abf011e3784eb24662d78" offset="0" loadflag="load16_word_swap" />
</dataarea>
</part>
</software>

View File

@ -3369,6 +3369,17 @@
</part>
</software>
<software name="jangpun2">
<description>Jang Pung II (Kor)</description>
<year>1993</year>
<publisher>Sieco</publisher>
<part name="cart" interface="sms_cart">
<dataarea name="rom" size="524288">
<rom name="jang pung ii (kr).bin" size="524288" crc="929222c4" sha1="10a5095513efebae3d045b217caa7a520e66f26f" offset="000000" />
</dataarea>
</part>
</software>
<software name="jangpun3">
<description>Jang Pung 3 (Kor)</description>
<year>1994</year>
@ -5432,6 +5443,18 @@
</part>
</software>
<software name="skyjag1" cloneof="skyjag">
<description>Sky Jaguar (Kor, Clover)</description>
<year>199?</year>
<publisher>Clover</publisher>
<info name="alt_title" value="스카이쟈가"/>
<part name="cart" interface="sms_cart">
<dataarea name="rom" size="32768">
<rom name="sky jaguar [clover] (kr).bin" size="32768" crc="e3f260ca" sha1="7eb9e296b674c4cda935e7c5b58eb3dad3aa322f" offset="000000" />
</dataarea>
</part>
</software>
<software name="sf2">
<description>Street Fighter II (Bra)</description>
<year>1997</year>

View File

@ -627,7 +627,7 @@ Beyond that last category are the roms waiting to be classified.
</part>
</software>
<software name="batmanrnjs" cloneof="batmanrn">
<software name="batmanrnjp" cloneof="batmanrn">
<!-- d4s -->
<description>Batman Returns (Jpn, Prototype)</description>
<year>1993</year>
@ -6159,7 +6159,7 @@ more investigation needed...
</software>
<software name="ardyligtu" cloneof="ardyligt">
<description>Ardy Light Foot (USA)</description>
<description>Ardy Lightfoot (USA)</description>
<year>1996</year>
<publisher>Titus</publisher>
<info name="serial" value="M/SNS-A9-USA" />
@ -25753,7 +25753,7 @@ more investigation needed...
</part>
</software>
<software name="sgboyj">
<software name="sgboyj" cloneof="sgboy">
<description>Super Game Boy (Jpn)</description>
<year>1994</year>
<publisher>Nintendo</publisher>
@ -25780,7 +25780,7 @@ more investigation needed...
</part>
</software>
<software name="sgboyj1">
<software name="sgboyj1" cloneof="sgboy">
<description>Super Game Boy (Jpn, Alt)</description> <!-- Alternate hardware -->
<year>1994</year>
<publisher>Nintendo</publisher>
@ -34600,7 +34600,7 @@ List of unclassified roms
</part>
</software>
<software name="barbieva">
<software name="barbvac">
<description>Barbie Vacation Adventure (USA, Prototype)</description>
<year>1994</year>
<publisher>Hi Tech Expressions</publisher>
@ -34916,7 +34916,7 @@ List of unclassified roms
</software>
<software name="beautyp" cloneof="beauty">
<description>Beauty and the Beast (Euro, Prototype)</description>
<description>Disney's Beauty and the Beast (Euro, Prototype)</description>
<year>1994</year>
<publisher>Hudson</publisher>
<part name="cart" interface="snes_cart">
@ -34928,7 +34928,7 @@ List of unclassified roms
</software>
<software name="beauty">
<description>Beauty and the Beast (Euro)</description>
<description>Disney's Beauty and the Beast (Euro)</description>
<year>1994</year>
<publisher>Hudson</publisher>
<part name="cart" interface="snes_cart">
@ -43401,7 +43401,7 @@ List of unclassified roms
</part>
</software>
<software name="joemacj">
<software name="joemacj" cloneof="joemac">
<description>Joe &amp; Mac - Tatakae Genshijin (Jpn)</description>
<year>1991</year>
<publisher>Data East</publisher>
@ -43636,7 +43636,7 @@ List of unclassified roms
</part>
</software>
<software name="jstrikeu">
<software name="jstrikeu" cloneof="jstrike">
<description>Jungle Strike (USA)</description>
<year>1995</year>
<publisher>Electronic Arts</publisher>
@ -43649,7 +43649,7 @@ List of unclassified roms
</part>
</software>
<software name="jstrikej">
<software name="jstrikej" cloneof="jstrike">
<description>Jungle Strike - Uketsugareta Kyouki (Jpn)</description>
<year>1995</year>
<publisher>Electronic Arts Victor</publisher>
@ -52093,6 +52093,18 @@ List of unclassified roms
</part>
</software>
<software name="targa" cloneof="rrr2">
<description>Targa (Prototype)</description>
<year>1995</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="snes_cart">
<feature name="slot" value="lorom" />
<dataarea name="rom" size="4194304">
<rom name="targa.sfc" size="4194304" crc="19fba1d4" sha1="6052dcc6bc0d10413669e0da74f02bf9de99d7a7" offset="0x000000" />
</dataarea>
</part>
</software>
<software name="returndd" cloneof="sddragon">
<description>Return of Double Dragon (Jpn)</description>
<year>1992</year>
@ -57680,7 +57692,7 @@ List of unclassified roms
</part>
</software>
<software name="spangj">
<software name="spangj" cloneof="spang">
<description>Super Pang (Jpn)</description>
<year>1992</year>
<publisher>Capcom</publisher>
@ -62236,6 +62248,20 @@ List of unclassified roms
</part>
</software>
<software name="wolfn3du" cloneof="wolfn3d">
<description>Wolfenstein 3D (USA)</description>
<year>1994</year>
<publisher>Imagineer</publisher>
<info name="release" value="199403xx" />
<sharedfeat name="compatibility" value="NTSC"/>
<part name="cart" interface="snes_cart">
<feature name="slot" value="hirom" />
<dataarea name="rom" size="1048576">
<rom name="wolfenstein 3d (usa).sfc" size="1048576" crc="6582a8f5" sha1="88fe872eb984af84f8ca7633ef5bd3904a2baeb4" offset="0x000000" />
</dataarea>
</part>
</software>
<software name="wolfn3dup" cloneof="wolfn3d">
<description>Wolfenstein 3D (USA, Prototype)</description>
<year>1994</year>
@ -62248,16 +62274,14 @@ List of unclassified roms
</part>
</software>
<software name="wolfn3du" cloneof="wolfn3d">
<description>Wolfenstein 3D (USA)</description>
<software name="wolfn3dup2" cloneof="wolfn3d">
<description>Wolfenstein 3D (USA, Prototype 2)</description>
<year>1994</year>
<publisher>Imagineer</publisher>
<info name="release" value="199403xx" />
<sharedfeat name="compatibility" value="NTSC"/>
<part name="cart" interface="snes_cart">
<feature name="slot" value="hirom" />
<dataarea name="rom" size="1048576">
<rom name="wolfenstein 3d (usa).sfc" size="1048576" crc="6582a8f5" sha1="88fe872eb984af84f8ca7633ef5bd3904a2baeb4" offset="0x000000" />
<rom name="wolf3d-beta2.sfc" size="1048576" crc="2bebdb00" sha1="837b0181f2e9cf75728330ed1d3400e9b6f5212d" offset="0x000000" />
</dataarea>
</part>
</software>
@ -63675,7 +63699,7 @@ List of unclassified roms
</part>
</software>
<software name="sgboyju">
<software name="sgboyju" cloneof="sgboy">
<description>Super Game Boy (Jpn, USA, Rev. A)</description>
<year>199?</year>
<publisher>Nintendo</publisher>

View File

@ -9,7 +9,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0112-JPN" />
<info name="release" value="19960927" />
<info name="alt_title" value="美少女戦士セーラームーン セー ラースターズ ~ふわふわパニック2" />
<info name="alt_title" value="美少女戦士セーラームーン セーラースターズ ~ふわふわパニック2" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />
@ -57,7 +57,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0109-JPN" />
<info name="release" value="19960823" />
<info name="alt_title" value="激走戦隊カーレンジャー 全開!レー サー戦士" />
<info name="alt_title" value="激走戦隊カーレンジャー 全開!レーサー戦士" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />
@ -121,7 +121,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0111-JPN" />
<info name="release" value="19960927" />
<info name="alt_title" value="SDガンダムジェネレーション コロ ニー格闘記" />
<info name="alt_title" value="SDガンダムジェネレーション コロニー格闘記" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />
@ -153,7 +153,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0104-JPN" />
<info name="release" value="19960726" />
<info name="alt_title" value="SDガンダムジェネレーション一年戦争記" />
<info name="alt_title" value="SDガンダムジェネレーション 一年戦争記" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />
@ -169,7 +169,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0110-JPN" />
<info name="release" value="19960927" />
<info name="alt_title" value="SDガンダムジェネレーション ザン スカール戦記" />
<info name="alt_title" value="SDガンダムジェネレーション ザンスカール戦記" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />
@ -185,7 +185,7 @@
<publisher>Bandai</publisher>
<info name="serial" value="SFT-0101-JPN" />
<info name="release" value="19960628" />
<info name="alt_title" value="SDウルトラバトル ウルトラマン伝 説" />
<info name="alt_title" value="SDウルトラバトル ウルトラマン伝説" />
<part name="cart" interface="st_cart">
<feature name="slot" value="strom" />

View File

@ -474,6 +474,9 @@ endif
# define MAME_DEBUG if we are a debugging build
ifdef DEBUG
DEFS += -DMAME_DEBUG
ifdef FASTDEBUG
DEFS += -DMAME_DEBUG_FAST
endif
else
DEFS += -DNDEBUG
endif
@ -483,12 +486,10 @@ ifdef PROFILER
DEFS += -DMAME_PROFILER
endif
# dine USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled)
ifneq ($(TARGETOS),os2)
# define USE_NETWORK if networking is enabled (hasn't been disabled)
ifndef DONT_USE_NETWORK
DEFS += -DUSE_NETWORK
endif
endif
# need to ensure FLAC functions are statically linked
ifeq ($(BUILD_FLAC),1)
@ -500,10 +501,6 @@ ifneq ($(BUILD_JPEGLIB),1)
DEFS += -DUSE_SYSTEM_JPEGLIB
endif
ifdef FASTDEBUG
DEFS += -DMAME_DEBUG_FAST
endif
# To support casting in Lua 5.3
DEFS += -DLUA_COMPAT_APIINTCASTS

View File

@ -11,6 +11,7 @@
#include <string.h>
#include <ctype.h>
#include <zlib.h>
#include <assert.h>
#include "osdcore.h"
#include "astring.h"
#include "corefile.h"

View File

@ -11,6 +11,7 @@
#include <string.h>
#include <ctype.h>
#include <zlib.h>
#include <assert.h>
#include "osdcore.h"
#include "astring.h"
#include "corefile.h"

View File

@ -312,6 +312,7 @@ static const nes_pcb pcb_list[] =
{ "unl_dance", UNSUPPORTED_BOARD },
{ "bmc_hik_kof", UNSUPPORTED_BOARD },
{ "onebus", UNSUPPORTED_BOARD },
{ "coolboy", UNSUPPORTED_BOARD },
{ "a9746", UNSUPPORTED_BOARD },
{ "dance2k", UNSUPPORTED_BOARD },
{ "pec586", UNSUPPORTED_BOARD },

View File

@ -107,8 +107,9 @@ void h8_device::device_start()
}
save_item(NAME(PPC));
save_item(NAME(PC));
save_item(NAME(NPC));
save_item(NAME(PC));
save_item(NAME(PIR));
save_item(NAME(IR));
save_item(NAME(R));
save_item(NAME(EXR));

View File

@ -184,6 +184,9 @@ void hmcs40_cpu_device::device_start()
m_prgmask = (1 << m_prgwidth) - 1;
m_datamask = (1 << m_datawidth) - 1;
m_pcmask = (1 << m_pcwidth) - 1;
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hmcs40_cpu_device::simple_timer_cb), this));
reset_prescaler();
m_read_r0.resolve_safe(0);
m_read_r1.resolve_safe(0);
@ -210,6 +213,8 @@ void hmcs40_cpu_device::device_start()
memset(m_stack, 0, sizeof(m_stack));
m_op = 0;
m_prev_op = 0;
m_i = 0;
m_eint_line = 0;
m_pc = 0;
m_prev_pc = 0;
m_page = 0;
@ -221,6 +226,13 @@ void hmcs40_cpu_device::device_start()
m_spy = 0;
m_s = 1;
m_c = 0;
m_tc = 0;
m_cf = 0;
m_ie = 0;
m_iri = m_irt = 0;
memset(m_if, 0, sizeof(m_if));
m_tf = 0;
memset(m_int, 0, sizeof(m_int));
memset(m_r, 0, sizeof(m_r));
m_d = 0;
@ -228,6 +240,8 @@ void hmcs40_cpu_device::device_start()
save_item(NAME(m_stack));
save_item(NAME(m_op));
save_item(NAME(m_prev_op));
save_item(NAME(m_i));
save_item(NAME(m_eint_line));
save_item(NAME(m_pc));
save_item(NAME(m_prev_pc));
save_item(NAME(m_page));
@ -239,6 +253,15 @@ void hmcs40_cpu_device::device_start()
save_item(NAME(m_spy));
save_item(NAME(m_s));
save_item(NAME(m_c));
save_item(NAME(m_tc));
save_item(NAME(m_cf));
save_item(NAME(m_ie));
save_item(NAME(m_iri));
save_item(NAME(m_irt));
save_item(NAME(m_if));
save_item(NAME(m_tf));
save_item(NAME(m_int));
save_item(NAME(m_r));
save_item(NAME(m_d));
@ -275,6 +298,12 @@ void hmcs40_cpu_device::device_reset()
for (int i = 0; i < 8; i++)
hmcs40_cpu_device::write_r(i, 0);
// clear interrupts
m_cf = 0;
m_ie = 0;
m_iri = m_irt = 0;
m_if[0] = m_if[1] = m_tf = 1;
}
@ -286,7 +315,7 @@ void hmcs40_cpu_device::device_reset()
UINT8 hmcs40_cpu_device::read_r(int index)
{
index &= 7;
UINT8 inp = 0xf;
UINT8 inp = 0;
switch (index)
{
@ -347,7 +376,7 @@ UINT8 hmcs43_cpu_device::read_r(int index)
index &= 7;
if (index >= 2)
logerror("%s read from %s port R%d at $%04X\n", tag(), (index >= 4) ? "unknown" : "output", index, m_prev_pc << 1);
logerror("%s read from %s port R%d at $%04X\n", tag(), (index >= 4) ? "unknown" : "output", index, m_prev_pc);
return hmcs40_cpu_device::read_r(index);
}
@ -359,7 +388,7 @@ void hmcs43_cpu_device::write_r(int index, UINT8 data)
if (index != 0 && index < 4)
hmcs40_cpu_device::write_r(index, data);
else
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1);
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc);
}
int hmcs43_cpu_device::read_d(int index)
@ -367,7 +396,7 @@ int hmcs43_cpu_device::read_d(int index)
index &= 15;
if (index >= 4)
logerror("%s read from output pin D%d at $%04X\n", tag(), index, m_prev_pc << 1);
logerror("%s read from output pin D%d at $%04X\n", tag(), index, m_prev_pc);
return hmcs40_cpu_device::read_d(index);
}
@ -381,7 +410,7 @@ UINT8 hmcs44_cpu_device::read_r(int index)
index &= 7;
if (index >= 6)
logerror("%s read from unknown port R%d at $%04X\n", tag(), index, m_prev_pc << 1);
logerror("%s read from unknown port R%d at $%04X\n", tag(), index, m_prev_pc);
return hmcs40_cpu_device::read_r(index);
}
@ -393,7 +422,7 @@ void hmcs44_cpu_device::write_r(int index, UINT8 data)
if (index < 6)
hmcs40_cpu_device::write_r(index, data);
else
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1);
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc);
}
// HMCS45:
@ -405,7 +434,7 @@ UINT8 hmcs45_cpu_device::read_r(int index)
index &= 7;
if (index >= 6)
logerror("%s read from %s port R%d at $%04X\n", tag(), (index == 7) ? "unknown" : "output", index, m_prev_pc << 1);
logerror("%s read from %s port R%d at $%04X\n", tag(), (index == 7) ? "unknown" : "output", index, m_prev_pc);
return hmcs40_cpu_device::read_r(index);
}
@ -417,7 +446,86 @@ void hmcs45_cpu_device::write_r(int index, UINT8 data)
if (index != 7)
hmcs40_cpu_device::write_r(index, data);
else
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc << 1);
logerror("%s ineffective write to port R%d = $%X at $%04X\n", tag(), index, data & 0xf, m_prev_pc);
}
//-------------------------------------------------
// interrupt/timer handling
//-------------------------------------------------
void hmcs40_cpu_device::do_interrupt()
{
m_icount--;
push_stack();
m_ie = 0;
// line 0/1 for external interrupt, let's use 2 for t/c interrupt
int line = (m_iri) ? m_eint_line : 2;
// vector $3f, on page 0(timer/counter), or page 1(external)
// external interrupt has priority over t/c interrupt
m_pc = 0x3f | (m_iri ? 0x40 : 0);
if (m_iri)
m_iri = 0;
else
m_irt = 0;
standard_irq_callback(line);
}
void hmcs40_cpu_device::execute_set_input(int line, int state)
{
if (line != 0 && line != 1)
return;
state = (state) ? 1 : 0;
// external interrupt request on rising edge
if (state && !m_int[line])
{
if (!m_if[line])
{
m_eint_line = line;
m_iri = 1;
m_if[line] = 1;
}
// clock tc if it is in counter mode
if (m_cf && line == 1)
increment_tc();
}
m_int[line] = state;
}
void hmcs40_cpu_device::reset_prescaler()
{
// reset 6-bit timer prescaler
attotime base = attotime::from_hz(unscaled_clock() / 4 / 64);
m_timer->adjust(base);
}
TIMER_CALLBACK_MEMBER( hmcs40_cpu_device::simple_timer_cb )
{
// timer prescaler overflow
if (!m_cf)
increment_tc();
reset_prescaler();
}
void hmcs40_cpu_device::increment_tc()
{
// increment timer/counter
m_tc = (m_tc + 1) & 0xf;
// timer interrupt request on overflow
if (m_tc == 0 && !m_tf)
{
m_irt = 1;
m_tf = 1;
}
}
@ -449,7 +557,16 @@ void hmcs40_cpu_device::execute_run()
// LPU is handled 1 cycle later
if ((m_prev_op & 0x3e0) == 0x340)
{
if ((m_op & 0x1c0) != 0x1c0)
logerror("%s LPU without BR/CAL at $%04X\n", tag(), m_prev_pc);
m_pc = ((m_page << 6) | (m_pc & 0x3f)) & m_pcmask;
}
// check/handle interrupt, but not in the middle of a long jump
if (m_ie && (m_iri || m_irt) && (m_op & 0x3e0) != 0x340)
do_interrupt();
// remember previous state
m_prev_op = m_op;
@ -458,6 +575,7 @@ void hmcs40_cpu_device::execute_run()
// fetch next opcode
debugger_instruction_hook(this, m_pc);
m_op = m_program->read_word(m_pc << 1) & 0x3ff;
m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for 4-bit immediate param (except for XAMR, REDD, SEDD)
increment_pc();
// handle opcode
@ -470,20 +588,28 @@ void hmcs40_cpu_device::execute_run()
case 0x004: case 0x005: case 0x006: case 0x007:
op_sem(); break;
case 0x008: case 0x009: case 0x00a: case 0x00b:
/* ok */ op_lam(); break;
op_lam(); break;
case 0x010: case 0x011: case 0x012: case 0x013: case 0x014: case 0x015: case 0x016: case 0x017:
case 0x018: case 0x019: case 0x01a: case 0x01b: case 0x01c: case 0x01d: case 0x01e: case 0x01f:
/* ok */ op_lmiiy(); break;
op_lmiiy(); break;
case 0x020: case 0x021: case 0x022: case 0x023:
op_lbm(); break;
case 0x024:
op_blem(); break;
case 0x030:
op_amc(); break;
case 0x034:
op_am(); break;
case 0x03c:
op_lta(); break;
case 0x040:
/* ok */ op_lxa(); break;
case 0x04b:
op_lxa(); break;
case 0x045:
op_das(); break;
case 0x046:
op_daa(); break;
case 0x04c:
op_rec(); break;
case 0x04f:
op_sec(); break;
@ -491,21 +617,23 @@ void hmcs40_cpu_device::execute_run()
op_lya(); break;
case 0x054:
op_iy(); break;
case 0x058:
op_ayy(); break;
case 0x060:
op_lba(); break;
case 0x064:
op_ib(); break;
case 0x070: case 0x071: case 0x072: case 0x073: case 0x074: case 0x075: case 0x076: case 0x077:
case 0x078: case 0x079: case 0x07a: case 0x07b: case 0x07c: case 0x07d: case 0x07e: case 0x07f:
/* ok */ op_lai(); break;
op_lai(); break;
case 0x080: case 0x081: case 0x082: case 0x083: case 0x084: case 0x085: case 0x086: case 0x087:
case 0x088: case 0x089: case 0x08a: case 0x08b: case 0x08c: case 0x08d: case 0x08e: case 0x08f:
/* ok */ op_ai(); break;
op_ai(); break;
case 0x090:
/* ok */ op_sed(); break;
op_sed(); break;
case 0x094:
/* ok */ op_td(); break;
op_td(); break;
case 0x0a0:
op_seif1(); break;
case 0x0a1:
@ -535,18 +663,22 @@ void hmcs40_cpu_device::execute_run()
op_lmaiy(); break;
case 0x114: case 0x115:
op_lmady(); break;
case 0x118:
op_lay(); break;
case 0x120:
op_or(); break;
case 0x124:
op_anem(); break;
case 0x140: case 0x141: case 0x142: case 0x143: case 0x144: case 0x145: case 0x146: case 0x147:
case 0x148: case 0x149: case 0x14a: case 0x14b: case 0x14c: case 0x14d: case 0x14e: case 0x14f:
/* ok */ op_lxi(); break;
op_lxi(); break;
case 0x150: case 0x151: case 0x152: case 0x153: case 0x154: case 0x155: case 0x156: case 0x157:
case 0x158: case 0x159: case 0x15a: case 0x15b: case 0x15c: case 0x15d: case 0x15e: case 0x15f:
/* ok */ op_lyi(); break;
op_lyi(); break;
case 0x160: case 0x161: case 0x162: case 0x163: case 0x164: case 0x165: case 0x166: case 0x167:
case 0x168: case 0x169: case 0x16a: case 0x16b: case 0x16c: case 0x16d: case 0x16e: case 0x16f:
/* ok */ op_lbi(); break;
op_lbi(); break;
case 0x170: case 0x171: case 0x172: case 0x173: case 0x174: case 0x175: case 0x176: case 0x177:
case 0x178: case 0x179: case 0x17a: case 0x17b: case 0x17c: case 0x17d: case 0x17e: case 0x17f:
op_lti(); break;
@ -570,7 +702,7 @@ void hmcs40_cpu_device::execute_run()
case 0x1e8: case 0x1e9: case 0x1ea: case 0x1eb: case 0x1ec: case 0x1ed: case 0x1ee: case 0x1ef:
case 0x1f0: case 0x1f1: case 0x1f2: case 0x1f3: case 0x1f4: case 0x1f5: case 0x1f6: case 0x1f7:
case 0x1f8: case 0x1f9: case 0x1fa: case 0x1fb: case 0x1fc: case 0x1fd: case 0x1fe: case 0x1ff:
/* ok */ op_br(); break;
op_br(); break;
/* 0x200 */
@ -585,27 +717,33 @@ void hmcs40_cpu_device::execute_run()
case 0x218: case 0x219: case 0x21a: case 0x21b: case 0x21c: case 0x21d: case 0x21e: case 0x21f:
op_mnei(); break;
case 0x220: case 0x221: case 0x222: case 0x223:
/* ok */ op_xmb(); break;
op_xmb(); break;
case 0x224:
op_rotr(); break;
case 0x225:
op_rotl(); break;
case 0x230:
op_smc(); break;
case 0x234:
op_alem(); break;
case 0x23c:
op_lat(); break;
case 0x240:
op_laspx(); break;
case 0x244:
op_nega(); break;
case 0x24f:
op_tc(); break;
case 0x250:
op_laspy(); break;
case 0x254:
op_dy(); break;
case 0x258:
op_syy(); break;
case 0x260:
op_lab(); break;
case 0x264:
case 0x267:
op_db(); break;
case 0x270: case 0x271: case 0x272: case 0x273: case 0x274: case 0x275: case 0x276: case 0x277:
case 0x278: case 0x279: case 0x27a: case 0x27b: case 0x27c: case 0x27d: case 0x27e: case 0x27f:
@ -615,7 +753,7 @@ void hmcs40_cpu_device::execute_run()
case 0x288: case 0x289: case 0x28a: case 0x28b: case 0x28c: case 0x28d: case 0x28e: case 0x28f:
op_ynei(); break;
case 0x290:
/* ok */ op_red(); break;
op_red(); break;
case 0x2a0:
op_reif1(); break;
case 0x2a1:
@ -628,7 +766,7 @@ void hmcs40_cpu_device::execute_run()
op_retf(); break;
case 0x2c0: case 0x2c1: case 0x2c2: case 0x2c3: case 0x2c4: case 0x2c5: case 0x2c6: case 0x2c7:
/* ok */ op_lra(); break;
op_lra(); break;
case 0x2d0: case 0x2d1: case 0x2d2: case 0x2d3: case 0x2d4: case 0x2d5: case 0x2d6: case 0x2d7:
case 0x2d8: case 0x2d9: case 0x2da: case 0x2db: case 0x2dc: case 0x2dd: case 0x2de: case 0x2df:
op_redd(); break;
@ -639,21 +777,23 @@ void hmcs40_cpu_device::execute_run()
/* 0x300 */
case 0x320:
op_comb(); break;
case 0x324:
op_bnem(); break;
case 0x340: case 0x341: case 0x342: case 0x343: case 0x344: case 0x345: case 0x346: case 0x347:
case 0x348: case 0x349: case 0x34a: case 0x34b: case 0x34c: case 0x34d: case 0x34e: case 0x34f:
case 0x350: case 0x351: case 0x352: case 0x353: case 0x354: case 0x355: case 0x356: case 0x357:
case 0x358: case 0x359: case 0x35a: case 0x35b: case 0x35c: case 0x35d: case 0x35e: case 0x35f:
/* ok */ op_lpu(); break;
op_lpu(); break;
case 0x360: case 0x361: case 0x362: case 0x363: case 0x364: case 0x365: case 0x366: case 0x367:
op_tbr(); break;
case 0x368: case 0x369: case 0x36a: case 0x36b: case 0x36c: case 0x36d: case 0x36e: case 0x36f:
/* ok */ op_p(); break;
op_p(); break;
case 0x3a4:
op_rtni(); break;
case 0x3a7:
/* ok */ op_rtn(); break;
op_rtn(); break;
case 0x3c0: case 0x3c1: case 0x3c2: case 0x3c3: case 0x3c4: case 0x3c5: case 0x3c6: case 0x3c7:
case 0x3c8: case 0x3c9: case 0x3ca: case 0x3cb: case 0x3cc: case 0x3cd: case 0x3ce: case 0x3cf:
@ -663,7 +803,7 @@ void hmcs40_cpu_device::execute_run()
case 0x3e8: case 0x3e9: case 0x3ea: case 0x3eb: case 0x3ec: case 0x3ed: case 0x3ee: case 0x3ef:
case 0x3f0: case 0x3f1: case 0x3f2: case 0x3f3: case 0x3f4: case 0x3f5: case 0x3f6: case 0x3f7:
case 0x3f8: case 0x3f9: case 0x3fa: case 0x3fb: case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff:
/* ok */ op_cal(); break;
op_cal(); break;
default:

View File

@ -27,6 +27,74 @@
hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
enum
{
HMCS40_PORT_R0X = 0,
HMCS40_PORT_R1X,
HMCS40_PORT_R2X,
HMCS40_PORT_R3X,
HMCS40_PORT_R4X,
HMCS40_PORT_R5X,
HMCS40_PORT_R6X,
HMCS40_PORT_R7X
};
// pinout reference
/*
_________________
D3 1 |* | 42 D2
D4 2 | | 41 D1
D5 3 | | 40 D0
D6 4 | | 39 R33
D7 5 | | 38 R32
D8 6 | | 37 R31
D9 7 | | 36 R30
D10 8 | | 35 R23 .......................................
D11 9 | | 34 R22 :
D12 10 | HD38750 | 33 R21 :
D13 11 | HD38800 | 32 R20 :
D14 12 | | 31 INT1 :
D15 13 | | 30 INT0 : _________________
Vdisp 14 | | 29 R13 : D4 1 |* | 64 D3
RESET 15 | | 28 R12 : D5 2 | | 63 D2
Vbb 16 | | 27 R11 : D6 3 | | 62 D1
Vdd 17 | | 26 R10 : D7 4 | | 61 D0
OSC 18 | | 25 R03 : D8 5 | | 60 R63
<NC> 19 | | 24 R02 : D9 6 | | 59 R62
/TEST 20 | | 23 R01 : <NC> 7 | | 58 <NC>
Vss 21 |_________________| 22 R00 : <NC> 8 | | 57 <NC>
<NC> 9 | | 56 <NC>
D10 10 | | 55 R61
D8 D7 D6 D5 D4 <NC>D3 D2 D1 D0 D11 11 | | 54 R60
5 4 3 2 1 54 53 52 51 50 D12 12 | | 53 R33
__________________________________ D13 13 | | 52 R32
/ | D14 14 | | 51 R31
D9 6 | | 49 R63 D15 15 | | 50 R30
D10 7 | | 48 R62 R40 16 | | 49 R23
D11 8 | | 47 R61 R41 17 | | 48 R22
D12 9 | | 46 R60 R42 18 | | 47 R21
D13 10 | | 45 R33 R43 19 | | 46 R20
D14 11 | | 44 R32 R50 20 | | 45 INT1
D15 12 | | 43 R31 R51 21 | | 44 INT0
R40 13 | HD38820 | 42 R30 R52 22 | HD38820 | 43 R13
R41 14 | (FP-54 pkg) | 41 R23 R53 23 | (DP-64S pkg) | 42 R12
R42 15 | | 40 R22 Vdisp 24 | | 41 <NC>
R43 16 | | 39 R21 <NC> 25 | | 40 <NC>
R50 17 | | 38 R20 RESET 26 | | 39 <NC>
R51 18 | | 37 INT1 Vbb 27 | | 38 R11
R52 19 | | 36 INT0 Vdd 28 | | 37 R10
R53 20 | | 35 R13 OSC 29 | | 36 R03
Vdisp 21 | | 34 R12 <NC> 30 | | 35 R02
RESET 22 | | 33 R11 /TEST 31 | | 34 R01
|__________________________________| Vss 32 |_________________| 33 R00
23 24 25 26 27 28 29 30 31 32
Vbb | OSC | Vss R00 | R02 | R10
Vdd /TEST R01 R03
*/
class hmcs40_cpu_device : public cpu_device
{
@ -76,9 +144,12 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 4); } // "
virtual UINT32 execute_min_cycles() const { return 1; }
virtual UINT32 execute_max_cycles() const { return 2; }
virtual UINT32 execute_input_lines() const { return 1; }
virtual UINT32 execute_input_lines() const { return 2+1; } // 3rd one is internal
virtual void execute_set_input(int line, int state);
virtual void execute_run();
// device_memory_interface overrides
@ -86,7 +157,7 @@ protected:
// device_disasm_interface overrides
virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
virtual UINT32 disasm_max_opcode_bytes() const { return 2+1; }
virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
void state_string_export(const device_state_entry &entry, astring &string);
@ -107,6 +178,9 @@ protected:
UINT16 m_stack[4]; // max 4
UINT16 m_op; // current opcode
UINT16 m_prev_op;
UINT8 m_i; // 4-bit immediate opcode param
int m_eint_line; // which input_line caused an interrupt
emu_timer *m_timer;
int m_icount;
UINT16 m_pc; // Program Counter
@ -118,8 +192,16 @@ protected:
UINT8 m_spx; // 1/3/4-bit SPX register
UINT8 m_y; // 4-bit Y register
UINT8 m_spy; // 4-bit SPY register
UINT8 m_s; // Status F/F
UINT8 m_s; // Status F/F (F/F = flip-flop)
UINT8 m_c; // Carry F/F
UINT8 m_tc; // Timer/Counter
UINT8 m_cf; // CF F/F (timer mode or counter mode)
UINT8 m_ie; // I/E(Interrupt Enable) F/F
UINT8 m_iri; // external interrupt pending I/RI F/F
UINT8 m_irt; // timer interrupt pending I/RT F/F
UINT8 m_if[2]; // external interrupt mask IF0,1 F/F
UINT8 m_tf; // timer interrupt mask TF F/F
UINT8 m_int[2]; // INT0/1 pins state
UINT8 m_r[8]; // R outputs state
UINT16 m_d; // D pins state
@ -142,6 +224,11 @@ protected:
virtual int read_d(int index);
virtual void write_d(int index, int state);
void reset_prescaler();
TIMER_CALLBACK_MEMBER( simple_timer_cb );
void increment_tc();
void do_interrupt();
// opcode handlers
void op_illegal();

View File

@ -3,6 +3,8 @@
/*
Hitachi HMCS40 MCU family disassembler
NOTE: start offset(basepc) is $3F, not 0
*/
@ -41,18 +43,18 @@ static const char *const s_mnemonics[] =
"NOP", "?"
};
// number of bits per opcode parameter, -3 means (XY) parameter
// number of bits per opcode parameter, 99 means (XY) parameter, negative means reversed bit-order
static const INT8 s_bits[] =
{
0, 0, 0, 0, 0, 4,
0, 0, 4, 4, 0, 0, 0, 0, -3,
-3, -3, -3, -3, -3, -3,
4, 4, 4,
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4, 4, 0, 0, 4, 0, 0,
0, 0, -4, -4, 0, 0, 0, 0, 99,
99, 99, 99, 99, 99, 99,
-4, -4, -4,
-4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-4, -4, 0, 0, -4, 0, 0,
2, 2, 2,
6, 6, 5, 3, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 0,
0, 0, 0, 4, 4, 3, 3, 3, 3, 3,
0, 0
};
@ -85,96 +87,98 @@ static const INT16 s_next_pc[0x40] =
};
#define m mILL
static const UINT8 hmcs40_mnemonic[0x400] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x000 */
mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, mILL, mILL, mILL, mILL,
mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY, mLMIIY,
mLBM, mLBM, mLBM, mLBM, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mAMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLTA, mILL, mILL, mILL,
mNOP, mXSP, mXSP, mXSP, mSEM, mSEM, mSEM, mSEM, mLAM, mLAM, mLAM, mLAM, m, m, m, m,
mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,mLMIIY,
mLBM, mLBM, mLBM, mLBM, mBLEM, m, m, m, m, m, m, m, m, m, m, m,
mAMC, m, m, m, mAM, m, m, m, m, m, m, m, mLTA, m, m, m,
/* 0x040 */
mLXA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mREC, mILL, mILL, mILL, mSEC,
mLYA, mILL, mILL, mILL, mIY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLBA, mILL, mILL, mILL, mIB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI,
mLXA, m, m, m, m, mDAS, mDAA, m, m, m, m, m, mREC, m, m, mSEC,
mLYA, m, m, m, mIY, m, m, m, mAYY, m, m, m, m, m, m, m,
mLBA, m, m, m, mIB, m, m, m, m, m, m, m, m, m, m, m,
mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI, mLAI,
/* 0x080 */
mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI,
mSED, mILL, mILL, mILL, mTD, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mSEIF1, mSECF, mSEIF0, mILL, mSEIE, mSETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI, mAI,
mSED, m, m, m, mTD, m, m, m, m, m, m, m, m, m, m, m,
mSEIF1,mSECF, mSEIF0,m, mSEIE, mSETF, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x0c0 */
mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD,
mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR,
mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, mLAR, m, m, m, m, m, m, m, m,
mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD, mSEDD,
mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, mLBR, m, m, m, m, m, m, m, m,
mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR, mXAMR,
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x100 */
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLMAIY, mLMAIY, mILL, mILL, mLMADY, mLMADY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mOR, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
mLMAIY,mLMAIY,m, m, mLMADY,mLMADY,m, m, mLAY, m, m, m, m, m, m, m,
mOR, m, m, m, mANEM, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x140 */
mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI,
mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI,
mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI,
mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI,
mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI, mLXI,
mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI, mLYI,
mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI, mLBI,
mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI, mLTI,
/* 0x180 */
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mTIF1, mTI1, mTIF0, mTI0, mILL, mTTF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
mTIF1, mTI1, mTIF0, mTI0, m, mTTF, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x1c0 */
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR, mBR,
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x200 */
mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, mILL, mILL, mILL, mILL,
mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI,
mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mSMC, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mLAT, mILL, mILL, mILL,
mTM, mTM, mTM, mTM, mREM, mREM, mREM, mREM, mXMA, mXMA, mXMA, mXMA, m, m, m, m,
mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI, mMNEI,
mXMB, mXMB, mXMB, mXMB, mROTR, mROTL, m, m, m, m, m, m, m, m, m, m,
mSMC, m, m, m, mALEM, m, m, m, m, m, m, m, mLAT, m, m, m,
/* 0x240 */
mLASPX, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mTC,
mLASPY, mILL, mILL, mILL, mDY, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLAB, mILL, mILL, mILL, mDB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI,
mLASPX,m, m, m, mNEGA, m, m, m, m, m, m, m, m, m, m, mTC,
mLASPY,m, m, m, mDY, m, m, m, mSYY, m, m, m, m, m, m, m,
mLAB, m, m, m, m, m, m, mDB, m, m, m, m, m, m, m, m,
mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI, mALEI,
/* 0x280 */
mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI,
mRED, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mREIF1, mRECF, mREIF0, mILL, mREIE, mRETF, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI, mYNEI,
mRED, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
mREIF1,mRECF, mREIF0,m, mREIE, mRETF, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x2c0 */
mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD,
mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, mLRA, m, m, m, m, m, m, m, m,
mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD, mREDD,
mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, mLRB, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x300 */
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mCOMB, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
mCOMB, m, m, m, mBNEM, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x340 */
mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU,
mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU,
mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mP, mP, mP, mP, mP, mP, mP, mP,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU,
mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU, mLPU,
mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mTBR, mP, mP, mP, mP, mP, mP, mP, mP,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x380 */
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mRTNI, mILL, mILL, mRTN, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL, mILL,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
m, m, m, m, mRTNI, m, m, mRTN, m, m, m, m, m, m, m, m,
m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m,
/* 0x3c0 */
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL,
mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL, mCAL
};
#undef m
@ -186,7 +190,7 @@ CPU_DISASSEMBLE(hmcs40)
INT8 bits = s_bits[instr];
// special case for (XY) opcode
if (bits == -3)
if (bits == 99)
{
dst += sprintf(dst, "%s", s_mnemonics[instr]);
@ -196,17 +200,29 @@ CPU_DISASSEMBLE(hmcs40)
dst += sprintf(dst, "Y");
}
else
{
dst += sprintf(dst, "%-6s ", s_mnemonics[instr]);
// opcode parameter
if (bits > 0)
{
UINT8 param = op & ((1 << bits) - 1);
if (bits > 5)
dst += sprintf(dst, "$%02X", param);
else
dst += sprintf(dst, "%d", param);
// opcode parameter
if (bits != 0)
{
UINT8 param = op;
// reverse bits
if (bits < 0)
{
param = BITSWAP8(param,0,1,2,3,4,5,6,7);
param >>= (8 + bits);
bits = -bits;
}
param &= ((1 << bits) - 1);
if (bits > 5)
dst += sprintf(dst, "$%02X", param);
else
dst += sprintf(dst, "%d", param);
}
}
int pos = s_next_pc[pc & 0x3f] & DASMFLAG_LENGTHMASK;

View File

@ -34,7 +34,7 @@ void hmcs40_cpu_device::push_stack()
void hmcs40_cpu_device::op_illegal()
{
logerror("%s unknown opcode $%03X at $%04X\n", tag(), m_op, m_prev_pc << 1);
logerror("%s unknown opcode $%03X at $%04X\n", tag(), m_op, m_prev_pc);
}
@ -110,13 +110,13 @@ void hmcs40_cpu_device::op_lya()
void hmcs40_cpu_device::op_lxi()
{
// LXI i: Load X from Immediate
m_x = m_op & 0xf;
m_x = m_i;
}
void hmcs40_cpu_device::op_lyi()
{
// LYI i: Load Y from Immediate
m_y = m_op & 0xf;
m_y = m_i;
}
void hmcs40_cpu_device::op_iy()
@ -223,20 +223,20 @@ void hmcs40_cpu_device::op_lmady()
void hmcs40_cpu_device::op_lmiiy()
{
// LMIIY i: Load Memory from Immediate, Increment Y
ram_w(m_op & 0xf);
ram_w(m_i);
op_iy();
}
void hmcs40_cpu_device::op_lai()
{
// LAI i: Load A from Immediate
m_a = m_op & 0xf;
m_a = m_i;
}
void hmcs40_cpu_device::op_lbi()
{
// LBI i: Load B from Immediate
m_b = m_op & 0xf;
m_b = m_i;
}
@ -245,7 +245,7 @@ void hmcs40_cpu_device::op_lbi()
void hmcs40_cpu_device::op_ai()
{
// AI i: Add Immediate to A
m_a += (m_op & 0xf);
m_a += (m_i);
m_s = m_a >> 4 & 1;
m_a &= 0xf;
}
@ -368,13 +368,13 @@ void hmcs40_cpu_device::op_or()
void hmcs40_cpu_device::op_mnei()
{
// MNEI i: Memory Not Equal to Immediate
m_s = (ram_r() != (m_op & 0xf));
m_s = (ram_r() != (m_i));
}
void hmcs40_cpu_device::op_ynei()
{
// YNEI i: Y Not Equal to Immediate
m_s = (m_y != (m_op & 0xf));
m_s = (m_y != (m_i));
}
void hmcs40_cpu_device::op_anem()
@ -392,7 +392,7 @@ void hmcs40_cpu_device::op_bnem()
void hmcs40_cpu_device::op_alei()
{
// ALEI i: A Less or Equal to Immediate
m_s = (m_a <= (m_op & 0xf));
m_s = (m_a <= (m_i));
}
void hmcs40_cpu_device::op_alem()
@ -458,7 +458,7 @@ void hmcs40_cpu_device::op_lpu()
if (m_s)
m_page = m_op & 0x1f;
else
m_op = 0;
m_op = 0; // fake nop
}
void hmcs40_cpu_device::op_tbr()
@ -480,115 +480,118 @@ void hmcs40_cpu_device::op_rtn()
void hmcs40_cpu_device::op_seie()
{
// SEIE: Set I/E
op_illegal();
m_ie = 1;
}
void hmcs40_cpu_device::op_seif0()
{
// SEIF0: Set IF0
op_illegal();
m_if[0] = 1;
}
void hmcs40_cpu_device::op_seif1()
{
// SEIF1: Set IF1
op_illegal();
m_if[1] = 1;
}
void hmcs40_cpu_device::op_setf()
{
// SETF: Set TF
op_illegal();
m_tf = 1;
}
void hmcs40_cpu_device::op_secf()
{
// SECF: Set CF
op_illegal();
m_cf = 1;
}
void hmcs40_cpu_device::op_reie()
{
// REIE: Reset I/E
op_illegal();
m_ie = 0;
}
void hmcs40_cpu_device::op_reif0()
{
// REIF0: Reset IF0
op_illegal();
m_if[0] = 0;
}
void hmcs40_cpu_device::op_reif1()
{
// REIF1: Reset IF1
op_illegal();
m_if[1] = 0;
}
void hmcs40_cpu_device::op_retf()
{
// RETF: Reset TF
op_illegal();
m_tf = 0;
}
void hmcs40_cpu_device::op_recf()
{
// RECF: Reset CF
op_illegal();
m_cf = 0;
}
void hmcs40_cpu_device::op_ti0()
{
// TI0: Test INT0
op_illegal();
m_s = m_int[0];
}
void hmcs40_cpu_device::op_ti1()
{
// TI1: Test INT1
op_illegal();
m_s = m_int[1];
}
void hmcs40_cpu_device::op_tif0()
{
// TIF0: Test IF0
op_illegal();
m_s = m_if[0];
}
void hmcs40_cpu_device::op_tif1()
{
// TIF1: Test IF1
op_illegal();
m_s = m_if[1];
}
void hmcs40_cpu_device::op_ttf()
{
// TTF: Test TF
op_illegal();
m_s = m_tf;
}
void hmcs40_cpu_device::op_lti()
{
// LTI i: Load Timer/Counter from Immediate
op_illegal();
m_tc = m_i;
reset_prescaler();
}
void hmcs40_cpu_device::op_lta()
{
// LTA: Load Timer/Counter from A
op_illegal();
m_tc = m_a;
reset_prescaler();
}
void hmcs40_cpu_device::op_lat()
{
// LAT: Load A from Timer/Counter
op_illegal();
m_a = m_tc;
}
void hmcs40_cpu_device::op_rtni()
{
// RTNI: Return from Interrupt
op_illegal();
op_seie();
op_rtn();
}
@ -659,13 +662,13 @@ void hmcs40_cpu_device::op_p()
if (o & 0x100)
{
// B3 B2 B1 B0 A0 A1 A2 A3
m_a = BITSWAP8((UINT8)o,7,6,5,4,0,1,2,3) & 0xf;
m_a = BITSWAP8(o,7,6,5,4,0,1,2,3) & 0xf;
m_b = o >> 4 & 0xf;
}
if (o & 0x200)
{
// R20 R21 R22 R23 R30 R31 R32 R33
o = BITSWAP8((UINT8)o,0,1,2,3,4,5,6,7);
o = BITSWAP8(o,0,1,2,3,4,5,6,7);
write_r(2, o & 0xf);
write_r(3, o >> 4 & 0xf);
}

View File

@ -962,6 +962,7 @@ struct I386_CALL_GATE
void pentium_cmovg_r32_rm32();
void pentium_movnti_m16_r16();
void pentium_movnti_m32_r32();
void i386_cyrix_special();
void i386_cyrix_unknown();
void pentium_cmpxchg8b_m64();
void pentium_movntq_m64_r64();
@ -1004,6 +1005,12 @@ struct I386_CALL_GATE
void mmx_paddw_r64_rm64();
void mmx_paddd_r64_rm64();
void mmx_emms();
void i386_cyrix_svdc();
void i386_cyrix_rsdc();
void i386_cyrix_svldt();
void i386_cyrix_rsldt();
void i386_cyrix_svts();
void i386_cyrix_rsts();
void mmx_movd_r64_rm32();
void mmx_movq_r64_rm64();
void mmx_movd_rm32_r64();

View File

@ -329,6 +329,10 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] =
{ 0x32, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_rdmsr, &i386_device::pentium_rdmsr, false},
{ 0x38, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte38, &i386_device::i386_decode_three_byte38,false},
{ 0x3A, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte3a, &i386_device::i386_decode_three_byte3a,false},
{ 0x3A, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false},
{ 0x3B, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false},
{ 0x3C, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false},
{ 0x3D, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false},
{ 0x40, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovo_r16_rm16, &i386_device::pentium_cmovo_r32_rm32, false},
{ 0x41, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovno_r16_rm16, &i386_device::pentium_cmovno_r32_rm32, false},
{ 0x42, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovb_r16_rm16, &i386_device::pentium_cmovb_r32_rm32, false},
@ -384,6 +388,12 @@ const i386_device::X86_OPCODE i386_device::s_x86_opcode_table[] =
{ 0x75, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqw_r64_rm64, &i386_device::mmx_pcmpeqw_r64_rm64, false},
{ 0x76, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqd_r64_rm64, &i386_device::mmx_pcmpeqd_r64_rm64, false},
{ 0x77, OP_2BYTE|OP_MMX, &i386_device::mmx_emms, &i386_device::mmx_emms, false},
{ 0x78, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svdc, &i386_device::i386_cyrix_svdc, false},
{ 0x79, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsdc, &i386_device::i386_cyrix_rsdc, false},
{ 0x7a, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svldt, &i386_device::i386_cyrix_svldt, false},
{ 0x7b, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsldt, &i386_device::i386_cyrix_rsldt, false},
{ 0x7c, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svts, &i386_device::i386_cyrix_svts, false},
{ 0x7d, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsts, &i386_device::i386_cyrix_rsts, false},
{ 0x7e, OP_2BYTE|OP_MMX, &i386_device::mmx_movd_rm32_r64, &i386_device::mmx_movd_rm32_r64, false},
{ 0x7f, OP_2BYTE|OP_MMX, &i386_device::mmx_movq_rm64_r64, &i386_device::mmx_movq_rm64_r64, false},
{ 0x80, OP_2BYTE|OP_I386, &i386_device::i386_jo_rel16, &i386_device::i386_jo_rel32, false},

View File

@ -1062,6 +1062,18 @@ void i386_device::pentium_movnti_m32_r32() // Opcode 0f c3
}
}
void i386_device::i386_cyrix_special() // Opcode 0x0f 3a-3d
{
/*
0f 3a BB0_RESET (set BB0 pointer = base)
0f 3b BB1_RESET (set BB1 pointer = base)
0f 3c CPU_WRITE (write special CPU memory-mapped register, [ebx] = eax)
0f 3d CPU_READ (read special CPU memory-mapped register, eax, = [ebx])
*/
CYCLES(1);
}
void i386_device::i386_cyrix_unknown() // Opcode 0x0f 74
{
logerror("Unemulated 0x0f 0x74 opcode called\n");
@ -1970,6 +1982,262 @@ void i386_device::mmx_emms() // Opcode 0f 77
CYCLES(1); // TODO: correct cycle count
}
void i386_device::i386_cyrix_svdc() // Opcode 0f 78
{
UINT8 modrm = FETCH();
if( modrm < 0xc0 ) {
UINT32 ea = GetEA(modrm,0);
int index = (modrm >> 3) & 7;
int limit;
switch (index)
{
case 0:
{
index = ES;
break;
}
case 2:
{
index = SS;
break;
}
case 3:
{
index = DS;
break;
}
case 4:
{
index = FS;
break;
}
case 5:
{
index = GS;
break;
}
default:
{
i386_trap(6, 0, 0);
}
}
limit = m_sreg[index].limit;
if (m_sreg[index].flags & 0x8000) //G bit
{
limit >>= 12;
}
WRITE16(ea + 0, limit);
WRITE32(ea + 2, m_sreg[index].base);
WRITE16(ea + 5, m_sreg[index].flags); //replace top 8 bits of base
WRITE8(ea + 7, m_sreg[index].base >> 24);
WRITE16(ea + 8, m_sreg[index].selector);
} else {
i386_trap(6, 0, 0);
}
CYCLES(1); // TODO: correct cycle count
}
void i386_device::i386_cyrix_rsdc() // Opcode 0f 79
{
UINT8 modrm = FETCH();
if( modrm < 0xc0 ) {
UINT32 ea = GetEA(modrm,0);
int index = (modrm >> 3) & 7;
UINT16 flags;
UINT32 base;
UINT32 limit;
switch (index)
{
case 0:
{
index = ES;
break;
}
case 2:
{
index = SS;
break;
}
case 3:
{
index = DS;
break;
}
case 4:
{
index = FS;
break;
}
case 5:
{
index = GS;
break;
}
default:
{
i386_trap(6, 0, 0);
}
}
base = (READ32(ea + 2) & 0x00ffffff) | (READ8(ea + 7) << 24);
flags = READ16(ea + 5);
limit = READ16(ea + 0) | ((flags & 3) << 16);
if (flags & 0x8000) //G bit
{
limit = (limit << 12) | 0xfff;
}
m_sreg[index].selector = READ16(ea + 8);
m_sreg[index].flags = flags;
m_sreg[index].base = base;
m_sreg[index].limit = limit;
} else {
i386_trap(6, 0, 0);
}
CYCLES(1); // TODO: correct cycle count
}
void i386_device::i386_cyrix_svldt() // Opcode 0f 7a
{
if ( PROTECTED_MODE && !V8086_MODE )
{
UINT8 modrm = FETCH();
if( !(modrm & 0xf8) ) {
UINT32 ea = GetEA(modrm,0);
UINT32 limit = m_ldtr.limit;
if (m_ldtr.flags & 0x8000) //G bit
{
limit >>= 12;
}
WRITE16(ea + 0, limit);
WRITE32(ea + 2, m_ldtr.base);
WRITE16(ea + 5, m_ldtr.flags); //replace top 8 bits of base
WRITE8(ea + 7, m_ldtr.base >> 24);
WRITE16(ea + 8, m_ldtr.segment);
} else {
i386_trap(6, 0, 0);
}
} else {
i386_trap(6, 0, 0);
}
CYCLES(1); // TODO: correct cycle count
}
void i386_device::i386_cyrix_rsldt() // Opcode 0f 7b
{
if ( PROTECTED_MODE && !V8086_MODE )
{
if(m_CPL)
FAULT(FAULT_GP,0)
UINT8 modrm = FETCH();
if( !(modrm & 0xf8) ) {
UINT32 ea = GetEA(modrm,0);
UINT16 flags = READ16(ea + 5);
UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24);
UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16);
I386_SREG seg;
if (flags & 0x8000) //G bit
{
limit = (limit << 12) | 0xfff;
}
memset(&seg, 0, sizeof(seg));
seg.selector = READ16(ea + 8);
i386_load_protected_mode_segment(&seg,NULL);
m_ldtr.limit = limit;
m_ldtr.base = base;
m_ldtr.flags = flags;
} else {
i386_trap(6, 0, 0);
}
} else {
i386_trap(6, 0, 0);
}
CYCLES(1); // TODO: correct cycle count
}
void i386_device::i386_cyrix_svts() // Opcode 0f 7c
{
if ( PROTECTED_MODE )
{
UINT8 modrm = FETCH();
if( !(modrm & 0xf8) ) {
UINT32 ea = GetEA(modrm,0);
UINT32 limit = m_task.limit;
if (m_task.flags & 0x8000) //G bit
{
limit >>= 12;
}
WRITE16(ea + 0, limit);
WRITE32(ea + 2, m_task.base);
WRITE16(ea + 5, m_task.flags); //replace top 8 bits of base
WRITE8(ea + 7, m_task.base >> 24);
WRITE16(ea + 8, m_task.segment);
} else {
i386_trap(6, 0, 0);
}
} else {
i386_trap(6, 0, 0);
}
}
void i386_device::i386_cyrix_rsts() // Opcode 0f 7d
{
if ( PROTECTED_MODE )
{
if(m_CPL)
FAULT(FAULT_GP,0)
UINT8 modrm = FETCH();
if( !(modrm & 0xf8) ) {
UINT32 ea = GetEA(modrm,0);
UINT16 flags = READ16(ea + 5);
UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24);
UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16);
if (flags & 0x8000) //G bit
{
limit = (limit << 12) | 0xfff;
}
m_task.segment = READ16(ea + 8);
m_task.limit = limit;
m_task.base = base;
m_task.flags = flags;
} else {
i386_trap(6, 0, 0);
}
} else {
i386_trap(6, 0, 0);
}
CYCLES(1); // TODO: correct cycle count
}
void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e
{
MMXPROLOG();

View File

@ -2185,13 +2185,41 @@ void i386_device::x87_fprem(UINT8 modrm)
}
else
{
floatx80 a = ST(0);
floatx80 b = ST(1);
floatx80 a0 = ST(0);
floatx80 b1 = ST(1);
m_x87_sw &= ~X87_SW_C2;
// TODO: Implement Cx bits
result = floatx80_rem(a, b);
//int d=extractFloatx80Exp(a0)-extractFloatx80Exp(b1);
int d = (a0.high & 0x7FFF) - (b1.high & 0x7FFF);
if (d < 64) {
floatx80 t=floatx80_div(a0, b1);
int64 q = floatx80_to_int64_round_to_zero(t);
floatx80 qf = int64_to_floatx80(q);
floatx80 tt = floatx80_mul(b1, qf);
result = floatx80_sub(a0, tt);
// C2 already 0
m_x87_sw &= ~(X87_SW_C0|X87_SW_C3|X87_SW_C1);
if (q & 1)
m_x87_sw |= X87_SW_C1;
if (q & 2)
m_x87_sw |= X87_SW_C3;
if (q & 4)
m_x87_sw |= X87_SW_C0;
}
else {
m_x87_sw |= X87_SW_C2;
int n = 63;
int e = 1 << (d - n);
floatx80 ef = int32_to_floatx80(e);
floatx80 t=floatx80_div(a0, b1);
floatx80 td = floatx80_div(t, ef);
int64 qq = floatx80_to_int64_round_to_zero(td);
floatx80 qqf = int64_to_floatx80(qq);
floatx80 tt = floatx80_mul(b1, qqf);
floatx80 ttt = floatx80_mul(tt, ef);
result = floatx80_sub(a0, ttt);
}
}
if (x87_check_exceptions())
@ -2411,7 +2439,7 @@ void i386_device::x87_fpatan(UINT8 modrm)
else
{
// TODO: Inaccurate
double val = atan(fx80_to_double(ST(1)) / fx80_to_double(ST(0)));
double val = atan2(fx80_to_double(ST(1)) , fx80_to_double(ST(0)));
result = double_to_fx80(val);
}
@ -4519,7 +4547,7 @@ void i386_device::x87_fsave(UINT8 modrm)
}
for (int i = 0; i < 8; ++i)
x87_write_stack(i, READ80(ea + i*10), FALSE);
WRITE80(ea + i*10, ST(i));
CYCLES((m_cr[0] & 1) ? 56 : 67);
}
@ -4575,7 +4603,7 @@ void i386_device::x87_frstor(UINT8 modrm)
}
for (int i = 0; i < 8; ++i)
WRITE80(ea + i*10, ST(i));
x87_write_stack(i, READ80(ea + i*10), FALSE);
CYCLES((m_cr[0] & 1) ? 34 : 44);
}

View File

@ -1436,7 +1436,7 @@ void i960_cpu_device::execute_op(UINT32 opcode)
case 0xd: // cosr
m_icount -= 406;
t1f = get_1_rif(opcode);
set_rif(opcode, sin(t1f));
set_rif(opcode, cos(t1f));
break;
case 0xe: // tanr

View File

@ -215,6 +215,8 @@ void v53_base_device::device_start()
m_out_dack_1_cb.resolve_safe();
m_out_dack_2_cb.resolve_safe();
m_out_dack_3_cb.resolve_safe();
static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(pic8259_device::inta_cb), (pic8259_device*)m_v53icu));
}
void v53_base_device::install_peripheral_io()
@ -447,11 +449,34 @@ READ8_MEMBER(v53_base_device::get_pic_ack)
return 0;
}
WRITE_LINE_MEMBER( v53_base_device::upd71059_irq_w)
// the external interface provides no external access to the usual IRQ line of the V33, everything goes through the interrupt controller
void v53_base_device::execute_set_input(int irqline, int state)
{
printf("upd71059_irq_w %d\n", state);
switch (irqline)
{
case INPUT_LINE_IRQ0: m_v53icu->ir0_w(state); break;
case INPUT_LINE_IRQ1: m_v53icu->ir1_w(state); break;
case INPUT_LINE_IRQ2: m_v53icu->ir2_w(state); break;
case INPUT_LINE_IRQ3: m_v53icu->ir3_w(state); break;
case INPUT_LINE_IRQ4: m_v53icu->ir4_w(state); break;
case INPUT_LINE_IRQ5: m_v53icu->ir5_w(state); break;
case INPUT_LINE_IRQ6: m_v53icu->ir6_w(state); break;
case INPUT_LINE_IRQ7: m_v53icu->ir7_w(state); break;
case INPUT_LINE_NMI: nec_common_device::execute_set_input(irqline, state); break;
case NEC_INPUT_LINE_POLL: nec_common_device::execute_set_input(irqline, state); break;
}
}
// for hooking the interrupt controller output up to the core
WRITE_LINE_MEMBER(v53_base_device::internal_irq_w)
{
nec_common_device::execute_set_input(0, state);
}
static MACHINE_CONFIG_FRAGMENT( v53 )
MCFG_DEVICE_ADD("pit", PIT8254, 0) // functionality identical to uPD71054
@ -461,6 +486,7 @@ static MACHINE_CONFIG_FRAGMENT( v53 )
MCFG_PIT8253_OUT0_HANDLER(WRITELINE( v53_base_device, tcu_out0_trampoline_cb ))
MCFG_PIT8253_OUT1_HANDLER(WRITELINE( v53_base_device, tcu_out1_trampoline_cb ))
MCFG_PIT8253_OUT2_HANDLER(WRITELINE( v53_base_device, tcu_out2_trampoline_cb ))
MCFG_DEVICE_ADD("upd71071dma", V53_DMAU, 4000000)
MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(v53_base_device, hreq_trampoline_cb))
@ -481,7 +507,9 @@ static MACHINE_CONFIG_FRAGMENT( v53 )
MCFG_AM9517A_OUT_DACK_3_CB(WRITELINE(v53_base_device, dma_dack3_trampoline_w))
MCFG_PIC8259_ADD( "upd71059pic", WRITELINE(v53_base_device, upd71059_irq_w), VCC, READ8(v53_base_device,get_pic_ack))
MCFG_PIC8259_ADD( "upd71059pic", WRITELINE(v53_base_device, internal_irq_w), VCC, READ8(v53_base_device,get_pic_ack))
MCFG_DEVICE_ADD("v53scu", V53_SCU, 0)
MCFG_I8251_TXD_HANDLER(WRITELINE(v53_base_device, scu_txd_trampoline_cb))

View File

@ -235,14 +235,16 @@ public:
DECLARE_READ8_MEMBER(get_pic_ack);
DECLARE_WRITE_LINE_MEMBER(upd71059_irq_w);
DECLARE_WRITE_LINE_MEMBER(internal_irq_w);
protected:
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
virtual void device_reset();
virtual void execute_set_input(int inputnum, int state);
required_device<pit8253_device> m_v53tcu;
required_device<upd71071_v53_device> m_v53dmau;
required_device<pic8259_device> m_v53icu;
@ -286,7 +288,6 @@ protected:
};

View File

@ -355,9 +355,7 @@ void adsp21062_device::device_start()
m_lcstack[i] = 0;
m_lastack[i] = 0;
}
m_lstkp = 0;
m_pcstk = 0;
m_pcstkp = 0;
m_laddr.addr = m_laddr.code = m_laddr.loop_type = 0;
m_curlcntr = 0;
m_lcntr = 0;
@ -682,6 +680,8 @@ void adsp21062_device::device_reset()
m_idle = 0;
m_stky = 0x5400000;
m_lstkp = 0;
m_pcstkp = 0;
m_interrupt_active = 0;
}

View File

@ -163,6 +163,7 @@ const device_type TMS0980 = &device_creator<tms0980_cpu_device>; // 28-pin DIP,
// - 32-term microinstructions PLA between the RAM and ROM, supporting 15 microinstructions
// - 16-term output PLA and segment PLA above the RAM (rotate opla 90 degrees)
const device_type TMS0970 = &device_creator<tms0970_cpu_device>; // 28-pin DIP, 11 R pins
const device_type TMS1990 = &device_creator<tms1990_cpu_device>; // 28-pin DIP, ? R pins..
// TMS0950 is same?
// TMS0270 on the other hand, is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky
@ -264,6 +265,10 @@ tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_typ
: tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__)
{ }
tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8, 9, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0980", __FILE__)

View File

@ -312,6 +312,12 @@ protected:
virtual void op_tdo();
};
class tms1990_cpu_device : public tms0970_cpu_device
{
public:
tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms0980_cpu_device : public tms0970_cpu_device
{
@ -394,6 +400,7 @@ extern const device_type TMS1370;
extern const device_type TMS1400;
extern const device_type TMS1470;
extern const device_type TMS0970;
extern const device_type TMS1990;
extern const device_type TMS0980;
extern const device_type TMS0270;

View File

@ -59,6 +59,36 @@ enum
};
// pinout reference
/*
_______ _______
CL1 1 |* \_/ | 42 CL0
PC0 2 | | 41 Vgg
PC1 3 | | 40 PB3
PC2 4 | | 39 PB2
PC3 5 | | 38 PB1
/INT 6 | | 37 PB0
RESET 7 | | 36 PA3
PD0 8 | | 35 PA2
PD1 9 | uPD552 | 34 PA1
PD2 10 | uPD553 | 33 PA0
PD3 11 | uPD650* | 32 PI2
PE0 12 | | 31 PI1
PE1 13 | | 30 PI0
PE2 14 | | 29 PH3
PE3 15 | | 28 PH2
PF0 16 | | 27 PH1
PF1 17 | | 26 PH0
PF2 18 | | 25 PG3
PF3 19 | | 24 PG2
TEST 20 | | 23 PG1
Vss 21 |_________________| 22 PG0
*: pin 21 is Vcc, pin 41 is Vss
*/
class ucom4_cpu_device : public cpu_device
{

View File

@ -15,6 +15,7 @@
#define __EMUCORE_H__
// standard C includes
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -218,7 +219,10 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
#undef assert
#undef assert_always
#ifdef MAME_DEBUG
#if defined(MAME_DEBUG_FAST)
#define assert(x) do { } while (0)
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
#elif defined(MAME_DEBUG)
#define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
#else

View File

@ -61,6 +61,9 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_RECORD ";rec", NULL, OPTION_STRING, "record an input file" },
{ OPTION_MNGWRITE, NULL, OPTION_STRING, "optional filename to write a MNG movie of the current session" },
{ OPTION_AVIWRITE, NULL, OPTION_STRING, "optional filename to write an AVI movie of the current session" },
#ifdef MAME_DEBUG
{ OPTION_DUMMYWRITE, "0", OPTION_BOOLEAN, "indicates if a snapshot should be created if each frame" },
#endif
{ OPTION_WAVWRITE, NULL, OPTION_STRING, "optional filename to write a WAV file of the current session" },
{ OPTION_SNAPNAME, "%g/%i", OPTION_STRING, "override of the default snapshot/movie naming; %g == gamename, %i == index" },
{ OPTION_SNAPSIZE, "auto", OPTION_STRING, "specify snapshot/movie resolution (<width>x<height>) or 'auto' to use minimal size " },

View File

@ -73,6 +73,9 @@ enum
#define OPTION_RECORD "record"
#define OPTION_MNGWRITE "mngwrite"
#define OPTION_AVIWRITE "aviwrite"
#ifdef MAME_DEBUG
#define OPTION_DUMMYWRITE "dummywrite"
#endif
#define OPTION_WAVWRITE "wavwrite"
#define OPTION_SNAPNAME "snapname"
#define OPTION_SNAPSIZE "snapsize"
@ -241,6 +244,9 @@ public:
const char *record() const { return value(OPTION_RECORD); }
const char *mng_write() const { return value(OPTION_MNGWRITE); }
const char *avi_write() const { return value(OPTION_AVIWRITE); }
#ifdef MAME_DEBUG
bool dummy_write() const { return bool_value(OPTION_DUMMYWRITE); }
#endif
const char *wav_write() const { return value(OPTION_WAVWRITE); }
const char *snap_name() const { return value(OPTION_SNAPNAME); }
const char *snap_size() const { return value(OPTION_SNAPSIZE); }

View File

@ -130,7 +130,7 @@ lua_engine::hook::hook()
cb = -1;
}
#ifdef SDLMAME_SOLARIS
#if defined(SDLMAME_SOLARIS) || defined(__ANDROID__)
#undef _L
#endif
@ -639,11 +639,13 @@ int lua_engine::lua_screen::l_draw_box(lua_State *L)
luaL_argcheck(L, lua_isnumber(L, 7), 7, "outline color (integer) expected");
// retrieve all parameters
int sc_width = sc->visible_area().width();
int sc_height = sc->visible_area().height();
float x1, y1, x2, y2;
x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f);
y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f);
x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->visible_area().width()) , 1.0f);
y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->visible_area().height()), 1.0f);
x1 = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast<float>(sc_width);
y1 = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast<float>(sc_height);
x2 = MIN(MAX(0, lua_tointeger(L, 4)), sc_width-1) / static_cast<float>(sc_width);
y2 = MIN(MAX(0, lua_tointeger(L, 5)), sc_height-1) / static_cast<float>(sc_height);
UINT32 bgcolor = lua_tounsigned(L, 6);
UINT32 fgcolor = lua_tounsigned(L, 7);
@ -675,11 +677,13 @@ int lua_engine::lua_screen::l_draw_line(lua_State *L)
luaL_argcheck(L, lua_isnumber(L, 6), 6, "color (integer) expected");
// retrieve all parameters
int sc_width = sc->visible_area().width();
int sc_height = sc->visible_area().height();
float x1, y1, x2, y2;
x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f);
y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f);
x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->visible_area().width()) , 1.0f);
y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->visible_area().height()), 1.0f);
x1 = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast<float>(sc_width);
y1 = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast<float>(sc_height);
x2 = MIN(MAX(0, lua_tointeger(L, 4)), sc_width-1) / static_cast<float>(sc_width);
y2 = MIN(MAX(0, lua_tointeger(L, 5)), sc_height-1) / static_cast<float>(sc_height);
UINT32 color = lua_tounsigned(L, 6);
// draw the line
@ -705,8 +709,10 @@ int lua_engine::lua_screen::l_draw_text(lua_State *L)
luaL_argcheck(L, lua_isstring(L, 4), 4, "message (string) expected");
// retrieve all parameters
float x = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f);
float y = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f);
int sc_width = sc->visible_area().width();
int sc_height = sc->visible_area().height();
float x = MIN(MAX(0, lua_tointeger(L, 2)), sc_width-1) / static_cast<float>(sc_width);
float y = MIN(MAX(0, lua_tointeger(L, 3)), sc_height-1) / static_cast<float>(sc_height);
const char *msg = luaL_checkstring(L,4);
// TODO: add optional parameters (colors, etc.)

View File

@ -79,7 +79,7 @@ inline void i8257_device::dma_request(int channel, int state)
}
else
{
m_request &= ~1 << channel;
m_request &= ~(1 << channel);
}
trigger(1);
}

View File

@ -1255,6 +1255,7 @@ MACHINEOBJS += $(MACHINEOBJ)/lpc.o
MACHINEOBJS += $(MACHINEOBJ)/lpc-acpi.o
MACHINEOBJS += $(MACHINEOBJ)/lpc-rtc.o
MACHINEOBJS += $(MACHINEOBJ)/lpc-pit.o
MACHINEOBJS += $(MACHINEOBJ)/vrc4373.o
endif
#-------------------------------------------------

View File

@ -672,7 +672,7 @@ TIMER_CALLBACK_MEMBER(mcf5206e_peripheral_device::timer1_callback)
debuglogtimer("timer1_callback\n");
m_TER1 |= 0x02;
timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now
m_timer1->adjust(attotime::from_msec(10)); // completely made up value just to fire our timers for now
}
@ -703,11 +703,11 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::TMR1_w)
if (m_TMR1 & 0x0001)
{
timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now
m_timer1->adjust(attotime::from_seconds(1)); // completely made up value just to fire our timers for now
}
else
{
timer1->adjust(attotime::never);
m_timer1->adjust(attotime::never);
}
@ -859,8 +859,26 @@ void mcf5206e_peripheral_device::device_start()
{
init_regs(true);
timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) );
m_timer1 = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( mcf5206e_peripheral_device::timer1_callback ), this) );
save_item(NAME(m_ICR));
save_item(NAME(m_CSAR));
save_item(NAME(m_CSMR));
save_item(NAME(m_CSCR));
save_item(NAME(m_DMCR));
save_item(NAME(m_PAR));
save_item(NAME(m_TMR1));
save_item(NAME(m_TRR1));
save_item(NAME(m_TER1));
save_item(NAME(m_TCN1));
save_item(NAME(m_PPDDR));
save_item(NAME(m_PPDAT));
save_item(NAME(m_IMR));
save_item(NAME(m_MBCR));
save_item(NAME(m_MBSR));
save_item(NAME(m_MFDR));
save_item(NAME(m_MBDR));
save_item(NAME(m_coldfire_regs));
}
void mcf5206e_peripheral_device::device_reset()
@ -868,7 +886,7 @@ void mcf5206e_peripheral_device::device_reset()
m_cpu = (cpu_device*)machine().device(":maincpu"); // hack. this device should really be attached to a modern CPU core
init_regs(false);
timer1->adjust(attotime::never);
m_timer1->adjust(attotime::never);
}
READ32_MEMBER(mcf5206e_peripheral_device::dev_r)

View File

@ -1,6 +1,6 @@
/***************************************************************************
Konami 033906
MCF5206E Peripherals
***************************************************************************/
@ -183,7 +183,7 @@ private:
UINT16 m_DMCR;
UINT16 m_PAR;
emu_timer *timer1;
emu_timer *m_timer1;
UINT16 m_TMR1;
UINT16 m_TRR1;
UINT8 m_TER1;

View File

@ -99,8 +99,15 @@ tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag,
device_memory_interface(mconfig, *this),
m_in_parallel_cb(*this),
m_out_parallel_cb(*this),
m_imr(0),
m_iisr(0),
m_scr(0),
m_pdir(0),
m_space_config("regs", ENDIANNESS_LITTLE, 16, 10, 0, NULL, *ADDRESS_MAP_NAME(tmp68301_regs))
{
memset(m_regs, 0, sizeof(m_regs));
memset(m_IE, 0, sizeof(m_IE));
memset(m_irq_vector, 0, sizeof(m_irq_vector));
}
@ -116,6 +123,14 @@ void tmp68301_device::device_start()
m_in_parallel_cb.resolve_safe(0);
m_out_parallel_cb.resolve_safe();
save_item(NAME(m_regs));
save_item(NAME(m_IE));
save_item(NAME(m_irq_vector));
save_item(NAME(m_imr));
save_item(NAME(m_iisr));
save_item(NAME(m_scr));
save_item(NAME(m_pdir));
}
//-------------------------------------------------

View File

@ -28,6 +28,19 @@
VSS | 14 15 | NC
+-----------------+
TMS6125:
+---------+
DATA/ADD1 | 1 16 | NC
DATA/ADD2 | 2 15 | NC
DATA/ADD4 | 3 14 | NC
DATA/ADD8 | 4 13 | NC
CLK | 5 12 | VDD
NC | 6 11 | /CS
NC | 7 10 | M1
M0 | 8 9 | VSS
+---------+
M58819 (from radarscope schematics):
+-----------------+

344
src/emu/machine/vrc4373.c Normal file
View File

@ -0,0 +1,344 @@
#include "vrc4373.h"
#define LOG_NILE (1)
#define LOG_NILE_MASTER (0)
#define LOG_NILE_TARGET (1)
const device_type VRC4373 = &device_creator<vrc4373_device>;
DEVICE_ADDRESS_MAP_START(config_map, 32, vrc4373_device)
AM_RANGE(0x40, 0x43) AM_READWRITE (pcictrl_r, pcictrl_w)
AM_INHERIT_FROM(pci_host_device::config_map)
ADDRESS_MAP_END
// cpu i/f map
DEVICE_ADDRESS_MAP_START(cpu_map, 32, vrc4373_device)
AM_RANGE(0x00000000, 0x0000007b) AM_READWRITE( vrc4373_device::cpu_if_r, vrc4373_device::cpu_if_w)
ADDRESS_MAP_END
// Target Window 1 map
DEVICE_ADDRESS_MAP_START(target1_map, 32, vrc4373_device)
AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target1_r, vrc4373_device::target1_w)
ADDRESS_MAP_END
// Target Window 2 map
DEVICE_ADDRESS_MAP_START(target2_map, 32, vrc4373_device)
AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( vrc4373_device::target2_r, vrc4373_device::target2_w)
ADDRESS_MAP_END
vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: pci_host_device(mconfig, VRC4373, "NEC VRC4373 System Controller", tag, owner, clock, "vrc4373", __FILE__),
m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32),
m_io_config("io_space", ENDIANNESS_LITTLE, 32, 32)
{
}
const address_space_config *vrc4373_device::memory_space_config(address_spacenum spacenum) const
{
return (spacenum == AS_PROGRAM) ? pci_bridge_device::memory_space_config(spacenum) : (spacenum == AS_DATA) ? &m_mem_config : (spacenum == AS_IO) ? &m_io_config : NULL;
}
void vrc4373_device::device_start()
{
pci_host_device::device_start();
m_cpu = machine().device<cpu_device>(cpu_tag);
m_cpu_space = &m_cpu->space(AS_PROGRAM);
memory_space = &space(AS_DATA);
io_space = &space(AS_IO);
memset(m_cpu_regs, 0, sizeof(m_cpu_regs));
memory_window_start = 0;
memory_window_end = 0xffffffff;
memory_offset = 0;
io_window_start = 0;
io_window_end = 0xffffffff;
io_offset = 0x00000000;
status = 0x0280;
m_ram_size = 1<<22;
m_ram_base = 0;
m_simm_size = 1<<21;
m_simm_base = 0;
regenerate_config_mapping();
}
void vrc4373_device::device_reset()
{
pci_device::device_reset();
memset(m_cpu_regs, 0, sizeof(m_cpu_regs));
remap_cb();
}
void vrc4373_device::map_extra(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space)
{
m_cpu_space->unmap_readwrite(0x00000000, 0xffffffff);
m_cpu_space->install_rom (0x1fc00000, 0x1fcfffff, m_region->base());
m_cpu_space->install_device(0x0f000000, 0x0f0000ff, *static_cast<vrc4373_device *>(this), &vrc4373_device::cpu_map);
// PCI Configuration also mapped at 0x0f000100
m_cpu_space->install_device(0x0f000100, 0x0f0001ff, *static_cast<vrc4373_device *>(this), &vrc4373_device::config_map);
UINT32 winStart, winEnd, winSize;
if (m_cpu_regs[NREG_BMCR]&0x8) {
m_cpu_space->install_ram (m_ram_base, m_ram_base+m_ram_size-1, &m_ram[0]);
if (LOG_NILE)
logerror("%s: map_extra ram_size=%08X ram_base=%08X\n", tag(),m_ram_size,m_ram_base);
}
if (m_cpu_regs[NREG_SIMM1]&0x8) {
m_cpu_space->install_ram (m_simm_base, m_simm_base+m_simm_size-1, &m_simm[0]);
if (LOG_NILE)
logerror("%s: map_extra simm_size=%08X simm_base=%08X\n", tag(),m_simm_size,m_simm_base);
}
// PCI Master Window 1
if (m_cpu_regs[NREG_PCIMW1]&0x1000) {
winStart = m_cpu_regs[NREG_PCIMW1]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW1]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master1_r), this));
m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master1_w), this));
if (LOG_NILE)
logerror("%s: map_extra Master Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci1_laddr);
}
// PCI Master Window 2
if (m_cpu_regs[NREG_PCIMW2]&0x1000) {
winStart = m_cpu_regs[NREG_PCIMW2]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMW2]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master2_r), this));
m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master2_w), this));
if (LOG_NILE)
logerror("%s: map_extra Master Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci2_laddr);
}
// PCI IO Window
if (m_cpu_regs[NREG_PCIMIOW]&0x1000) {
winStart = m_cpu_regs[NREG_PCIMIOW]&0xff000000;
winEnd = winStart | (~(0x80000000 | (((m_cpu_regs[NREG_PCIMIOW]>>13)&0x7f)<<24)));
winSize = winEnd - winStart + 1;
m_cpu_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::master_io_r), this));
m_cpu_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::master_io_w), this));
if (LOG_NILE)
logerror("%s: map_extra IO Window start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_pci_io_laddr);
}
// PCI Target Window 1
if (m_cpu_regs[NREG_PCITW1]&0x1000) {
winStart = m_cpu_regs[NREG_PCITW1]&0xffe00000;
winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW1]>>13)&0x7f)<<21)));
winSize = winEnd - winStart + 1;
memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target1_r), this));
memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target1_w), this));
if (LOG_NILE)
logerror("%s: map_extra Target Window 1 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target1_laddr);
}
// PCI Target Window 2
if (m_cpu_regs[NREG_PCITW2]&0x1000) {
winStart = m_cpu_regs[NREG_PCITW2]&0xffe00000;
winEnd = winStart | (~(0xf0000000 | (((m_cpu_regs[NREG_PCITW2]>>13)&0x7f)<<21)));
winSize = winEnd - winStart + 1;
memory_space->install_read_handler(winStart, winEnd, 0, 0, read32_delegate(FUNC(vrc4373_device::target2_r), this));
memory_space->install_write_handler(winStart, winEnd, 0, 0, write32_delegate(FUNC(vrc4373_device::target2_w), this));
if (LOG_NILE)
logerror("%s: map_extra Target Window 2 start=%08X end=%08X size=%08X laddr=%08X\n", tag(), winStart, winEnd, winSize, m_target2_laddr);
}
}
void vrc4373_device::reset_all_mappings()
{
pci_device::reset_all_mappings();
}
void vrc4373_device::set_cpu_tag(const char *_cpu_tag)
{
if (LOG_NILE)
logerror("%s: set_cpu_tag\n", tag());
cpu_tag = _cpu_tag;
}
// PCI bus control
READ32_MEMBER (vrc4373_device::pcictrl_r)
{
UINT32 result = 0;
if (LOG_NILE)
logerror("%06X:nile pcictrl_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::pcictrl_w)
{
if (LOG_NILE)
logerror("%06X:nile pcictrl_w to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// PCI Master Window 1
READ32_MEMBER (vrc4373_device::master1_r)
{
UINT32 result = this->space(AS_DATA).read_dword(m_pci1_laddr | (offset*4), mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::master1_w)
{
this->space(AS_DATA).write_dword(m_pci1_laddr | (offset*4), data, mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// PCI Master Window 2
READ32_MEMBER (vrc4373_device::master2_r)
{
UINT32 result = this->space(AS_DATA).read_dword(m_pci2_laddr | (offset*4), mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::master2_w)
{
this->space(AS_DATA).write_dword(m_pci2_laddr | (offset*4), data, mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// PCI Master IO Window
READ32_MEMBER (vrc4373_device::master_io_r)
{
UINT32 result = this->space(AS_IO).read_dword(m_pci_io_laddr | (offset*4), mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master io read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::master_io_w)
{
this->space(AS_IO).write_dword(m_pci_io_laddr | (offset*4), data, mem_mask);
if (LOG_NILE_MASTER)
logerror("%06X:nile master io write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// PCI Target Window 1
READ32_MEMBER (vrc4373_device::target1_r)
{
UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target1_laddr | (offset*4), mem_mask);
if (LOG_NILE_TARGET)
logerror("%06X:nile target1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::target1_w)
{
m_cpu->space(AS_PROGRAM).write_dword(m_target1_laddr | (offset*4), data, mem_mask);
if (LOG_NILE_TARGET)
logerror("%06X:nile target1 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// PCI Target Window 2
READ32_MEMBER (vrc4373_device::target2_r)
{
UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target2_laddr | (offset*4), mem_mask);
if (LOG_NILE_TARGET)
logerror("%06X:nile target2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER (vrc4373_device::target2_w)
{
m_cpu->space(AS_PROGRAM).write_dword(m_target2_laddr | (offset*4), data, mem_mask);
if (LOG_NILE_TARGET)
logerror("%06X:nile target2 write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
}
// CPU I/F
READ32_MEMBER (vrc4373_device::cpu_if_r)
{
UINT32 result = m_cpu_regs[offset];
switch (offset) {
case NREG_PCICAR:
result = config_address_r(space, offset);
break;
case NREG_PCICDR:
result = config_data_r(space, offset);
break;
default:
break;
}
if (LOG_NILE)
logerror("%06X:nile read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask);
return result;
}
WRITE32_MEMBER(vrc4373_device::cpu_if_w)
{
if (LOG_NILE)
logerror("%06X:nile write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask);
UINT32 modData;
COMBINE_DATA(&m_cpu_regs[offset]);
switch (offset) {
case NREG_PCIMW1:
m_pci1_laddr = (data&0xff)<<24;
remap_cb();
break;
case NREG_PCIMW2:
m_pci2_laddr = (data&0xff)<<24;
remap_cb();
break;
case NREG_PCIMIOW:
m_pci_io_laddr = (data&0xff)<<24;
remap_cb();
break;
case NREG_PCITW1:
m_target1_laddr = (data&0x7FF)<<21;
break;
case NREG_PCITW2:
m_target2_laddr = (data&0x7FF)<<21;
break;
case NREG_PCICAR:
// Bits in reserved area are used for device selection of type 0 config transactions
// Assuming 23:11 get mapped into device number for configuration
if ((data&0x3) == 0x0) {
// Type 0 transaction
modData = 0;
// Select the device based on one hot bit
for (int i=11; i<24; i++) {
if ((data>>i)&0x1) {
// One hot encoding, bit 11 will mean device 1
modData = i-10;
break;
}
}
// Re-organize into Type 1 transaction for bus 0 (local bus)
modData = (modData<<11) | (data&0x7ff) | (0x80000000);
} else {
// Type 1 transaction, no modification needed
modData = data;
}
pci_host_device::config_address_w(space, offset, modData);
break;
case NREG_PCICDR:
pci_host_device::config_data_w(space, offset, data);
break;
case NREG_BMCR:
if ((data>>3)&0x1) {
m_ram_size = 1<<22; // 4MB
for (int i=14; i<=15; i++) {
if (!((data>>i)&0x1)) m_ram_size<<=1;
else break;
}
m_ram.resize(m_ram_size/4);
m_ram_base = (data & 0x0fc00000);
}
remap_cb();
break;
case NREG_SIMM1:
if ((data>>3)&0x1) {
m_simm_size = 1<<21; // 2MB
for (int i=13; i<=17; i++) {
if (!((data>>i)&0x1)) m_simm_size<<=1;
else break;
}
m_simm.resize(m_simm_size/4);
m_simm_base = (data & 0x0fe00000);
}
remap_cb();
break;
default:
break;
}
}

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