繁体   English   中英

Lua Build Lua在Windows build.cmd中

[英]Lua Build Lua In Windows build.cmd

我尝试按照build.cmd文件中的问题( 在Windows 10上使用Torch在Lua上运行(具有受限管理员权限) )建议安装。 结果是:

mingw32-make: *** No targets specified and no makefile found. Stop.

**** COMPILATION TERMINATED ****

**** BUILDING BINARY DISTRIBUTION ****

The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified.

**** BINARY DISTRIBUTION BUILT ****

'C:\gcc-lua-install\lua\bin\lua.exe' is not recognized as an internal or external command, operable program or batch file.

Press any key to continue . . .

在此行失败:

mingw32-make PLAT=mingw

这条线是做什么的? 我收集到它是“ makes”的,但是在本教程中,目前没有makefile。

    @echo off
    :: ========================
    :: file build.cmd
    :: ========================
    setlocal
    :: you may change the following variable's value
    :: to suit the downloaded version
    set lua_version=5.3.4

    set work_dir=%~dp0
    :: Removes trailing backslash
    :: to enhance readability in the following steps
    set work_dir=%work_dir:~0,-1%

    set lua_install_dir=%work_dir%\lua
    set compiler_bin_dir=%work_dir%\tdm-gcc\bin
    set lua_build_dir=%work_dir%\lua-%lua_version%
    set path=%compiler_bin_dir%;%path%

    cd /D %lua_build_dir%
    mingw32-make PLAT=mingw

    echo.
    echo **** COMPILATION TERMINATED ****
    echo.
    echo **** BUILDING BINARY DISTRIBUTION ****
    echo.

    :: create a clean "binary" installation
    mkdir %lua_install_dir%
    mkdir %lua_install_dir%\doc
    mkdir %lua_install_dir%\bin
    mkdir %lua_install_dir%\include

    copy %lua_build_dir%\doc\*.* %lua_install_dir%\doc\*.*
    copy %lua_build_dir%\src\*.exe %lua_install_dir%\bin\*.*
    copy %lua_build_dir%\src\*.dll %lua_install_dir%\bin\*.*
    copy %lua_build_dir%\src\luaconf.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lua.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lualib.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lauxlib.h %lua_install_dir%\include\*.*
    copy %lua_build_dir%\src\lua.hpp %lua_install_dir%\include\*.*

    echo.
    echo **** BINARY DISTRIBUTION BUILT ****
    echo.

    %lua_install_dir%\bin\lua.exe -e"print [[Hello!]];print[[Simple Lua test successful!!!]]"

    echo.

    pause

build.cmd似乎可以:1)创建一些目录变量。 2)使用mingw32-make生成makefile(缺少)3)创建文件结构。 4)将文件放在文件结构中。

我不明白的那行是mingw32-make。

鉴于您已经正确地遵循了本教程,并且您拥有了Lua源文件,因此不必指定文件名。 mingw32-make将使用文件Makefile,该文件位于您选择作为开始目录的源文件夹中,并在前一行带有cd /D %lua_build_dir%

在此处输入图片说明

PLAT = mingw定义要使用的平台。 在这种情况下,使用mingw32时就是mingw。 您会在Makefile btw中找到它。

从GNU make文档:

指定Makefile的参数

指定makefile名称的方法是使用-f或--file选项(--makefile也可以使用)。 例如,-f altmake表示将文件altmake用作makefile。

如果您多次使用-f标志,并在每个-f之后加上一个参数,则所有指定的文件将一起用作makefile。

如果不使用-f或--file标志, 则默认设置是 按该顺序 尝试 GNUmakefile,makefile和Makefile,并使用 这三个存在的或可以创建的第一个

如果我必须进行有根据的猜测,我会说您是在设置工作主管时出错,或者是从错误的目录运行了build.cmd。 逐步遵循本教程可以避免这两种情况。

从这里https://www.lua.org/download.html重新下载lua

使用winrar直接解压到目录

将版本号重命名为下载的版本号

将文本文件另存为UTF-8 build.cmd

运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM