Debian Codegraph @

Makefile

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 obj-m = langford.o
2 KVERSION = $(shell uname -r)
3
4 all: langford.ko langford_util langford_adc_util
5
6 langford.ko: langford.c
7 export CCFLAGS="-ansi -Wall"
8 sudo make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
9
10 install: langford.ko langford_util langford_adc_util
11 #Ensure module recompilation everytime it needs to be installed.
12 #(Prevents module version errors after kernel upgrades.)
13 -sudo rm -f langford.ko
14 -sudo rm -rf /dev/langford
15 -sudo modprobe -r langford
16 make langford.ko
17 sudo cp langford.ko /lib/modules/`uname -r`/kernel/drivers/misc
18 sudo depmod -a
19 sudo modprobe langford
20 #Allow some time for driver to finish loading. If driver does not complete loading, no character device will be registered and mknod will fail.
21 sleep 3
22 sync
23 sudo cp langford_util /usr/bin
24 sudo cp langford_adc_util /usr/bin
25 sudo cp langford_init /usr/bin
26 #Create langford group, if not already.
27 -sudo groupadd langford
28 sudo chmod a+rx /usr/bin/langford_util
29 make -C libs/ install
30 echo "Remember to run langford_init in order to initialize the device at /dev/langford"
31
32 langford_util: langford_util.cpp
33 g++ $< -ansi -Wall -g -o $@
34
35 langford_adc_util: langford_adc_util.cpp langford_spi.cpp
36 g++ langford_adc_util.cpp langford_spi.cpp -ansi -Wall -g -o $@
37
38 libs:
39 make -f libs/Makefile
40
41 clean:
42 -sudo make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
43 -sudo rm -rf langford.ko.gz langford_util langford_adc_util
44 make -C libs/ clean
45
46 distclean: clean
47 -sudo make -C ./ clean
48 -sudo rm -rf .tmp*
49 -sudo rm -rf *~
50 #-sudo rm modules.order Module.symvers
51
52 uninstall:
53 -sudo rm /usr/bin/langford_util
54 -sudo rm /usr/bin/langford_init
55 -sudo rm /usr/bin/langford_adc_util
56 # Remove langford group
57 -sudo groupdel langford
58 make -C libs/ uninstall