aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHuangbin Zhan <zhanhb88@gmail.com>2021-11-18 19:37:10 +0800
committerFelix Fietkau <nbd@nbd.name>2021-11-21 13:47:18 +0100
commit1126855911226e44fd7ba5f3b15df14cf4faf57f (patch)
tree58d06b86534fa743f6941131bbc6c219080f885d /tools
parent848499c1cf2c55adf8f3e0e355caa07234803cbe (diff)
downloadupstream-1126855911226e44fd7ba5f3b15df14cf4faf57f.tar.gz
upstream-1126855911226e44fd7ba5f3b15df14cf4faf57f.tar.bz2
upstream-1126855911226e44fd7ba5f3b15df14cf4faf57f.zip
tools/llvm-bpf: make sure llvm-bpf.tar.gz is created
The llvm-bpf-$version.tar.xz might be absent. For example `make clean` executed, CONFIG_TARGET changed. This commit can only guarantee that the target file can be built when tools/compile is explicitly called rather than $(tools/stamp-compile). Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-bpf/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
index a9fcc04495..4b4e67e201 100644
--- a/tools/llvm-bpf/Makefile
+++ b/tools/llvm-bpf/Makefile
@@ -41,21 +41,22 @@ CMAKE_HOST_OPTIONS += \
-DLLVM_TOOLCHAIN_TOOLS="llvm-objcopy;llvm-objdump;llvm-readelf;llvm-strip;llvm-ar;llvm-as;llvm-dis;llvm-link;llvm-nm;llvm-ranlib;llc;opt" \
-DCMAKE_SKIP_RPATH=OFF
-ifneq ($(CONFIG_SDK_LLVM_BPF),)
- define Host/Install/Bin
+$(BIN_DIR)/llvm-bpf-$(PKG_VERSION).tar.xz: $(HOST_STAMP_INSTALLED)
echo "$(PKG_VERSION)" > $(CMAKE_HOST_INSTALL_PREFIX)/.llvm-version
STRIP_KMOD= PATCHELF= STRIP=strip $(SCRIPT_DIR)/rstrip.sh $(STAGING_DIR_HOST)/llvm-bpf
tar -C $(STAGING_DIR_HOST) \
-I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' \
- -cf $(BIN_DIR)/llvm-bpf-$(PKG_VERSION).tar.xz llvm-bpf $(LLVM_BPF_PREFIX)
- endef
+ -cf $@.tmp llvm-bpf $(LLVM_BPF_PREFIX)
+ mv $@.tmp $@
+
+ifneq ($(CONFIG_SDK_LLVM_BPF),)
+compile: $(BIN_DIR)/llvm-bpf-$(PKG_VERSION).tar.xz
endif
define Host/Install
rm -rf $(STAGING_DIR_HOST)/llvm-bpf*
$(Host/Install/Default)
ln -s $(LLVM_BPF_PREFIX) $(STAGING_DIR_HOST)/llvm-bpf
- $(Host/Install/Bin)
endef
define Host/Uninstall