我有以下代码的makefile:
.PHONY: $(PROJECTDIR)/projectroot
$(PROJECTDIR)/projectroot:
if [ -f $(@)/etc/release ]; then \
#$(RELEASE_VERSION) will have value something like 00.01.02.03
IFS=. read major minor micro build <<<"${RELEASE_VERSION}" \
echo major=${major} > $(@)/etc/release \
echo major=${minor} >> $(@)/etc/release; \
echo major=${micro} >> $(@)/etc/release; \
echo major=${build} >> $(@)/etc/release; \
fi
我期待 $(@)/etc/release 获得如下内容:
major=00
minor=01
micro=02
build=03
我需要更换 IFS=。使用 gnu make 中的一些等效命令,你能帮我解决这个问题吗?谢谢。