Skip to content

Commit 1739caf

Browse files
jinghao-jiaBenjamin Tissoires
authored andcommitted
samples/hid: remove unnecessary -I flags from libbpf EXTRA_CFLAGS
Commit 5a6ea70 ("samples/bpf: Remove unnecessary -I flags from libbpf EXTRA_CFLAGS") fixed the build error caused by redundant include path for samples/bpf, but not samples/hid. Apply the same fix on samples/hid as well. Fixes: 13b2548 ("kbuild: change working directory to external module directory with M=") Tested-by: Ruowen Qin <[email protected]> Signed-off-by: Jinghao Jia <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 9271af9 commit 1739caf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

samples/hid/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@ BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-generic
4040
endif
4141
endif
4242

43-
TPROGS_CFLAGS += -Wall -O2
44-
TPROGS_CFLAGS += -Wmissing-prototypes
45-
TPROGS_CFLAGS += -Wstrict-prototypes
43+
COMMON_CFLAGS += -Wall -O2
44+
COMMON_CFLAGS += -Wmissing-prototypes
45+
COMMON_CFLAGS += -Wstrict-prototypes
4646

47+
TPROGS_CFLAGS += $(COMMON_CFLAGS)
4748
TPROGS_CFLAGS += -I$(objtree)/usr/include
4849
TPROGS_CFLAGS += -I$(LIBBPF_INCLUDE)
4950
TPROGS_CFLAGS += -I$(srctree)/tools/include
5051

5152
ifdef SYSROOT
52-
TPROGS_CFLAGS += --sysroot=$(SYSROOT)
53+
COMMON_CFLAGS += --sysroot=$(SYSROOT)
5354
TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib
5455
endif
5556

@@ -112,7 +113,7 @@ clean:
112113

113114
$(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUTPUT)
114115
# Fix up variables inherited from Kbuild that tools/ build system won't like
115-
$(MAKE) -C $(LIBBPF_SRC) RM='rm -rf' EXTRA_CFLAGS="$(TPROGS_CFLAGS)" \
116+
$(MAKE) -C $(LIBBPF_SRC) RM='rm -rf' EXTRA_CFLAGS="$(COMMON_CFLAGS)" \
116117
LDFLAGS=$(TPROGS_LDFLAGS) srctree=$(HID_SAMPLES_PATH)/../../ \
117118
O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= \
118119
$@ install_headers

0 commit comments

Comments
 (0)