lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Ariel,

Marvelous!  :)

I found something interesting to add.  If makefiles aren't your style, you
can instead create a PKG file for tolua to parse.  I saw the tolualua.pkg
and inside it were the following:

$[
$<basic.lua>
$<feature.lua>
$<verbatim.lua>
$<code.lua>
$<typedef.lua>
$<container.lua>
$<package.lua>
$<module.lua>
$<define.lua>
$<enumerate.lua>
$<declaration.lua>
$<variable.lua>
$<array.lua>
$<function.lua>
$<operator.lua>
$<class.lua>
$<clean.lua>
$<doit.lua>
$]

And it produces the same "embedded Lua code" tolualua.c has.

This raises a question of comfort though.  Embedding the *.lua files into
tolua makes it more compact and you only have to deal with one file, but
modifying the scripts will require a recompile of tolua itself.

In my case I still would prefer the *.lua files separate from the
executable.  Perhaps I just missed a few *.lua files in the code.

Thanks again :)

-Mark


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Ariel Manzur
Sent: 12 June 2003 14:56
To: Lua list
Subject: Re: modifying tolua


At 12:22 12/06/2003 +0800, you wrote:

>It seemed to work well and all, but unfortunately the output file it
>generated was zero(0) bytes... it didnt contain anything.  I checked the
>program and lua_dofile () returns success, so there isnt a problem with the
>*.lua files (maybe).  All the required lua libraries were called (baselib,
>iolib, strlib), so it couldnt be that.  Whats the big difference between
the
>internal version and the *.lua files, besides being internal?
>
>I'm at a quandary now.  Anyone can lend me a little insight? :)


I had the same problem with the included script files (they are all enbeded
on tolualua.c actually). Here's what I added to the Makefile to get it to
recompile when I change a .lua file:

--
SCRIPTS = array.lua \
basic.lua \
class.lua \
clean.lua  \
code.lua  \
container.lua \
declaration.lua \
define.lua \
doit.lua \
enumerate.lua \
feature.lua \
function.lua \
lua2c.lua \
module.lua \
operator.lua \
package.lua \
typedef.lua \
variable.lua \
verbatim.lua


tolualua.c: $(SCRIPTS)
         tolua -H tolualua.h -o tolualua.c tolualua.pkg
--

right before the 'OBJS' line. That'll rebuild 'tolualua.c' everytime you
change on of the script files, and compile everything in the binary. As you
can see, it uses tolua, so you need to keep a copy of a working binary. I
don't know about the modifications you made, but that should make it easier
to test it.

hope it helps.. bye..

Ariel.


Ariel.
http://Anime.com.ar
snm