Add build/install scripts and improve README.

This commit is contained in:
Christian Deacon
2025-02-23 17:27:27 -05:00
parent f771412f6e
commit 816960bf39
9 changed files with 225 additions and 46 deletions

View File

@@ -111,6 +111,8 @@ xdp:
# LibXDP chain. We need to install objects here since our program relies on installed object files and such.
libxdp:
$(MAKE) -C $(XDP_TOOLS_DIR) libxdp
libxdp_install:
sudo $(MAKE) -C $(LIBBPF_SRC) install
sudo $(MAKE) -C $(LIBXDP_DIR) install
@@ -118,11 +120,6 @@ libxdp_clean:
$(MAKE) -C $(XDP_TOOLS_DIR) clean
$(MAKE) -C $(LIBBPF_SRC) clean
clean:
find $(BUILD_DIR) -type f ! -name ".*" -exec rm -f {} +
find $(BUILD_LOADER_DIR) -type f ! -name ".*" -exec rm -f {} +
find $(BUILD_XDP_DIR) -type f ! -name ".*" -exec rm -f {} +
install:
mkdir -p $(ETC_DIR)
cp -n xdpfw.conf.example $(ETC_DIR)/xdpfw.conf
@@ -132,5 +129,10 @@ install:
cp -f $(BUILD_LOADER_DIR)/$(LOADER_OUT) /usr/bin
cp -f $(BUILD_XDP_DIR)/$(XDP_OBJ) $(ETC_DIR)
clean:
find $(BUILD_DIR) -type f ! -name ".*" -exec rm -f {} +
find $(BUILD_LOADER_DIR) -type f ! -name ".*" -exec rm -f {} +
find $(BUILD_XDP_DIR) -type f ! -name ".*" -exec rm -f {} +
.PHONY: all libxdp
.DEFAULT: all