forked from lintweaker/mytekusb2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 1.22 KB
/
Makefile
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
obj-m += snd-usb-mytek.o
snd-usb-mytek-objs += chip.o comm.o control.o firmware.o pcm.o
MY_CFLAGS += -g -DDEBUG
ccflags-y += ${MY_CFLAGS}
FW_PATH=/lib/firmware
FW_MYTEK_PATH=$(FW_PATH)/mytek
KERNEL_BUILD ?= $(shell uname -r)
VERSION ?= $(shell uname -r|cut -d. -f1)
PATCHLEVEL ?= $(shell uname -r|cut -d. -f2)
KERNEL_VERSION=$(shell echo $(VERSION)*65536+$(PATCHLEVEL)*256|bc)
all:
@echo "#define LINUX_VERSION_CODE $(KERNEL_VERSION)" > version.h
make CONFIG_DEBUG_SECTION_MISMATCH=y -C /lib/modules/$(KERNEL_BUILD)/build M=$(PWD) modules
debug:
@echo "#define LINUX_VERSION_CODE $(KERNEL_VERSION)" > version.h
make CONFIG_DEBUG_SECTION_MISMATCH=y -C /lib/modules/$(KERNEL_BUILD)/build M=$(PWD) modules
EXTRA_CFLAGS="$(MY_CFLAGS)"
clean:
make -C /lib/modules/$(KERNEL_BUILD)/build M=$(PWD) clean
rm -rf version.h
install:
rm -f /lib/modules/$(KERNEL_BUILD)/extras/snd-usb-mytek.ko
rm -f /lib/modules/$(KERNEL_BUILD)/extra/snd-usb-mytek.ko
mkdir -p /lib/modules/$(KERNEL_BUILD)/extra
cp snd-usb-mytek.ko /lib/modules/$(KERNEL_BUILD)/extra
depmod -a
uninstall:
rm -f /lib/modules/$(KERNEL_BUILD)/extra/snd-usb-mytek.ko
kremove:
for x in $(shell find /lib/modules/$(KERNEL_BUILD) -iname snd-usb-mytek\*); do \
rm -f $$x; \
done