CC := clang LD := ld.lld ROOT := ../.. OUT := $(ROOT)/SYSTEM/system/deshab64/deshab.elf CFLAGS := -target x86_64-unknown-none -std=c11 -ffreestanding -fno-builtin -fno-stack-protector -fpie -mno-red-zone -mno-sse -mno-sse2 -mno-mmx -msoft-float -m64 -Wall -Wextra -I../UTSM/include -O2 LDFLAGS := -nostdlib -static -pie -z max-page-size=0x1000 -T linker.ld # logo_data.c is #included directly into main.c (the DSK PIE loader only # handles R_X86_64_RELATIVE, so the logo array must be file-local to main.o # rather than a cross-unit symbol). Exclude it from standalone compilation. C_SOURCES := $(filter-out logo_data.c, $(wildcard *.c)) OBJECTS := $(C_SOURCES:.c=.o) .PHONY: all clean all: $(OUT) $(OUT): $(OBJECTS) linker.ld @mkdir -p "$(ROOT)/SYSTEM/system/deshab64" $(LD) $(LDFLAGS) -o $@ $(OBJECTS) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ clean: powershell -NoProfile -Command "Get-ChildItem -Path . -Recurse -Filter *.o | Remove-Item -Force; if (Test-Path '$(OUT)') { Remove-Item '$(OUT)' -Force }"