Files
OS/lab6/Makefile
2025-04-23 21:29:23 +08:00

30 lines
503 B
Makefile

obj-m += mypipe.o
OUT_DIR := build
.PHONY: all kern_mod install uninstall clean reader writer
all: kern_mod
@true
kern_mod: mypipe.c
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) MO=$(PWD)/build/kern
install:
insmod ./build/mypipe.ko
uninstall:
rmmod mypipe
reader:
mkdir -p $(OUT_DIR)
gcc pipe_read.c -o $(OUT_DIR)/pread
writer:
mkdir -p $(OUT_DIR)
gcc pipe_write.c -o $(OUT_DIR)/pwrite
clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
rm -rf $(OUT_DIR)