1
0

Makefile 754 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # Copyright (C) 2021 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. override MAKEFLAGS=
  9. LLVM_VERSION := $(shell cat $(STAGING_DIR_HOST)/llvm-bpf/.llvm-version)
  10. LLVM_BPF_PREFIX := llvm-bpf-$(LLVM_VERSION).$(HOST_OS)-$(HOST_ARCH)
  11. LLVM_TAR := $(BIN_DIR)/$(LLVM_BPF_PREFIX).tar.xz
  12. $(LLVM_TAR): $(STAGING_DIR_HOST)/llvm-bpf/.llvm-version
  13. tar -C $(STAGING_DIR_HOST) \
  14. -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' \
  15. $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
  16. -cf $@.tmp llvm-bpf $(LLVM_BPF_PREFIX)
  17. mv $@.tmp $@
  18. download:
  19. prepare:
  20. compile: $(LLVM_TAR)
  21. install: compile
  22. clean:
  23. rm -f $(LLVM_TAR)