MSYS+mingw 配置makefile
来源:互联网 发布:c语言提成英文 编辑:程序博客网 时间:2024/05/16 01:13
在阅读本文前请先确认你已经了解了
http://blog.csdn.net/dcmilan/article/details/7983697
http://blog.csdn.net/dcmilan/article/details/7986961
1.安装MSYS
MSYS在mingw的官网上可以下载,我这里使用1.0版本
安装完之后在C:\msys\1.0\bin文件夹里会有GNU的make
在cmd下使用make时,需要显示调用全路径C:\msys\1.0\bin\make
2.准备cpp和makefile
// hello.cpp#include <iostream>int main( ){ std::cout << "Hello, World!\n";}
// makefile(这一行在代码中不要出现,makefile中的命令行部分要以制表符tab开头,而不是空格)# This is the default target, which will be built when# you invoke make.PHONY: allall: hello# This rule tells make how to build hello from hello.cpphello: hello.cppg++ -o hello hello.cpp# This rule tells make to copy hello to the binaries subdirectory,# creating it if necessary.PHONY: installinstall:C:/msys/1.0/bin/mkdir -p binariesC:/msys/1.0/bin/cp hello binaries# This rule tells make to delete hello and hello.o.PHONY: cleanclean:C:/msys/1.0/bin/rm -f hello
建立一个文件夹hello,然后将以上代码在hello文件夹里创建对应文件hello.cpp和makefile
3.执行make命令
在cmd环境下切换目录到hello下
执行命令C:/msys/1.0/bin/make hello
生成hello.exe
然后再执行C:/msys/1.0/bin/make install
创建一个binaries文件夹,并将hello.exe复制到其中
注意:这里的makefile是完整的文件名,make命令
会自动找到这个文件,并执行文件中对应段的操作
- MSYS+mingw 配置makefile
- mingw+msys windows下配置
- MinGW + msys终端mintty配置
- mingw msys
- mingw开发环境中msys及vim的简单配置
- NetBeans下MinGW和msys的安装与配置
- MinGW 和 MSYS 的手动安装与环境配置
- cygwin/gcc/msys/mingw
- MinGW+MSYS安装
- MinGW 和 MSYS
- [转]MinGW与MSYS
- mingw & msys (zz)
- MinGW 和 MSYS
- MinGW, MSYS介绍
- MSYS和MinGW
- MinGW 和 MSYS
- MinGW和MSYS相关
- MinGW和MSYS简介
- Oracle中的EXISTS 和NOT EXISTS 用法详解
- 比较简洁的页面显示日期、时间
- poj 3204 Ikki's Story I - Road Reconstruction(最大流割边)
- Android4.0-新增操作栏实现汇总
- 静态方法、单例模式区别 (转)
- MSYS+mingw 配置makefile
- python的程序基本风格
- 一个简单的SIP呼叫例子
- Navigation + Tab Bar 常用组合框架
- 引用和使用引用传递参数《一》
- C#中读写Excel的方法及OleDbConnection的一个SQL问题
- 高次方求模
- 关于stm32库3.5里bool类型的定义
- iphone push notification 消息推送