1srcs := a.cc b.cc c.cc 2srcs := $(addprefix ./,$(srcs)) 3objs := $(patsubst ./%.cc,./%.o,$(srcs)) 4 5test: out 6 7out: $(objs) 8 9$(objs): ./%.o: ./%.cc 10 echo $@: $<: $^ 11 12a.o: a.cc a.h 13b.o: b.cc a.h b.h 14c.o: b.cc a.h b.h c.h 15 16