vpnhide/kmod/Makefile
Horizon cf4e72fa01
fix(build): port build scripts to Python to allow Windows contributors to build subprojects (#83)
* Rewrite build-version and all build-zip bash scripts to python

* Add executable permissions to python build scripts

* Use python build script for kmod in CI

* Fix

* Enhance kmod build script, add/fix docs, CI edits

* Delete remaining build-zip bash scripts

* Delete remaining build-zip bash scripts
2026-04-25 19:53:15 +03:00

38 lines
1,014 B
Makefile

obj-m += vpnhide_kmod.o
ifeq ($(KERNELRELEASE),)
# KERNEL_SRC and CLANG_DIR come from the environment (set via .env + direnv).
ifndef KERNEL_SRC
$(error KERNEL_SRC is not setcopy .env.example to .env and fill in paths)
endif
ifndef CLANG_DIR
$(error CLANG_DIR is not setcopy .env.example to .env and fill in paths)
endif
ARCH := arm64
CROSS_COMPILE := aarch64-linux-gnu-
CC := $(CLANG_DIR)/clang
LD := $(CLANG_DIR)/ld.lld
AR := $(CLANG_DIR)/llvm-ar
NM := $(CLANG_DIR)/llvm-nm
OBJCOPY := $(CLANG_DIR)/llvm-objcopy
OBJDUMP := $(CLANG_DIR)/llvm-objdump
STRIP := $(CLANG_DIR)/llvm-strip
MAKE_ARGS := -C $(KERNEL_SRC) M=$(CURDIR) \
ARCH=$(ARCH) LLVM=1 LLVM_IAS=1 \
CROSS_COMPILE=$(CROSS_COMPILE) \
CC=$(CC) LD=$(LD) AR=$(AR) NM=$(NM) \
OBJCOPY=$(OBJCOPY) OBJDUMP=$(OBJDUMP) STRIP=$(STRIP)
all:
$(MAKE) $(MAKE_ARGS) modules
strip: all
$(STRIP) -d $(CURDIR)/vpnhide_kmod.ko
clean:
$(MAKE) $(MAKE_ARGS) clean
endif