学习Makefile第五课------使用判断条件
来源:互联网 发布:淘宝消费群体分析 编辑:程序博客网 时间:2024/04/30 21:21
1.示例
ibs_for_gcc = -lgnu
normal_libs =
foo: $(objects)
ifeq ($(CC),gcc) ----------------------如果objects = gcc ,执行$(CC) -o foo $(objects) $(libs_for_gcc) ,否则执行else里面的语句
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif
2.语法
条件表达式的语法为:
<conditional-directive>
<text-if-true>
endif
以及:
<conditional-directive>
<text-if-true>
else
<text-if-false>
endif
(1)ifeq
ifeq (<arg1>, <arg2>) ---------arg1和arg2相同为真
(2)ifneq
ifneq (<arg1>, <arg2>) -------不同为真
(3)ifdef
ifdef <variable-name> ---------值非空,为真
(4)ifndef
ifndef <variable-name>---------和“ifdef”是相反的意思
最好不要使用自动变量,也不要分成多个文件
ibs_for_gcc = -lgnu
normal_libs =
foo: $(objects)
ifeq ($(CC),gcc) ----------------------如果objects = gcc ,执行$(CC) -o foo $(objects) $(libs_for_gcc) ,否则执行else里面的语句
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif
2.语法
条件表达式的语法为:
<conditional-directive>
<text-if-true>
endif
以及:
<conditional-directive>
<text-if-true>
else
<text-if-false>
endif
(1)ifeq
ifeq (<arg1>, <arg2>) ---------arg1和arg2相同为真
(2)ifneq
ifneq (<arg1>, <arg2>) -------不同为真
(3)ifdef
ifdef <variable-name> ---------值非空,为真
(4)ifndef
ifndef <variable-name>---------和“ifdef”是相反的意思
最好不要使用自动变量,也不要分成多个文件
0 0
- 学习Makefile第五课------使用判断条件
- Makefile学习之使用条件判断
- makefile使用条件判断
- Makefile --使用条件判断
- Makefile学习笔记<条件判断>
- Makefile (七) 使用条件判断
- linux下Makefile学习之五(使用条件判断)
- UNIX学习笔记----makefile之条件判断
- makefile变量使用及其条件判断
- MakeFile精华【五】--使用条件判断
- makefile详解 (七) 使用条件判断
- make(六)makefile中使用条件判断
- Makefile 条件判断
- Makefile 条件判断
- makefile--条件判断
- makefile中的条件判断
- makefile条件判断
- Makefile详解-条件判断
- SQL表结构复制及表数据复制
- 常见查看LINUX配置命令
- ASD啊实打实的热问题予以分割成不成v
- Source Insight 注释快捷键的宏添加
- startActivity(intent);然后finish();和finish();然后startActivity(intent);
- 学习Makefile第五课------使用判断条件
- SSL证书支持多个域名吗?多域名证书与通配型证书有什么不同吗?
- Oracle 增加修改删除字段
- 完全背包 poj 1384 Piggy-Bank
- 常用的工具方法
- 附近阿里减肥辣椒粉来减肥
- MotionEvent对象
- linux设置开机服务自动启动/关闭自动启动命令
- Android:Dom解析XML