Skip to content

Commit

Permalink
test/bpf: Fix compilation with V=0
Browse files Browse the repository at this point in the history
When the quiet mode was enabled, the $(CLANG) var would previously have
a '@' at the start, which caused errors while attempting to make in this
directory because it would be run in the context of a shell rather than
directly as a make instruction. Move the $(QUIET) to the start of
individual make instructions to resolve this compilation failure.

Signed-off-by: Joe Stringer <joe@cilium.io>
  • Loading branch information
joestringer committed Jun 3, 2022
1 parent 8d384d2 commit 82d5adc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BPF_LLC_FLAGS := -march=bpf -mcpu=probe -filetype=obj

LIB := $(shell find ../../bpf/ -name '*.h')

CLANG ?= $(QUIET) clang
CLANG ?= clang
LLC ?= llc

BPF_TARGETS := elf-demo.o
Expand All @@ -35,11 +35,11 @@ all: $(TARGETS) unit-tests

elf-demo.o: elf-demo.c
@$(ECHO_CC)
$(CLANG) ${FLAGS_CLANG} ${BPF_CC_FLAGS} -c $< -o - | $(LLC) ${BPF_LLC_FLAGS} -o $@
$(QUIET) $(CLANG) ${FLAGS_CLANG} ${BPF_CC_FLAGS} -c $< -o - | $(LLC) ${BPF_LLC_FLAGS} -o $@

%: %.c $(LIB)
@$(ECHO_CC)
$(CLANG) ${FLAGS_CLANG} ${FLAGS} -I../../bpf/ $< -o $@
$(QUIET) $(CLANG) ${FLAGS_CLANG} ${FLAGS} -I../../bpf/ $< -o $@

mocks:
$(QUIET)$(MAKE) -C $(ROOT_DIR)/bpf/mock generate_helper_headers
Expand Down

0 comments on commit 82d5adc

Please sign in to comment.