VisualGDB Makefiles
以下内容是VisualGDB官网对VisualGDB编译时获取相关编译信息的说明:
When you create a new project using VisualGDB, it will generate a Makefile for you. More specifically, it will generate 2 files: Makefile and flags.mak.
Overview
- When you add new files to the project, VisualGDB will update the Makefile automatically
- If you want to change the GCC/LD flags, edit the flags.mak file
- If you want to add more configurations or targets, modify the Makefile.
- If you don't want VisualGDB to touch the Makefile, remove the following line:
#VisualGDB: AutoSourceFiles
Detailed description
The Makefile contains basic targets (such as all and clean) and generally has the following structure:
SOURCEFILES := file1.cpp file2.cpp
TARGETNAME := MyExeName
include flags.mak
ifeq ($(CONFIG),DEBUG)
...
endif
...
$(BINARYDIR)/%.o : %.cpp $(BINARYDIR)
$(CXX) $(CFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
$(BINARYDIR)/%.o : %.c $(BINARYDIR)
$(CC) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
The SOURCEFILES line lists all source files used in the project. VisualGDB will automatically update this line when you add new files to the project. The "%.cpp" and "%.c" lines define generic rules to build .o files from the C/C++ source files.
The flags.mak defines GCC flags (such as optimization level) that are used by Makefile. Its typical structure looks the following way:
CXX := /usr/bin/g++
LD := /usr/bin/g++
...
CFLAGS := -ggdb -ffunction-sections
DEBUG_CFLAGS := -O0
RELEASE_CFLAGS := -O3
The following table summarizes all variables defined in flags.mak:
| Variable | Meaning | Example |
|---|---|---|
| CC | Location of the GCC compiler | c:/gcc/gcc.exe |
| CXX | Location of the C++ compiler | c:/gcc/g++.exe |
| LD | Location of the linker (typically GCC/G++ is used for linking) | c:/gcc/g++.exe |
| COMMON_MACROS | Preprocessor definitions to be defined in all configurations. | _WIN32 _CONSOLE |
| DEBUG_MACROS | Preprocessor definitions to be defined in DEBUG configuration only | _DEBUG DEBUG |
| RELEASE_MACROS | Preprocessor definitions to be defined in RELEASE configuration only | _NDEBUG _RELEASE |
| MCUFLAGS | Additional flags specifying microcontroller type | -mmcu=msp430f2013 |
| INCLUDE_DIRS | Additional include directories relative to the project location | ../lib1 ../lib2 |
| LIBRARY_DIRS | Additional library directories | ../lib1/bin ../lib2/bin |
| LIBRARY_NAMES | Additional libraries to link with (no "lib" prefix) | 1 2 |
| CFLAGS | Additional GCC flags for all configurations | -ggdb -ffunction-sections |
| DEBUG_CFLAGS | Additional GCC flags for DEBUG configuration | -O0 |
| RELEASE_CFLAGS | Additional GCC flags for RELEASE configuration | -O3 |
| CXXFLAGS | Additional C++ flags for all configurations | -fno-exceptions |
| DEBUG_CXXFLAGS | Additional C++ flags for DEBUG configuration | |
| RELEASE_CXXFLAGS | Additional C++ flags for RELEASE configuration | |
| MACOS_FRAMEWORKS | Additional framework names (MacOS only) | iokit |
| LDFLAGS | Additional flags to the linker (with -Wl, prefix when GCC is used for linking) | |
| DEBUG_LDFLAGS | Additional linker flags for DEBUG configuration | |
| RELEASE_LDFLAGS | Additional linker flags for RELEASE configuration | |
| START_GROUP | Either an empty string, or "-Wl,--start-group" | |
| END_GROUP | Either an empty string, or "-Wl,--end-group" |
The START_GROUP/END_GROUP flags surround the library/object file list and allow specifying them in an arbitrary order (otherwise the object file list has to be sorted manually). You can set those variables to empty strings if your linker (e.g. MacOS linker) does not require those flags.
对上面的内容可以理解为为:Debug模式下,完整的make执行需要Makefile和debug.mak两个文件;Release模式下则需要Makefile和release.mak两个文件
如果需要导出VisualGDB的Makefile文件,只需要合并相应的两个文件即可。将.mak文件的内容放到Makefile文件内容的前面,所得到的Makefile文件即可进行编译。
VisualGDB Makefiles的更多相关文章
- 使用VS+VisualGDB编译Linux版本RCF
RPC通信框架--RCF介绍中说了,RCF本身是支持跨平台的,其代码放到Linux平台,是可以通过gcc.make等工具,编译通过的. 官方提供的源码中,只有cmake编译脚本,并没有提供Makefi ...
- 使用VS+VisualGDB编译Linux版本RCF(相当于Linux也有COM版本了)
阅读目录 通过向导配置项目 配置目录结构 修改项目配置 添加RCF源代码 完成配置并进行编译 添加测试程序 添加测试代码——通过TCP进行通信 运行测试程序并查看测试结果 VisualGDB生成的所有 ...
- 使用VS+VisualGDB编译调试Linux程序
Linux程序开发变得越来越多,越来越多的程序.产品需要跨平台,甚至有些开源项目只支持Linux平台,所以掌握Linux开发变得越来越重要. 但是对于习惯了Windows下的开发,使用了VS这个宇宙第 ...
- VisualRust + VisualGDB编辑调试Rust
Rust到1.6了,到了一个相对成熟的阶段,可以试用做一些项目了.但是写的代码越多,就会发现一个好的IDE相当于效率的一半.这里分享我 在Visual Studio的使用Rust的经验. 首先需要下载 ...
- Makefiles 介绍
http://www-personal.umich.edu/~ppannuto/writings/makefiles.html Makefiles Makefiles (or, the GNU aut ...
- VisualGDB:使用VS创建CMake Linux项目
转载地址:点击打开链接 根据VisualGDB官网(https://visualgdb.com)的帮助文档大致翻译而成.主要是作为个人学习记录.有错误的地方,Robin欢迎大家指正. 本文介绍如何使用 ...
- VisualGDB系列8:使用VS创建CMake Linux项目
根据VisualGDB官网(https://visualgdb.com)的帮助文档大致翻译而成.主要是作为个人学习记录.有错误的地方,Robin欢迎大家指正. 本文介绍如何使用VS来创建.构建.调试一 ...
- VisualGDB系列11:Linux C++项目中使用外部Linux库
根据VisualGDB官网(https://visualgdb.com)的帮助文档大致翻译而成.主要是作为个人学习记录.有错误的地方,Robin欢迎大家指正. 在<使用VS创建Linux静态库和 ...
- VisualGDB系列10:快速调试Linux应用程序
根据VisualGDB官网(https://visualgdb.com)的帮助文档大致翻译而成.主要是作为个人学习记录.有错误的地方,Robin欢迎大家指正. 本文介绍如何快速调试GCC构建的Linu ...
随机推荐
- grep过滤搜索
cat /proc/2666/maps | busybox grep libumcpart.so
- Python+Selenium WebDriver API:浏览器及元素的常用函数及变量整理总结
由于网页自动化要操作浏览器以及浏览器页面元素,这里笔者就将浏览器及页面元素常用的函数及变量整理总结一下,以供读者在编写网页自动化测试时查阅. from selenium import webdrive ...
- Mac下eclipse导入其他工程中文注释出现乱码解决方案
因为用的是mac版的eclipse,导入其他工程注释出现乱码的情况,找了网上的很多方法,大部分都是说的workspace,在这里修改,但是我修改之后还是乱码,最后发现这样一个方法,才得以解决. 点击 ...
- php自学笔记3
-------补充--------建议定义常量时,判断常量名是否被定义,用defined()判断,返回布尔型if(!defined("POEM")){//没定义过 define(& ...
- Java谜题心得
1,二进制浮点数的运算是对实际算数的一种近似运算. 2,IEEE 754浮点算术保留了一个特殊的值用来表示一个不是数字的数量[IEEE 754].这个值就是NaN(“不是一个数字(Not a Numb ...
- libthread_db
http://timetobleed.com/notes-about-an-odd-esoteric-yet-incredibly-useful-library-libthread_db/
- java中关于编码的问题(字符转换流及字符缓冲流 )
上次我们使用的是字节流,还有一种方式就是字符流,上次说过如何分辨使用哪种流,如果记事本可以读懂则使用字符流,否则使用字节流.使用字符流就需要牵扯到编码的问题,下面给出一种转化流的格式. OutputS ...
- OC语言的特性(二)-Block
本篇文章的主要内容 了解何谓block. 了解block的使用方法. Block 是iOS在4.0版本之后新增的程序语法. 在iOS SDK 4.0之后,Block几乎出现在所有新版的API之中,换句 ...
- LWIP_STM32_ENC28J60_NETCONN_TCP_SERVICER(5)
前面说了TCP客户端通讯,这一篇来说说单片机作为服务器的通讯方法 tcp客户端和服务器的链接做大的不同在于服务器是不需要主动链接谁的,他只需要绑定在自己得一个特定的端口之上,等别人来连接就好了,先创建 ...
- ue4中窗口打开web地址
首先打开项目,设置,widgets,启用webbroswer 新建一个蓝图, 在控件栏里就可以找到添加webbroswer 设置initial url就可以打开网页了, 项目中还用到获取界面参数,与界 ...