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

边栏推荐
- Is the low commission link on the internet safe? How to open an account for China Merchants Securities?
- Gossip about redis source code 76
- What does redis do? Redis often practices grammar every day
- Qtcharts notes (V) scatter diagram qscatterseries
- Suggestions for improving code quality
- system. Exit (0) and system exit(1)
- Tencent interview: can you pour water?
- 国元证券开户是真的安全可靠吗
- P3371 [template] single source shortest path (weakened version)
- Global and Chinese market of process beer equipment 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

The difference between objects and objects

The interviewer's biggest lie to deceive you, bypassing three years of less struggle

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

Deep learning ----- using NN, CNN, RNN neural network to realize MNIST data set processing
![P3371 [template] single source shortest path (weakened version)](/img/c5/bcb22e1ea573253005e56ebbd73bb7.jpg)
P3371 [template] single source shortest path (weakened version)
![[PHP basics] session basic knowledge, application case code and attack and defense](/img/f5/713d7044a693ef23e3fbb1ff9bc9f4.jpg)
[PHP basics] session basic knowledge, application case code and attack and defense

Regular expressions and text processors for shell programming

It is forbidden to splice SQL in code

How to make recv have a little temper?

Analysis: misunderstanding of choosing WMS warehouse management system
随机推荐
Reading notes on how programs run
Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
Global and Chinese market of glossometer 2022-2028: Research Report on technology, participants, trends, market size and share
Vscode regular match replace console log(.*)
2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
Analysis on the scale of China's smart health industry and prediction report on the investment trend of the 14th five year plan 2022-2028 Edition
Investment demand and income forecast report of China's building ceramics industry, 2022-2028
[BSP video tutorial] stm32h7 video tutorial phase 5: MDK topic, system introduction to MDK debugging, AC5, AC6 compilers, RTE development environment and the role of various configuration items (2022-
Stock price forecast
Gossip about redis source code 78
网上的低佣金链接安全吗?招商证券怎么开户?
D28:maximum sum (maximum sum, translation)
Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
Analysis of refrigeration and air conditioning equipment operation in 2022 and examination question bank of refrigeration and air conditioning equipment operation
How to make recv have a little temper?
Gossip about redis source code 75
Correlation analysis summary
Global and Chinese markets of distributed control system (DCS) consumption 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
CSP window