lua-users home
lua-l archive

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


On or about Sun, 6 May 2007 Edward Mitchell wrote:
>Just to finish this thread off....
>
>..\bin\lua ..\bin\bin2c.lua "+$(InputFileName)" >
>"$(InputDir)\$(InputName).h"

Personally, I'd use something other than .h for the generated
file. That usually makes life easier when auditing which files
belong under source code control. It also usually makes things
like custom rules easier to manage in make since you are less
likely to accidentally have a valuable non-derived file
overwritten by a rule you didn't expect to match. In this case,
since the output is not a true header (it must be included inside
a function body, immediately after an open curly brace) using an
unusual name will help signal its nature to code review.

>I had to use the $(InputFileName) macro for myLua.lib source
>since if I used the $(InputPath) the backslash escapes from
>the Windows paths screwed up the strings in the include file.

Actually, that could be argued to be a bug in bin2c.lua. It should
arrange to appropriately quote all of the text from the command
line arguments so that it remains a legal C string literal. I'll
probably take a crack at fixing that and propose a patch unless
someone beats me to it.

Ross Berteig                               Ross@CheshireEng.com
Cheshire Engineering Corp. http://www.CheshireEng.com/