当前位置:网站首页>Makefile separates file names and suffixes
Makefile separates file names and suffixes
2022-07-02 14:34:00 【Ayka】
Reference resources Get filename without extension within makefile - Stack Overflow
https://stackoverflow.com/questions/13995906/get-filename-without-extension-within-makefile And GNU make 8.3 Functions for File Names
https://www.gnu.org/software/make/manual/make.html#File-Name-Functions The minimum example is as follows :
SRCNAME = $(basename bar_1.foo.c)
SRCTYPE = $(suffix bar_1.foo.c)The result is SRCNAME yes bar_1.foo,SRCTYPE yes .c( Note that the suffix here contains periods ).
Practical examples are as follows :
SRCNAME = $(basename $(SRC))
SRCTYPE = $(suffix $(SRC))
all:
ifeq ($(SRCTYPE),.s)
all: assembly
else ifeq ($(SRCTYPE),.c)
all: program
else
$(error Source file suffix must be *.c or *.s)
endif
assembly:
@echo ASM
program:
@echo C
Notice the second and third here all target Do not add indents , Reference resources conditional - How do you conditionally call a target based on a target variable (Makefile)? - Stack Overflow
Be careful ifeq No space can be added before or after the comma of the condition , Add only one at the end endif.
For example, if you execute
make SRC=rv32_fib.sWill output
ASM
边栏推荐
- [QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
- Development and design of animation surrounding mall sales website based on php+mysql
- Check password
- taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
- Yolov3 & yolov5 output result description
- Understanding of mongodb
- C crystal report printing
- The use of TestNG, the testing framework (II): the use of TestNG XML
- STM32 library function for GPIO initialization
- Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
猜你喜欢

Method of creating linked server for cross server data access

Fabric. JS free draw circle

<口算练习机 方案开发原理图>口算练习机/口算宝/儿童数学宝/儿童计算器 LCD液晶显示驱动IC-VK1621B,提供技术支持

STM32库函数进行GPIO初始化

Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'

Dangbei projection 4K laser projection X3 Pro received unanimous praise: 10000 yuan projector preferred

2022 home projector preferred! Dangbei F5 brings the ultimate audio-visual experience with its powerful audio-visual effect

Do you know that there is an upper limit on the size of Oracle data files?

< schéma de développement de la machine d'exercice oral > machine d'exercice oral / trésor d'exercice oral / trésor de mathématiques pour enfants / lecteur LCD de calculatrice pour enfants IC - vk1621

Pychart connects to the remote server
随机推荐
Fabric. JS upper dash, middle dash (strikethrough), underline
Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
卷积神经网络(入门)
测试框架TestNG的使用(二):testNG xml的使用
taobao.trade.get( 获取单笔交易的部分信息),淘宝店铺订单接口,淘宝oAuth2.0接口,淘宝R2接口代码对接分享
Methods of software testing
一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)
PTA question bank== > complex four operations, one for one, examination seat number (7-73)
Data Lake (11): Iceberg table data organization and query
taobao.trade.memo.add( 对一笔交易添加备注 )接口,淘宝店铺插旗接口,淘宝订单插旗API接口,oAuth2.0接口
Talk about idempotent design
PTA题库 ===>复数四则运算,一帮一,考试座位号(7-73)
Golang 快速生成数据库表的 model 和 queryset
STM32库函数进行GPIO初始化
Design and implementation of car query system based on php+mysql
Xilinx Vivado set *.svh as SystemVerilog Header
Chinese science and technology from the Winter Olympics (III): the awakening and evolution of digital people
1、编辑利器vim
跨服务器数据访问的创建链接服务器方法
删除元素(带过渡动画)