rework Makefile

This commit is contained in:
Leif Liddy 2023-10-27 05:10:44 +02:00
parent f8bb9b1453
commit 80e41d7767
No known key found for this signature in database
GPG Key ID: 8A7AD507B1EEF020

View File

@ -1,16 +1,18 @@
ifneq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(KERNELRELEASE)/build
ifdef KERNELRELEASE
KERNELDIR := /lib/modules/$(KERNELRELEASE)
else
## KERNELRELEASE not set.
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
KERNELDIR := /lib/modules/$(shell uname -r)
endif
all:
make -C $(KERNELDIR) M=$(shell pwd)/build/bluetooth modules
clean:
make -C $(KERNELDIR) M=$(shell pwd)/build/bluetooth clean
KERNELBUILD := $(KERNELDIR)/build
ifeq ($(KERNELRELEASE),)
all:
make -C $(KERNELBUILD) M=$(shell pwd)/build/bluetooth modules
clean:
make -C $(KERNELBUILD) M=$(shell pwd)/build/bluetooth clean
ifndef KERNELRELEASE
install:
cp $(shell pwd)/build/bluetooth/hci_uart.ko /lib/modules/$(shell uname -r)/updates
depmod -a