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.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to