mirror of
https://github.com/okhsunrog/vpnhide.git
synced 2026-05-03 00:52:41 +00:00
* 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
38 lines
1,014 B
Makefile
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 set — copy .env.example to .env and fill in paths)
|
|
endif
|
|
ifndef CLANG_DIR
|
|
$(error CLANG_DIR is not set — copy .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
|