diff mbox

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

Message ID 1450329794-161948-3-git-send-email-wangnan0@huawei.com
State New
Headers show

Commit Message

Wang Nan Dec. 17, 2015, 5:23 a.m. UTC
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@huawei.com>

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/bpf/Makefile | 2 ++
 1 file changed, 2 insertions(+)

-- 
1.8.3.4

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

Patch

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)))