-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (26 loc) · 845 Bytes
/
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
TARGET := vibrations_module.ko
MDIR := arch/arm/nothing
CURRENT := $(shell uname -r)
KDIR := /lib/modules/$(CURRENT)/build
PWD := $(shell pwd)
DEST := /lib/modules/$(CURRENT)/kernel/$(MDIR)
INCL := -I $(KDIR)/arch/arm/include/asm/
INCL += -I include/rpiGPIOManipulation.h
INCL += -I include/vibration_module.h
obj-m := vibrations_module.o
default:
$(MAKE) $(INCL) -C $(KDIR) M=$(PWD)
install:
#@if test -f $(DEST)/$(TARGET).orig; then \
# echo "Backup of .ko already exists."; \
#else \
# echo "Creating a backup of .ko."; \
# mv -v $(DEST)/$(TARGET) $(DEST)/$(TARGET).orig; \
#fi
su -c "cp $(TARGET) $(DEST) && /sbin/depmod -a"
revert:
@echo "Reverting to the original .ko."
@mv -v $(DEST)/$(TARGET).orig $(DEST)/$(TARGET)
clean:
rm -f *.o $(TARGET) .*.cmd .*.flags *.mod.c *.symvers *.order
-include $(KDIR)/Rules.make