当前位置: 技术问答>linux和unix
Makefile 中数字判断 熟悉makefile的大侠帮帮忙
来源: 互联网 发布时间:2017-05-10
本文导语: 需要对makefile中的某个变量判断是否全为数字,熟悉makefile的大侠帮帮忙!!! | var1=12345 var2=v12.3b all: @echo ================== ifeq ($(shell echo $(var1) |sed 's/[0-9]//g'),) @echo $(var1) only contain numbers else @echo...
需要对makefile中的某个变量判断是否全为数字,熟悉makefile的大侠帮帮忙!!!
|
var1=12345
var2=v12.3b
all:
@echo ==================
ifeq ($(shell echo $(var1) |sed 's/[0-9]//g'),)
@echo $(var1) only contain numbers
else
@echo $(var1) contain other characters
endif
ifeq ($(shell echo $(var2) |sed 's/[0-9]//g'),)
@echo $(var2) only ocntain numbers
else
@echo $(var2) contain other characters
endif