makefile - GNU Make: sed doesn't work when piped inside of $(shell) -
here experimental makefile.
.secondexpansion: ~/hello.txt: $(shell echo '$$(@d)/')$(shell echo '$$(@f)' | sed -e 's/hello/bye/') echo "$^"
somehow sed command doesn't work, , make complains circular dependency
gmake: circular /users/sim/hello.txt <- /users/me/hello.txt dependency dropped. gmake: *** no rule make target `echo', needed `/users/me/hello.txt'. stop.
my expected behavior gnu make looking ~/bye.txt instead. doing wrong?
although can specify "bye.txt" explicitly in small example, i'd still know why sed command doesn't apply. thank help.
i don't understand why have $(shell echo '$$(@d)/')
; why not write $$(@d)/
directly?
as second one, doesn't work because $(shell ...)
function evaluated immediately, not during second expansion. need defer shell function writing $$(shell ...)
.
however, i'm not sure work. don't understand why you're doing this; assume there's larger context makes useful. because, can want above much more straightforwardly using static pattern rules:
~/hello.txt : %/hello.txt : %/bye.txt echo "$^"
Comments
Post a Comment