-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
49 lines (41 loc) · 1.12 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
KDIR ?= /lib/modules/$(shell uname -r)/build
obj-m += ccat.o ccat_netdev.o ccat_gpio.o ccat_sram.o ccat_systemtime.o ccat_update.o
ccat-y := module.o
ccat_netdev-y := netdev.o
ccat_gpio-y := gpio.o
ccat_sram-y := sram.o
ccat_systemtime-y := systemtime.o
ccat_update-y := update.o
#ccflags-y := -DDEBUG
ccflags-y += -D__CHECK_ENDIAN__
DEV_PREFIX=/dev/ccat_
all:
make -C $(KDIR) M=$(CURDIR) modules
install:
- rmmod ccat_update
- rmmod ccat_systemtime
- rmmod ccat_sram
- rmmod ccat_gpio
- rmmod ccat_netdev
- rmmod ccat
make -C $(KDIR) M=$(CURDIR) modules_install
modprobe ccat
modprobe ccat_netdev
modprobe ccat_gpio
modprobe ccat_sram
modprobe ccat_systemtime
modprobe ccat_update
clean:
make -C $(KDIR) M=$(CURDIR) clean
rm -f *.c~ *.h~ *.bin
# indent the source files with the kernels Lindent script
indent: *.h *.c
$(KDIR)/scripts/Lindent $?
$(CURDIR)/tools/shfmt -w $(CURDIR)/scripts $(CURDIR)/unittest
unittest:
sudo chmod g+r ${DEV_PREFIX}*
sudo chmod g+w ${DEV_PREFIX}*
sudo chgrp ccat ${DEV_PREFIX}*
cd unittest && ./test-rw_cdev.sh sram 131072
cd unittest && ./test-update.sh
.PHONY: clean indent unittest