【发布时间】:2016-02-08 03:01:20
【问题描述】:
我有一个生成文件,我想从输入中读取文件名,然后根据它的名称生成其他名称。我试过下面的代码
mlext = .ml
testext = test.ml
nativeext = test.native
test:
@read -p "Enter file name: " file; \
echo $$file$(mlext); \
echo $$file$(testext); \
echo $$file$(nativeext)
例如:
如果我输入:foo
那我想得到foo.ml,footest.ml,footest.native
但是,我只能得到foo.ml。剩下的两个我只得到.ml和.native
我该如何解决这个问题?
【问题讨论】:
-
这种交互处理真的不是make的领域,有什么理由你不能接受输入变量,例如
make file=foo?
标签: makefile