[CRIU] [PATCH 1/9] nmk: rules.mk -- Drop @CFLAGS_ and @ASFLAGS_ but add ability to bring them via param

Dmitry Safonov dsafonov at virtuozzo.com
Mon Mar 21 06:16:32 PDT 2016


On 03/21/2016 03:12 PM, Cyrill Gorcunov wrote:
> Both are never worked, we need to pass them as explicit parameter.
So, you didn't use forth parameter for gen-rule-* in this patches,
how it supposed to be used?
I mean, currently they are used for expanding rules inside nmk;
in normal makefiles, you use CFLAGS/AFLAGS for objects, but
it's not expected to meet some gen-rule-* there (where one needs
some gen-rule- outside nmk, it seems to be custom rule, not
a basic as .c file to .o)
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>   scripts/nmk/scripts/rules.mk | 32 ++++++++++++++++----------------
>   1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/scripts/nmk/scripts/rules.mk b/scripts/nmk/scripts/rules.mk
> index e589e449954d..04c9a7e49547 100644
> --- a/scripts/nmk/scripts/rules.mk
> +++ b/scripts/nmk/scripts/rules.mk
> @@ -3,49 +3,49 @@ ifndef ____nmk_defined__rules
>   #
>   # Accumulate common flags.
>   define nmk-ccflags
> -        $(CFLAGS) $(ccflags-y) $(CFLAGS_$@)
> +        $(CFLAGS) $(ccflags-y)
>   endef
>   
>   define nmk-asflags
> -        $(CFLAGS) $(ASFLAGS) $(asflags-y) $(ASFLAGS_$@)
> +        $(CFLAGS) $(ASFLAGS) $(asflags-y)
>   endef
>   
>   #
>   # General rules.
>   define gen-rule-o-from-c-by-name
> -$(1).o: $(2).c
> +$(1).o: $(2).c $(3)
>   	$$(call msg-cc, $$@)
> -	$$(Q) $$(CC) -c $$(strip $$(nmk-ccflags)) $$< -o $$@
> +	$$(Q) $$(CC) -c $$(strip $$(nmk-ccflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-i-from-c-by-name
> -$(1).i: $(2).c
> +$(1).i: $(2).c $(3)
>   	$$(call msg-cc, $$@)
> -	$$(Q) $$(CC) -E $$(strip $$(nmk-ccflags)) $$< -o $$@
> +	$$(Q) $$(CC) -E $$(strip $$(nmk-ccflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-s-from-c-by-name
> -$(1).s: $(2).c
> +$(1).s: $(2).c $(3)
>   	$$(call msg-cc, $$@)
> -	$$(Q) $$(CC) -S -fverbose-asm $$(strip $$(nmk-ccflags)) $$< -o $$@
> +	$$(Q) $$(CC) -S -fverbose-asm $$(strip $$(nmk-ccflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-o-from-S-by-name
> -$(1).o: $(2).S
> +$(1).o: $(2).S $(3)
>   	$$(call msg-cc, $$@)
> -	$$(Q) $$(CC) -c $$(strip $$(nmk-asflags)) $$< -o $$@
> +	$$(Q) $$(CC) -c $$(strip $$(nmk-asflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-d-from-c-by-name
> -$(1).d: $(2).c
> +$(1).d: $(2).c $(3)
>   	$$(call msg-dep, $$@)
> -	$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(strip $$(nmk-ccflags)) $$< -o $$@
> +	$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(strip $$(nmk-ccflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-d-from-S-by-name
> -$(1).d: $(2).S
> +$(1).d: $(2).S $(3)
>   	$$(call msg-dep, $$@)
> -	$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(strip $$(nmk-asflags)) $$< -o $$@
> +	$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(strip $$(nmk-asflags)) $(4) $$< -o $$@
>   endef
>   define gen-rule-i-from-S-by-name
> -$(1).i: $(2).S
> +$(1).i: $(2).S $(3)
>   	$$(call msg-cc, $$@)
> -	$$(Q) $$(CC) -E $$(strip $$(nmk-asflags)) $$< -o $$@
> +	$$(Q) $$(CC) -E $$(strip $$(nmk-asflags)) $(4) $$< -o $$@
>   endef
>   
>   #


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list