腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
Eureka的技术时光轴
专栏作者
举报
338
文章
685443
阅读量
39
订阅数
订阅专栏
申请加入专栏
全部文章(338)
编程算法(98)
windows(46)
c++(29)
api(29)
linux(29)
打包(25)
单片机(22)
ide(21)
http(21)
网络安全(21)
python(15)
node.js(15)
javascript(14)
html(14)
android(14)
delphi(14)
https(14)
tcp/ip(13)
kernel(12)
汇编语言(11)
虚拟化(11)
c#(10)
存储(10)
socket编程(10)
java(8)
开源(8)
php(7)
xml(7)
数据库(7)
sql(7)
github(7)
shell(7)
udp(7)
dll(7)
git(6)
文件存储(6)
gcc(6)
数据分析(6)
数据结构(6)
c 语言(5)
unix(5)
数据加密服务(5)
actionscript(4)
json(4)
webview(4)
ubuntu(4)
mongodb(4)
ssh(4)
gui(4)
kvm(4)
安全(4)
file(4)
io(4)
makefile(3)
access(3)
apache(3)
命令行工具(3)
云数据库 MongoDB(3)
SSL 证书(3)
腾讯云测试服务(3)
云推荐引擎(3)
网站(3)
微信(3)
device(3)
function(3)
list(3)
进程(3)
内核(3)
bash(2)
arm(2)
ruby on rails(2)
windows server(2)
centos(2)
bash 指令(2)
apt-get(2)
图像处理(2)
面向对象编程(2)
gradle(2)
nat(2)
add(2)
app(2)
base64(2)
bug(2)
fs(2)
handle(2)
hook(2)
image(2)
input(2)
int(2)
ode(2)
point(2)
project(2)
return(2)
tcp(2)
win10(2)
windbg(2)
wmi(2)
编程(2)
编译(2)
程序(2)
内存(2)
数据(2)
系统(2)
虚拟机(2)
原理(2)
源码(2)
指针(2)
ios(1)
go(1)
lua(1)
.net(1)
regex(1)
angularjs(1)
react(1)
css(1)
jquery(1)
android studio(1)
qt(1)
硬件开发(1)
访问管理(1)
NAT 网关(1)
消息队列 CMQ 版(1)
检测工具(1)
express(1)
缓存(1)
压力测试(1)
爬虫(1)
yum(1)
dns(1)
kotlin(1)
flash(1)
rpc(1)
notepad ++(1)
kafka(1)
sdk(1)
验证码(1)
absolute(1)
action(1)
apply(1)
asm(1)
background(1)
block(1)
bmp(1)
build(1)
byte(1)
class(1)
client(1)
code(1)
command(1)
data(1)
debug(1)
debugging(1)
default(1)
dt(1)
dump(1)
dynamic(1)
error(1)
eval(1)
exception(1)
extern(1)
filter(1)
fixed(1)
flags(1)
glib(1)
glibc(1)
implementation(1)
include(1)
init(1)
ip(1)
join(1)
ld(1)
libc(1)
load(1)
loader(1)
masm(1)
max(1)
message(1)
module(1)
nasm(1)
navigator(1)
null(1)
object(1)
opacity(1)
package(1)
parameters(1)
paste(1)
pid(1)
position(1)
proc(1)
procedure(1)
public(1)
require(1)
runtime(1)
set(1)
shift(1)
simulation(1)
ssl(1)
status(1)
sum(1)
sys(1)
system(1)
tcpclient(1)
text(1)
txt(1)
union(1)
usb(1)
vnc(1)
vsix(1)
x86(1)
xilinx(1)
zip(1)
闭包(1)
遍历(1)
变量(1)
编译器(1)
博客(1)
测试(1)
产品(1)
登录(1)
服务(1)
工具(1)
函数(1)
华为(1)
计算机(1)
加密(1)
脚本(1)
开发环境(1)
快捷键(1)
连接(1)
乱码(1)
面试(1)
权限(1)
事件(1)
手机(1)
调试(1)
语法(1)
装饰器(1)
作用域(1)
搜索文章
搜索
搜索
关闭
makefile 的 ifdef, ifeq 使用及辨析
打包
编程算法
makefile
gcc
http
#可以用命令行传递变量 RELEASE = abc #ifdef 变量名称不能加$() ifdef RELEASE $(warning RELEASE defined) else $(warning RELEASE not defined) endif #ifeq 后面参数要叫$(), 因为是值引用, 值可以为数值或字符串 ifeq ($(RELEASE),abc) $(warning RELEASE eqal abc) else $(warning RELEASE not equal abc) endif all: @echo ok! ************************************************** make 编译不同版本,例如debug, release 的简单示例。 用make 变量ver, 控制CFLAGS 变量,从而编译出不同版本。 [/pts/2@hjj ~/test]$ cat test.c #include <stdio.h> #include <unistd.h> int main(int argc,char *argv[]) { char *tty=ttyname(0); printf("tty is %s\n",tty); return 0; } [/pts/2@hjj ~/test]$ cat Makefile CC = gcc TARGET = test OBJS = test.o ifeq ($(ver), debug) $(warning ver is debug) CFLAGS = -g -Ddebug else $(warning ver is not debug) CFLAGS = -c -O3 endif $(TARGET): $(OBJS) $(CC) -o $@ $^ clean: rm test test.o 注释: makefile 采用了ifeq-else-endif 结构 可以判别莫个make变量是否定义。 make变量可以在makefile中定义,也可以由make命令行传递。 由于makefile 支持环境变量,所以你预先定义了环境变量,也可以不在命令行中传递而直接使用环境变量 这种机制使得编写脚本控制不同的复杂的编译成为可能, 例如支持各种地域的不同的版本。用地域变量,控制make的编译选项/D,控制编译出不同的版本 ---------------------------------------- 编译debug 版本, 从命令行传递变量 ---------------------------------------- [/pts/2@hjj ~/test]$ make ver=debug Makefile:6: ver is debug gcc -g -Ddebug -c -o test.o test.c gcc -o test test.o ---------------------------------------- 清理,无所谓版本信息 ---------------------------------------- [/pts/2@hjj ~/test]$ make clean Makefile:9: ver is not debug rm test test.o ---------------------------------------- 编译release 版本 ---------------------------------------- [/pts/2@hjj ~/test]$ make Makefile:9: ver is not debug gcc -c -O3 -c -o test.o test.c gcc -o test test.o
战神伽罗
2019-07-24
7.6K
1
bochs compile 编译
makefile
c++
windows
unix
The standard compile uses the configure script, but the Windows platform cannot run the configure script natively. The current solution to this problem is that the Bochs configure script must be run on a different platform that does support shell scripts, with options that cause it to configure for a Win32 platform instead of the native one. Many people have access to a UNIX machine that could run the configure script, or you can use Cygwin or MinGW/MSYS to run the configure script. [3].
战神伽罗
2019-07-24
764
0
vscode基于Linux和Windows下c/c++的多文件编译与连接
javascript
ide
makefile
linux
gcc
cygwin64/home/xxx/.bash_profile ,末尾加上如下代码(后面vscodeMake.bat要用到环境变量"_T"):
战神伽罗
2019-07-24
2.8K
0
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
立即发文
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档