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

边栏推荐
- [source code] VB6 chat robot
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
- ISBN number
- After the Lunar New Year and a half
- Axure resources and prototype tool Axure RP 9 download
- Alibaba cloud container service differentiation SLO hybrid technology practice
- [CSDN Q & A] experience and suggestions
- Several ways to set up a blog locally [attach relevant software download links]
- NLP Chinese corpus project: large scale Chinese natural language processing corpus
- 2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
猜你喜欢

A method to solve Bert long text matching

2022 system integration project management engineer examination knowledge points: software development model

(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises

MySQL winter vacation self-study 2022 12 (1)

STM32 key light

Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution

Axure resources and prototype tool Axure RP 9 download

Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
![[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

Reading notes on how programs run
随机推荐
Smart fan system based on stm32f407
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
D23:multiple of 3 or 5 (multiple of 3 or 5, translation + solution)
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
Global and Chinese market of process beer equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Idea integrates Microsoft TFs plug-in
2022 system integration project management engineer examination knowledge points: software development model
SPI based on firmware library
【leetcode】374. Guess the size of the number
[C language] break and continue in switch statement
Gossip about redis source code 77
Docking Alipay process [pay in person, QR code Payment]
P1339 [USACO09OCT]Heat Wave G
挖财帮个人开的证券账户安全吗?是不是有套路
A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
Speed up the energy Internet of things. What can low-power Internet of things technology represented by Zeta do?
leetcode-43. String multiplication
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
D27:mode of sequence (maximum, translation)