初始化项目配置

This commit is contained in:
2025-10-08 07:44:37 +08:00
commit b8231b78ff
7 changed files with 106 additions and 0 deletions

42
Makefile Normal file
View File

@@ -0,0 +1,42 @@
MAKEFILE_ABS_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_ABS_PATH))
PWD_DIR := $(CURDIR)/
BUILD_DIR := $(addprefix $(MAKEFILE_DIR),build)
SRC_DIR := $(addprefix $(MAKEFILE_DIR),src/)
TARGET_NAME := zdwm
TARGET := $(addprefix $(MAKEFILE_DIR),$(TARGET_NAME))
ifneq ($(PWD_DIR),$(MAKEFILE_DIR))
TARGET := $(addprefix $(MAKEFILE_DIR),$(TARGET_NAME))
endif
$(TARGET_NAME): build
clean:
${RM} $(TARGET)
${RM} -r $(BUILD_DIR)
run:
-$(shell Xephyr :3 -screen 1920x1080 &)
run_multiple_screen:
-$(shell Xephyr :3 -screen 1920x1080 -screen 1920x1080 +xinerama &)
wm: $(TARGET_NAME)
DISPLAY=:3 $(TARGET)
debug: $(TARGET_NAME)
DISPLAY=:3 valgrind --leak-check=full $(TARGET)
prepare:
@cmake -S $(SRC_DIR) -B $(BUILD_DIR)
@cp $(BUILD_DIR)/compile_commands.json $(MAKEFILE_DIR)
build: prepare
${RM} -f $(TARGET)
@cmake --build $(BUILD_DIR)
@cp $(BUILD_DIR)/$(TARGET_NAME) $(TARGET)
.PHONY: clean run wm prepare build install uninstall reinstall