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:
Toke Høiland-Jørgensen
2021-06-01 17:16:24 +02:00
parent 3bc8e68636
commit b0536ce4ec
3 changed files with 6 additions and 1 deletions

View File

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

View File

@@ -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
View File

@@ -0,0 +1,2 @@
# list of objects in this directory
UTIL_OBJS :=