当前位置:网站首页>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
边栏推荐
- Method of creating linked server for cross server data access
- go操作redis
- docker mysql
- NLA自然语言分析实现数据分析零门槛
- < 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
- 1、编辑利器vim
- Tujia muniao meituan has a discount match in summer. Will it be fragrant if the threshold is low?
- 篇9:XShell免费版安装
- PTA question bank== > complex four operations, one for one, examination seat number (7-73)
- TeamTalk源码分析之win-client
猜你喜欢

抓包工具fiddler学习

Analysis of CPU surge in production environment service

【空间&单细胞组学】第1期:单细胞结合空间转录组研究PDAC肿瘤微环境

Quick analysis: easy to share the Internet

Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022

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

一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)

大顶堆、小顶堆与堆排序

PyQt5_QScrollArea内容保存成图片

YoloV6训练:训练自己数据集遇到的各种问题
随机推荐
Method of creating linked server for cross server data access
NLA自然语言分析,让数据分析更智能
实现一个多进程并发的服务器
kaggle如何使用utility script
一张图彻底掌握prototype、__proto__、constructor之前的关系(JS原型、原型链)
STM32 standard firmware library function name (I)
Understanding of mongodb
OpenCV调用USB摄像头的点滴
软件测试的方法
快解析:轻松实现共享上网
STM32-DAC实验&高频DAC输出测试
Fabric. JS dynamically set font size
NLA natural language analysis realizes zero threshold of data analysis
NLA natural language analysis makes data analysis more intelligent
篇9:XShell免费版安装
没有从远程服务器‘‘映射到本地用户‘(null)/sa‘的远程用户‘sa‘及服务主密码解密错误的解决办法
天猫商品详情接口(APP,H5端)
Tip: SQL Server blocked the state 'openrowset/opendatasource' of component 'ad hoc distributed queries'
Development and design of animation surrounding mall sales website based on php+mysql
Yolov3 & yolov5 output result description