分页: 1 / 1

问个makefile和shell的问题

发表于 : 2009-05-15 10:46
snaildr
Here is the pattern rule to generate a file of dependencies (i.e., a makefile)

called `name.d' from a C source file called `name.c':
%.d: %.c
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< | sed '\"s/$*.o/& $@/g'\" > $@'



不太明白sed里面的 \"是什么意思啊?





sed跟make都不熟悉,弱问,多谢!!

Re: 问个makefile和shell的问题

发表于 : 2009-05-15 10:53
yaoms

代码: 全选

$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< | sed '\''s/$*.o/& $@/g'\'' > $@'
这样才是正确的。

Re: 问个makefile和shell的问题

发表于 : 2009-05-15 13:15
snaildr
双引号改成两个单引号??