当前位置:网站首页>Makefile judge custom variables
Makefile judge custom variables
2022-07-04 00:20:00 【Original ten】
We know makefile The judgment variable in is ifeq, This ifeq It can judge the variables passed in from the command line , And you can judge makefile Customized variables in .
ifeq ($(platform), )
files:=$(foreach directory, $(dirs), $(wildcard $(directory)/*.config))
OBJ:=$(notdir $(files))
else
$(info no such platform of $(platform)) # You need to write in the top box
##### If it's not empty , The description defines the compilation platform , Get from the specified platform
files:= $(foreach directory, $(dirs), $(wildcard $(directory)/$(platform)*.config))
ifeq ("$(files)", " ") # If the above match fails, a space will be returned , Not empty
$(error no such files of $(files)) # You need to write in the top box
else
OBJ:= $(notdir $(files))
endif
endif
As above ifeq ($(platform), ) Is a judgment platform Is it empty , This can be passed in from the command line parameter , Such as make platform=hisiv200. and ifeq ("$(files)", " ") Is the judgment variable files Whether it is a space , This judgment is because foreach and wildcard When used together , When the result cannot be matched , It returns a space . Use alone wildcard And if it doesn't match, it will return null , You can use ifeq ($(files), ) Judge .
边栏推荐
- Is the account opening of Guoyuan securities really safe and reliable
- 【leetcode】374. Guess the size of the number
- D30:color tunnels (color tunnels, translation)
- Similarities and differences of text similarity between Jaccard and cosine
- How to trade spot gold safely?
- Recommendation of knowledge base management system
- Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
- STM32 GPIO CSDN creative punch in
- Private project practice sharing populate joint query in mongoose makes the template unable to render - solve the error message: syntaxerror: unexpected token r in JSON at
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
猜你喜欢
STM32 key light
Alibaba cloud container service differentiation SLO hybrid technology practice
Docking Alipay process [pay in person, QR code Payment]
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Detailed explanation of the relationship between Zhongtai, wechat and DDD
Double efficiency. Six easy-to-use pychar plug-ins are recommended
[Mongodb] 2. Use mongodb --------- use compass
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
Correlation analysis summary
Test the influence of influent swacth on the electromagnetic coil of quartz meter
随机推荐
[MySQL] sql99 syntax to realize multi table query
Tencent interview: can you find the number of 1 in binary?
[NLP] text classification still stays at Bert? Duality is too strong than learning framework
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
The interviewer's biggest lie to deceive you, bypassing three years of less struggle
Suggestions for improving code quality
How to make recv have a little temper?
Is the account opening of Guoyuan securities really safe and reliable
How will the complete NFT platform work in 2022? How about its core functions and online time?
Unity elementary case notes of angry birds Siki college 1-6
D24:divisor and multiple (divisor and multiple, translation + solution)
Distributed transaction -- middleware of TCC -- selection / comparison
Stock price forecast
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
Gossip about redis source code 75
Selenium library 4.5.0 keyword explanation (II)
Recommendation of knowledge base management system
Analysis: misunderstanding of choosing WMS warehouse management system
Axure resources and prototype tool Axure RP 9 download