makefile で notdir を使ってみたのでその時のメモをここに残します。
notdir はディレクトリ以外を抽出します。
コード
$ cat Makefile VAR := ../a/b/c/test.txt .PHONY: all all: @echo "$(notdir $(VAR))"
実行結果
「../a/b/c/test.txt」が「test.txt」と表示されます。
$ make test.txt
makefile で notdir を使ってみたのでその時のメモをここに残します。
notdir はディレクトリ以外を抽出します。
$ cat Makefile VAR := ../a/b/c/test.txt .PHONY: all all: @echo "$(notdir $(VAR))"
「../a/b/c/test.txt」が「test.txt」と表示されます。
$ make test.txt