[PATCH 02/10] bpf tools: Define LD and RM in Makefile for 'make -R'

From: Wang Nan
Date: Thu Dec 17 2015 - 00:25:32 EST


Building libbpf with 'make -R' causes error:

$ make -R

Auto-detecting system features:
... libelf: [ on ]
... bpf: [ on ]

CC fixdep.o
LD fixdep-in.o
/bin/sh: -r: command not found
make[2]: *** [fixdep-in.o] Error 127
make[1]: *** [fixdep-in.o] Error 2
make: *** [fixdep] Error 2

Makefile for libbpf requires $(LD) and $(RM), but in case of 'make -R'
the builtin variables are gone. This patch define default RM and LD so
it won't fail in 'make -R'.

Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/lib/bpf/Makefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 0b6e013..7bec12f 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -5,6 +5,8 @@ BPF_PATCHLEVEL = 0
BPF_EXTRAVERSION = 1

MAKEFLAGS += --no-print-directory
+RM ?= rm -f
+LD ?= $(CROSS_COMPILE)ld

ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
--
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/