> > OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) > > only > > knows the name of ${.IMPSRC} and ${.TARGET} > > Actually it would do no harm for bsd.prog.mk (IIRC) to define an > explicit dependency when it generates ${OBJS} from ${SRCS}. > Make will use the rules from the appropriate suffix rule, but > it will force the specific dependency. > > So if SRCS contains foo.c the will be built, even if there is a foo.S
I was unclear; I meant "you can't pass per-target (${PROG} / ${LIB}) parameters to ${CC} directly". And yes, it's actually possible to append ${CPPFLAGS.foo} to ${CPPFLAGS.foo_src_a.c}, ${CPPFLAGS.foo_src_b.c}, ... by using .for. I don't think that is worth bothering. I can also think of odd situations where you share one source among multiple targets: PROGS=foo bar SRCS.foo=foo.c common.c SRCS.bar=bar.c common.c CPPFLAGS.foo=-Dfoo CPPFLAGS.bar=-Dbar Think how common.o will be built... Masao -- Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635