forked from rtomasa/rpi-dpidac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (42 loc) · 1.42 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
ifneq (${KERNELRELEASE},)
obj-m += rpi-dpidac.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
MODULE_DIR ?= $(shell pwd)
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),arm64)
ARCH ?= arm64
else
ARCH ?= arm
endif
INSTALL_MOD_PATH ?=
endif
all:
${MAKE} ARCH="${ARCH}" -C ${KERNELDIR} M="${MODULE_DIR}" modules
dtc -@ -O dtb -o vc4-kms-dpi-custom.dtbo vc4-kms-dpi-custom.dts
install:
${MAKE} ARCH="${ARCH}" INSTALL_MOD_PATH="${INSTALL_MOD_PATH}" -C ${KERNELDIR} M="${MODULE_DIR}" modules_install
depmod
cp vc4-kms-dpi-custom.dtbo /boot/firmware/overlays
fi
@echo "dtoverlay=vc4-kms-dpi-custom" | sudo tee -a /boot/firmware/config.txt
@if ! grep -q "rpi-dpidac" /etc/modules-load.d/modules.conf; then \
echo "rpi-dpidac" | sudo tee -a /etc/modules-load.d/modules.conf; \
fi
@modprobe rpi-dpidac
uninstall:
rm -f ${INSTALL_MOD_PATH}/lib/modules/$(shell uname -r)/extra/rpi-dpidac.ko*
depmod
@if [ -f /boot/firmware/overlays/vc4-kms-dpi-custom.dtbo ]; then \
echo "rm /boot/firmware/overlays/vc4-kms-dpi-custom.dtbo"; \
rm /boot/firmware/overlays/vc4-kms-dpi-custom.dtbo; \
fi
@if [ -f /boot/firmware/timings.txt ]; then \
echo "rm /boot/firmware/timings.txt"; \
rm /boot/firmware/timings.txt; \
fi
clean:
${MAKE} -C ${KERNELDIR} M="${MODULE_DIR}" clean
@if [ -f vc4-kms-dpi-custom.dtbo ]; then \
echo "rm vc4-kms-dpi-custom.dtbo"; \
rm vc4-kms-dpi-custom.dtbo; \
fi