forked from bluecherrydvr/solo6x10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (55 loc) · 1.91 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
KERNELVER := $(shell uname -r)
MODDIR = /lib/modules/$(KERNELVER)
KERNELDIR = $(MODDIR)/build
KERNELSRC = $(MODDIR)/source
solo6x10-objs := solo6010-core.o solo6010-i2c.o solo6010-p2m.o \
solo6010-v4l2.o solo6010-tw28.o solo6010-gpio.o \
solo6010-disp.o solo6010-enc.o solo6010-v4l2-enc.o \
solo6010-g723.o solo6010-eeprom.o
# Check for conflicting modules
mod_paths = kernel/drivers/staging/media/solo6x10 \
extra
conflicts = $(wildcard $(patsubst %,$(MODDIR)/%/solo6x10.ko,$(mod_paths)))
ifneq ($(conflicts),)
$(error Found conflicting module(s) installed: $(conflicts))
endif
# For when the kernel isn't compiled with it
ifeq ($(CONFIG_VIDEOBUF_DMA_CONTIG),)
solo6x10-objs += videobuf-dma-contig.o
endif
ifeq ($(CONFIG_VIDEOBUF_DMA_SG),)
solo6x10-objs += videobuf-dma-sg.o
endif
obj-m := solo6x10.o
modules modules_install clean: FORCE
$(MAKE) $(MAKEARGS) -C $(KERNELDIR) M=$(shell pwd) $@
install: modules_install FORCE
clean: clean_local
clean_local: FORCE
rm -f Module.markers modules.order videobuf-dma-contig.c \
videobuf-dma-contig.c.in videobuf-dma-sg.c.in
# Workaround for Debian et al
ifeq ($(wildcard $(KERNELSRC)/drivers),)
kerneltar := $(firstword \
$(wildcard $(patsubst %,/usr/src/linux-source-%.tar.bz2,\
$(shell uname -r | sed 's@-.*@@;p;s@\.[^.]*$$@@'))))
ifeq ($(kerneltar),)
$(error Missing files on the kernel source directory, and no tarball found)
endif
$(obj)/%.in: $(kerneltar)
$(if $(KBUILD_VERBOSE:1=),@echo ' EXTRACT' $@)
$(Q)tar -Oxf $< --wildcards '*/$(@F:.in=)' > $@
else
V4L2SRC = $(wildcard \
$(KERNELSRC)/drivers/media/video \
$(KERNELSRC)/drivers/media/v4l2-core)
$(obj)/%.in: $(V4L2SRC)/%
$(if $(KBUILD_VERBOSE:1=),@echo ' LN' $@)
$(Q)ln -sf $< $@
endif
$(obj)/videobuf-dma-contig.c $(obj)/videobuf-dma-sg.c: %:%.in
$(if $(KBUILD_VERBOSE:1=),@echo ' MERGE' $@)
$(Q)sed '/^MODULE_/d;/^EXPORT_SYMBOL_GPL/d' $< > $@
FORCE:
# For my local crud
-include make.extras