build: Track header dependencies, fix default goal, and repair the font table comment

Three build-correctness fixes plus README coverage of the new kernel core.

The Makefile had no header dependency tracking, so editing a header left every
unrebuilt caller linked against the old layout. That is how the desktop's
window paint callbacks silently landed at the wrong struct offset after
gui_window_t grew: gui_apps.o was never recompiled. Compiles now emit .d files
via -MMD -MP and the build pulls them in.

The include has to sit at the end of the file with .DEFAULT_GOAL pinned to
`all` -- a .d file's first rule would otherwise become make's default goal and
turn a bare `make` into a silent no-op.

drivers/video/canvas.c carried the same font table defect gui_gfx.c did: the
`// \` comment on the backslash glyph continues onto the next line, swallowing
the `]` entry and shifting every glyph from ']' onward by one, so all lowercase
text rendered one letter off.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L5yKJT4Wo2cV3rfPrwY5MP
This commit is contained in:
subhobhai943andClaude Opus 5 committed 2026-08-25 00:18:18 +05:30
1 parent 29d7726a91
commit ed8922c498
3 files changed
+35 -5

No files matched your search

+18 -4
View File
@@ -283,7 +283,8 @@ ifeq ($(CONFIG_USERLAND_LAZYBOX), y)
CONFIG_SRCS-y += userland/lazybox/lazybox.c userland/lazybox/shell.c userland/lazybox/sh.c userland/lazybox/nano.c userland/lazybox/snake.c userland/lazybox/tree.c userland/lazybox/coreutils.c
endif
CONFIG_SRCS-y += gui/gui.c gui/gui_gfx.c gui/gui_cursor.c gui/gui_wm.c gui/gui_desktop.c gui/gui_apps.c
CONFIG_SRCS-y += gui/gui.c gui/gui_gfx.c gui/gui_cursor.c gui/gui_wm.c gui/gui_desktop.c gui/gui_apps.c \
gui/gui_widgets.c gui/gui_icons.c gui/gui_dialog.c gui/gui_apps_ext.c
# Deduplicate
CONFIG_SRCS-y := $(sort $(CONFIG_SRCS-y))
@@ -312,6 +313,13 @@ else
OTHER_OBJS = $(filter-out $(ENTRY_OBJ), $(S_OBJS) $(C_OBJS))
endif
# Generated dependency files, one per object. The include lives at the very
# end of this file: a .d file's first rule would otherwise become make's
# default goal and turn a bare `make` into a no-op.
DEPS = $(C_OBJS:.o=.d) $(CPP_OBJS:.o=.d) $(S_OBJS:.o=.d)
.DEFAULT_GOAL := all
.PHONY: all clean run debug info configure menuconfig config tui nconfig defconfig x86_64_defconfig aarch64_defconfig armv8_defconfig armv8i_defconfig armv81_defconfig arm32_defconfig qemu help
all: $(TARGET)
@@ -337,15 +345,19 @@ armv8_defconfig armv8i_defconfig armv81_defconfig arm32_defconfig:
# -----------------------------------------------------------------------------
# Compilation Rules
# -----------------------------------------------------------------------------
# Header dependency tracking: without this a header change leaves stale objects
# behind, and a struct layout edit silently corrupts every unrebuilt caller.
DEPFLAGS = -MMD -MP
# C Source Files
$(BUILD_DIR)/%.o: %.c include/config/autoconf.h
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
# C++ Source Files
$(BUILD_DIR)/%.o: %.cpp include/config/autoconf.h
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(CXX) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
# x86_64 NASM Assembly Files
$(BUILD_DIR)/%.o: %.asm
@@ -355,7 +367,7 @@ $(BUILD_DIR)/%.o: %.asm
# ARM/AArch64 GNU Assembly Files (.S)
$(BUILD_DIR)/%.o: %.S
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
# Rust Source Compilation
$(RUST_LIB): rust/src/lib.rs $(RUST_SRCS)
@@ -462,3 +474,5 @@ help:
clean:
rm -rf $(BUILD_DIR) $(IMAGE)
-include $(DEPS)