重构项目源代码存储结构

This commit is contained in:
tang1219
2026-06-16 14:59:58 +08:00
parent 2dcac48623
commit 29b4d47355
21 changed files with 413 additions and 406 deletions
+1
View File
@@ -42,6 +42,7 @@ screen_ds_once
touch_ds touch_ds
touch_set touch_set
usb_ds usb_ds
check_save
.codewhale .codewhale
.mimocode .mimocode
+5 -3
View File
@@ -39,6 +39,8 @@ mkdir -p "$BUILD_DIR/usr/share/doc/ktouch"
cp -r "$SCRIPT_DIR/DEBIAN/"* "$BUILD_DIR/DEBIAN/" cp -r "$SCRIPT_DIR/DEBIAN/"* "$BUILD_DIR/DEBIAN/"
cp -r "$SCRIPT_DIR/opt/ktouch" "$BUILD_DIR/opt/" cp -r "$SCRIPT_DIR/opt/ktouch" "$BUILD_DIR/opt/"
# 排除不应打包的目录
rm -rf "$BUILD_DIR/opt/ktouch/.codewhale"
[ -f "$SCRIPT_DIR/changelog" ] && cp "$SCRIPT_DIR/changelog" "$BUILD_DIR/usr/share/doc/ktouch/changelog" [ -f "$SCRIPT_DIR/changelog" ] && cp "$SCRIPT_DIR/changelog" "$BUILD_DIR/usr/share/doc/ktouch/changelog"
[ -f "$SCRIPT_DIR/LICENSE" ] && cp "$SCRIPT_DIR/LICENSE" "$BUILD_DIR/usr/share/doc/ktouch/copyright" [ -f "$SCRIPT_DIR/LICENSE" ] && cp "$SCRIPT_DIR/LICENSE" "$BUILD_DIR/usr/share/doc/ktouch/copyright"
@@ -76,9 +78,9 @@ done
# display_monitor.py # display_monitor.py
# ) # )
# for exe in "${EXE_LIST[@]}"; do for exe in "${EXE_LIST[@]}"; do
# [ -f "$BUILD_DIR/opt/ktouch/$exe" ] && chmod 755 "$BUILD_DIR/opt/ktouch/$exe" [ -f "$BUILD_DIR/opt/ktouch/$exe" ] && chmod 755 "$BUILD_DIR/opt/ktouch/$exe"
# done done
# usr 下文档 644,目录 755 # usr 下文档 644,目录 755
find "$BUILD_DIR/usr" -type d -exec chmod 755 {} \; find "$BUILD_DIR/usr" -type d -exec chmod 755 {} \;
+13 -9
View File
@@ -7,47 +7,51 @@ GTK_FLAGS = $(shell pkg-config --cflags --libs gtk+-3.0)
# 定义目标文件 # 定义目标文件
TARGETS = screen_binder screen_ds touch_ds usb_ds touch_set screen_ds_once check_save TARGETS = screen_binder screen_ds touch_ds usb_ds touch_set screen_ds_once check_save
# 默认目标 # 安装目标目录
DESTDIR = ../opt/ktouch
# 默认目标:只编译,不安装
all: $(TARGETS) all: $(TARGETS)
# 编译screen_binder # 编译screen_binder
screen_binder: screen_binder.c touch_listen.c screen_binder: screen_binder.c touch_listen.c
$(CC) -o $@ $^ $(GTK_FLAGS) -lpthread -lX11 -lXrandr $(CC) -o $@ $^ $(GTK_FLAGS) -lpthread -lX11 -lXrandr
install -m 755 $@ ../
# 编译screen_ds # 编译screen_ds
screen_ds: screen_ds.c screen_ds: screen_ds.c
$(CC) -o $@ $^ -lX11 -lXrandr $(CC) -o $@ $^ -lX11 -lXrandr
install -m 755 $@ ../
# 编译screen_ds_once # 编译screen_ds_once
screen_ds_once: screen_ds_once.c screen_ds_once: screen_ds_once.c
$(CC) -o $@ $^ -lX11 -lXrandr $(CC) -o $@ $^ -lX11 -lXrandr
install -m 755 $@ ../
# 编译touch_set # 编译touch_set
touch_set: touch_set.c touch_set: touch_set.c
$(CC) -o $@ $^ -lX11 -lXi -ludev $(CC) -o $@ $^ -lX11 -lXi -ludev
install -m 755 $@ ../
# 编译touch_ds # 编译touch_ds
touch_ds: touch_ds.c touch_ds: touch_ds.c
$(CC) -o $@ $^ -lX11 -lXi -ludev $(CC) -o $@ $^ -lX11 -lXi -ludev
install -m 755 $@ ../
# 编译usb_ds # 编译usb_ds
usb_ds: usb_ds.c usb_ds: usb_ds.c
$(CC) -o $@ $^ -ludev $(CC) -o $@ $^ -ludev
install -m 755 $@ ../
# 编译check_save # 编译check_save
check_save: check_save.c check_save: check_save.c
$(CC) -o $@ $^ $(GTK_FLAGS) $(CC) -o $@ $^ $(GTK_FLAGS)
install -m 755 $@ ../
# 安装:编译全部并复制到 opt/ktouch
install: all
@mkdir -p $(DESTDIR)
@for target in $(TARGETS); do \
install -m 755 $$target $(DESTDIR)/; \
done
@echo "已安装到 $(DESTDIR)/"
# 清理生成的文件 # 清理生成的文件
clean: clean:
rm -f $(TARGETS) rm -f $(TARGETS)
# 声明伪目标 # 声明伪目标
.PHONY: all clean .PHONY: all clean install