Commit 43ca4548079386acab597d8b31b30c9440d6bc1c
1 parent
f41a8425
Attempt to make install target function.
Showing
1 changed file
with
12 additions
and
3 deletions
module/Makefile
| 1 | 1 | # Comment/uncomment the following line to disable/enable debugging |
| 2 | 2 | #DEBUG = y |
| 3 | 3 | |
| 4 | - | |
| 5 | 4 | # Add your debugging flag (or not) to CFLAGS |
| 6 | 5 | ifeq ($(DEBUG),y) |
| 7 | 6 | DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines |
| ... | ... | @@ -21,21 +20,31 @@ else |
| 21 | 20 | |
| 22 | 21 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build |
| 23 | 22 | PWD := $(shell pwd) |
| 23 | +KBASE := /lib/modules/$(KVER) | |
| 24 | +KSRC ?= $(PWD) | |
| 25 | +KBUILD := $(KSRC) | |
| 26 | +MOD_DIR := $(KBASE)/kernel | |
| 27 | + | |
| 28 | +modules: default | |
| 24 | 29 | |
| 25 | 30 | default: |
| 26 | 31 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
| 27 | 32 | |
| 28 | 33 | endif |
| 29 | 34 | |
| 30 | - | |
| 31 | - | |
| 32 | 35 | clean: |
| 33 | 36 | rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers |
| 34 | 37 | |
| 35 | 38 | depend .depend dep: |
| 36 | 39 | $(CC) $(CFLAGS) -M *.c > .depend |
| 37 | 40 | |
| 41 | +install: modules | |
| 42 | + @( [ `id -u` -ne 1 ] || { echo "Must be root to install modules"; exit 1; } ) | |
| 43 | + rm -f $(MOD_DIR)/extra/tty0tty.ko | |
| 44 | + $(MAKE) -C $(KERNELDIR) M=$(PWD) O=$(KBASE) modules_install | |
| 45 | + depmod -a | |
| 38 | 46 | |
| 39 | 47 | ifeq (.depend,$(wildcard .depend)) |
| 40 | 48 | include .depend |
| 41 | 49 | endif |
| 50 | + | ... | ... |