Skip to content

Commit

Permalink
lib/common.mk: support eBPF programs in nested directories
Browse files Browse the repository at this point in the history
The current build system sets the name of the generated skeleton directly
to the file's name minus the .skel.h suffix. In case the eBPF program
was in a nested directory, this leads to syntax errors in the skeleton
file. This commit support ebpf programs in nested directory by poping out
the directory part in the eBPF program name without breaking the build
of currently available eBPF program.

Signed-off-by: Jalal Mostafa <[email protected]>
  • Loading branch information
jalalmostafa authored and tohojo committed Sep 19, 2024
1 parent fb111a7 commit f8fffe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EXTRA_DEPS) $(BPF_HEADERS) $(LIBMK)
$(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}

$(BPF_SKEL_H): %.skel.h: %.bpf.o
$(QUIET_GEN)$(BPFTOOL) gen skeleton $< name ${@:.skel.h=} > $@
$(QUIET_GEN)$(BPFTOOL) gen skeleton $< name $(notdir ${@:.skel.h=}) > $@

.PHONY: man
ifeq ($(EMACS),)
Expand Down

0 comments on commit f8fffe4

Please sign in to comment.