-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.28 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# SPDX-License-Identifier: Apache-2.0
# BFC Filesystem Kernel Module Makefile
obj-$(CONFIG_BFCFS) += bfcfs.o
bfcfs-y := fs/super.o \
fs/opts.o \
fs/index.o \
fs/inode.o \
fs/data.o \
fs/crypto.o \
fs/verify.o
ccflags-y += -I$(src)/include
# Development build (when built out-of-tree)
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_BFCFS=m modules
@echo "Module built: $(PWD)/bfcfs.ko"
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
rm -f *.mod.c .*.cmd .tmp_versions
find . -name "*.o" -delete 2>/dev/null || true
find . -name ".*.cmd" -delete 2>/dev/null || true
rm -rf .tmp_versions
install: default
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
help:
@echo "Available targets:"
@echo " default - Build the bfcfs kernel module"
@echo " clean - Clean build artifacts"
@echo " install - Install the module to system"
@echo " load - Load the module (requires sudo)"
@echo " unload - Unload the module (requires sudo)"
load: default
sudo insmod bfcfs.ko
@echo "Module loaded. Check dmesg for status."
unload:
sudo rmmod bfcfs
@echo "Module unloaded."
.PHONY: default clean install help load unload
endif