mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
lib: Add lib/util for adding utility library code
Add the directory and Makefile rules to prepare for storing library functions in lib/util like we do in xdp-tools. With this, library code can be added by just dropping the .c and .h into lib/util and updating lib/util/util.mk with the object name. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
This commit is contained in:
@@ -20,6 +20,9 @@ BPF_OBJ_INSTALL ?= $(BPF_OBJ)
|
||||
LIB_DIR ?= ../lib
|
||||
LDLIBS ?= $(USER_LIBS)
|
||||
|
||||
# get list of objects in util
|
||||
include $(LIB_DIR)/util/util.mk
|
||||
|
||||
include $(LIB_DIR)/defines.mk
|
||||
|
||||
# Extend if including Makefile already added some
|
||||
|
@@ -32,5 +32,5 @@ CFLAGS += $(DEFINES)
|
||||
BPF_CFLAGS += $(DEFINES)
|
||||
|
||||
CONFIGMK := $(LIB_DIR)/../config.mk
|
||||
LIBMK := Makefile $(CONFIGMK) $(LIB_DIR)/defines.mk $(LIB_DIR)/common.mk
|
||||
LIBMK := Makefile $(CONFIGMK) $(LIB_DIR)/defines.mk $(LIB_DIR)/common.mk $(LIB_DIR)/util/util.mk
|
||||
|
||||
|
2
lib/util/util.mk
Normal file
2
lib/util/util.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
# list of objects in this directory
|
||||
UTIL_OBJS :=
|
Reference in New Issue
Block a user