On Sun, Jun 26, 2011 at 05:05:34PM +0100, Måns Rullgård wrote: > Diego Biurrun <[email protected]> writes: > > > On Sat, Jun 25, 2011 at 05:45:17PM +0100, Mans Rullgard wrote: > >> These commands have the same form, and using a common macro allows > >> it to be used elsewhere without further duplication. > >> > >> --- a/Makefile > >> +++ b/Makefile > >> @@ -22,17 +22,23 @@ endif > >> > >> IFLAGS := -I. -I$(SRC_PATH) > >> CPPFLAGS := $(IFLAGS) $(CPPFLAGS) > >> -CFLAGS += $(ECFLAGS) > >> +CCFLAGS = $(CFLAGS) $(ECFLAGS) > > > > This will subtly change semantics because ECFLAGS will no longer have > > an effect where it used to: > > > >> +define COMPILE > >> + $($(1)DEP) > >> + $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $< > >> +endef > >> + > >> +COMPILE_C = $(call COMPILE,CC) > >> +COMPILE_S = $(call COMPILE,AS) > >> + > >> %.o: %.c > >> - $(CCDEP) > >> - $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $< > >> + $(COMPILE_C) > >> > >> %.o: %.S > >> - $(ASDEP) > >> - $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $< > >> + $(COMPILE_S) > >> > >> %.ho: %.h > >> $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< > > > > This rule is one such case. > > Good catch, missed that, although it seems like that's the only one. > Would you rather change that rule or leave CFLAGS as it is and add > CCFLAGS=CFLAGS?
If by "changing that rule" you mean adding ECFLAGS to the .ho rule, then I believe this is the slightly more brittle solution. It's easy to add another rule somewhere in some subdirectory Makefile and forget to add ECFLAGS there as well, so I tend to prefer the latter. Diego _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
