-- -- HAMSTER_EVC.LUA Copyright (c) 2003-05, asko.kauppi@sci.fi -- -- Compiler adapter for Microsoft eMbedded Visual C++ ('evc'), version 4.0 -- and later. -- -- Usage: -- Use this library either directly ('-l hamster_win32_msc') or via the -- autodetecting '-l hamster' library. -- -- Author: -- asko.kauppi@sci.fi -- -- License: -- GPL (see 'license.txt') -- -- Note: ... -- -- To-do: ... -- -- Presetting 'WINCE' is necessary, so Hamster won't set itself for Win32. -- rawset(_G,"WINCE",true) -- Subscript finding (this part should be same in all front-ends) -- local MY_PATH for pat in string.gfind( LUA_PATH, "[^;]+" ) do local try= string.gsub( pat, "?%.lua", "" ) local fh= io.open(try.."hamster.lua","r") if fh then fh:close(); MY_PATH=try; break end end assert( MY_PATH, "Path to Hamster not found!" ) -- "Tools/Hamster/" local m= rawget(_G,"arg") and arg[1] or assert( dofile( MY_PATH.."hamster_core.lua" ) ) -- passes an error message (if necessary) assert( m._info ) ----- -- Tell our personality (eMbedded Visual C++ 4.0 - or later) -- function m.CompilerConfig( env ) -- local cc, as if WINCE.arm then cc= "clarm" as= "armasm" elseif WINCE.mips then cc= "clmips" as= "mipsasm" elseif WINCE.sh then cc= "clsh" as= "shasm" else cc= "cl" as= nil end local cfg= { program_suffix= ".exe", sharedlib_suffix= ".dll", staticlib_suffix= ".lib", staticlib_prefix= "", staticobj_suffix= ".obj", sharedobj_suffix= ".obj", -- c_cmd= cc.." /nologo $CPPFLAGS $CCFLAGS /c $SOURCE /Fo$TARGET", cpp_cmd= cc.." /nologo $CPPFLAGS $CXXFLAGS /c $SOURCE /Fo$TARGET", asm_cmd= as, shared_flag= "", -- staticlib_cmd= "lib /nologo /out:$TARGET $SOURCE $LIBPATH $LIBS", staticlib_cmd2= nil, -- not required -- sharedlib_cmd= "link /nologo /dll $SHLINKFLAGS /out:$TARGET $LIBPATH $LIBS $SOURCE", link_cmd= "link /nologo $LINKFLAGS /out:$TARGET $LIBPATH $LIBS $SOURCE", -- inc_flag= "/I", def_flag= "/D", lib_flag= nil, -- none libpath_flag= "/LIBPATH:", } return cfg end m._make= "nmake" rawset(_G,"hamster",m) rawset(_G,"CC","evc") return m