使用参数从cmd.exe执行MSYS [英] Executing MSYS from cmd.exe with arguments

查看:102
本文介绍了使用参数从cmd.exe执行MSYS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

I am trying to learn the wxWidgets library, using MinGW and msys to compile the code. So far so good, but I can not find a way to send a command to MSYS through CMD.exe.

我使用 Sublime Text 来编辑文件,它具有运行Makefile的选项.我希望我的makefile能够打开MSYS实例并将g ++命令和参数发送给它.

I use Sublime Text to edit files, and it has an option to run makefiles. I want my makefiles to be able to open an instance of MSYS and send the g++ command and arguments to it.

示例:
现在我的makefile是:

Example:
Right now my makefile is:

test.exe : main.cpp
        g++ -s main.cpp -o test.exe `wx-config --cxxflags` `wx-config --libs`

当mingw32-make运行g ++命令时,它会将其发送到cmd.exe,后者不处理反问号和wx-config爵士乐. (但是该命令在MSYS和包含main.cpp的目录中运行时确实起作用)

When mingw32-make goes to run the g++ command, it sends it to cmd.exe, which doesn't handle the back-ticks and wx-config jazz. (But the command does work when run from inside MSYS and the directory holding main.cpp)

我希望能够使用类似...

I want to be able to use something like...

msys --command g++ -s main.cpp*...etc..*

因此它将加载MSYS环境并运行命令.这可能吗?

So it will load the MSYS enviroment and run the command. Is this possible?

我是makefile的新手,所以如果有更简单的方法,请告诉我!

I am a huge makefile newbie, so if there is an easier way, please show me!

推荐答案

您可能想要

You probably want to set the shell that gmake uses to execute the commands that make up the makefile. I assume that MSYS comes with bash or even plain sh, which should do the job.

这篇关于使用参数从cmd.exe执行MSYS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆