Skip to content

Commit

Permalink
rtmouse.cの分割(リファクタリング) (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeKato authored Nov 15, 2024
1 parent 43532e9 commit 5bdf8e3
Show file tree
Hide file tree
Showing 10 changed files with 2,048 additions and 1,831 deletions.
6 changes: 5 additions & 1 deletion .test/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); cd ../; pwd)

lint_driver () {
pushd $SRC_DIR/src/drivers
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_main.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_dev.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_spi.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_i2c.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_gpio.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse.h
popd
}
Expand Down
5 changes: 3 additions & 2 deletions src/drivers/Makefile.header_from_apt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
MODULE:= rtmouse
obj-m:= $(MODULE).o
$(MODULE)-y:= $(MODULE)_main.o $(MODULE)_dev.o $(MODULE)_spi.o $(MODULE)_i2c.o $(MODULE)_gpio.o
clean-files:= *.o *.ko *.mod.[co] *~

LINUX_SRC_DIR:=/usr/src/linux-headers-$(shell uname -r)
VERBOSE:=0

rtmouse.ko: rtmouse.c rtmouse.h
$(MODULE).ko: $(MODULE)_main.c $(MODULE)_dev.c $(MODULE)_spi.c $(MODULE)_i2c.c $(MODULE)_gpio.c $(MODULE).h
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) modules

clean:
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) clean

install: rtmouse.ko
install: $(MODULE).ko
cp ../../50-rtmouse.rules /etc/udev/rules.d/

uninstall:
Expand Down
3 changes: 2 additions & 1 deletion src/drivers/Makefile.header_from_source
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
MODULE:= rtmouse
obj-m:= $(MODULE).o
$(MODULE)-y:= $(MODULE)_main.o $(MODULE)_dev.o $(MODULE)_spi.o $(MODULE)_i2c.o $(MODULE)_gpio.o
clean-files:= *.o *.ko *.mod.[co] *~

LINUX_SRC_DIR:=/usr/src/linux
VERBOSE:=0

rtmouse.ko: rtmouse.c rtmouse.h
$(MODULE).ko: $(MODULE)_main.c $(MODULE)_dev.c $(MODULE)_spi.c $(MODULE)_i2c.c $(MODULE)_gpio.c $(MODULE).h
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) modules

clean:
Expand Down
Loading

0 comments on commit 5bdf8e3

Please sign in to comment.