当前位置:网站首页>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
endifAs 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 .

边栏推荐
- Selenium library 4.5.0 keyword explanation (I)
- Double efficiency. Six easy-to-use pychar plug-ins are recommended
- Entropy and full connection layer
- Subgraph isomorphism -subgraph isomorphism
- Amway by head has this project management tool to improve productivity in a straight line
- system. Exit (0) and system exit(1)
- Correlation analysis summary
- A method to solve Bert long text matching
- Enter MySQL in docker container by command under Linux
- IO flow principle and classification
猜你喜欢

The difference between objects and objects

It is forbidden to splice SQL in code

Smart fan system based on stm32f407
![[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!](/img/28/fc05f2e8d53cf81fd061c799090022.jpg)
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

SPI based on firmware library

2022 examination of safety production management personnel of hazardous chemical production units and examination skills of safety production management personnel of hazardous chemical production unit

2022 t elevator repair registration examination and the latest analysis of T elevator repair

I wrote a chat software with timeout connect function
随机推荐
Gossip about redis source code 73
URL (data:image/png; Base64, ivborw0k... Use case
[leetcode] interview question 17.08 Circus tower
Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
Selenium library 4.5.0 keyword explanation (I)
(Video + graphics and text) introduction to machine learning series - Chapter 4 naive Bayes
想请教一下,十大劵商如何开户?在线开户是安全么?
Global and Chinese market of breast cancer imaging 2022-2028: Research Report on technology, participants, trends, market size and share
Tencent interview: can you find the number of 1 in binary?
The interviewer's biggest lie to deceive you, bypassing three years of less struggle
Recommendation of knowledge base management system
国元证券开户是真的安全可靠吗
Joint examination of six provinces 2017
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
The difference between objects and objects
2022 system integration project management engineer examination knowledge points: software development model
Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
Is the low commission link on the internet safe? How to open an account for China Merchants Securities?
No qualifying bean of type ‘com. netflix. discovery. AbstractDiscoveryClientOptionalArgs<?>‘ available
Development and application of fcitx functional plug-ins