Commit c02749d8 authored by Ricardo Calheiros de Miranda Cosme's avatar Ricardo Calheiros de Miranda Cosme
Browse files

[OPENBUS-1253]

+ Tecmake 4.5 alpha.
  - Versão gerada pelo Scuri para atender 
    a demanda OPENBUS-1253.
    


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/utils/tecmake@116018 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 30e8e89b
Pipeline #709 skipped
Tecmake License
-----------
Tecmake is licensed under the terms of the MIT license reproduced below.
This means that Tecmake is free software and can be used for both academic
and commercial purposes at absolutely no cost.
===============================================================================
Copyright (C) 1994-2011 Tecgraf, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================================================
(end of COPYRIGHT)
README for Tecmake
Tecmake is essentially a general GNU makefile with a series of predefined
targets and rules with the purpose of providing those in charge of developing
libraries and applications the necessary tools so that versions for different
platforms can be generated homogeneously. In other words, the tecmake user
does not need to create a complete makefile nor be concerned with the current
platform to create a library or application.
Installation instructions and usage are available in the Tecmake documentation.
For complete information, visit Tecmake's web site at http://www.tecgraf.puc-rio.br/tecmake
or access its documentation in the HTML folder.
(end of README)
local description = [=[
Usage: lua bin2c.lua [+]filename [status]
Write a C source file to standard output. When this C source file is
included in another C source file, it has the effect of loading and
running the specified file at that point in the program.
The file named by 'filename' contains either Lua byte code or Lua source.
Its contents are used to generate the C output. If + is used, then the
contents of 'filename' are first compiled before being used to generate
the C output. If given, 'status' names a C variable used to store the
return value of either luaL_loadbuffer() or lua_pcall(). Otherwise,
the return values of these functions will be unavailable.
This program is (overly) careful to generate output identical to the
output generated by bin2c5.1 from LuaBinaries.
http://lua-users.org/wiki/BinTwoCee
]=]
if not arg or not arg[1] then
io.stderr:write(description)
return
end
local compile, filename = arg[1]:match"^(+?)(.*)"
local status = arg[2]
local content = compile=="+"
and string.dump(assert(loadfile(filename)))
or assert(io.open(filename,"rb")):read"*a"
local function boilerplate(fmt)
return string.format(fmt,
status and "("..status.."=" or "",
filename,
status and ")" or "",
status and status.."=" or "",
filename)
end
local dump do
local numtab={}; for i=0,255 do numtab[string.char(i)]=("%3d,"):format(i) end
function dump(str)
return (str:gsub(".", numtab):gsub(("."):rep(80), "%0\n"))
end
end
io.write(boilerplate[=[
/* code automatically generated by bin2c -- DO NOT EDIT */
{
/* #include'ing this file in a C program is equivalent to calling
if (%sluaL_loadfile(L,%q)%s==0) %slua_pcall(L, 0, 0, 0);
*/
/* %s */
static const unsigned char B1[]={
]=], dump(content), boilerplate[=[
};
if (%sluaL_loadbuffer(L,(const char*)B1,sizeof(B1),%q)%s==0) %slua_pcall(L, 0, 0, 0);
}
]=])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment