GNU Make. Why this complex syntax to generate dependencies?

后端 未结 3 736
醉梦人生
醉梦人生 2020-12-09 23:07

I\'m reading Managing Projects with GNU Make, and found this example in Chapter 2.7 - Automatic Dependency Generation. The Author says their from the GNU manual:

<         


        
3条回答
  •  醉话见心
    2020-12-09 23:24

    An even simpler solution is to get rid of the sed call completely, as gcc can do everything you need directly:

    %.d: %.c
            $(CC) -M $(CPPFLAGS) -MF $@ $< -MT "$*.o $@"
    

提交回复
热议问题