Files
haxala1r fcb533ff24 fix: disable PIE for kernel build to fix linker error
Co-authored-by: aider (openrouter/moonshotai/kimi-k2.6) <aider@aider.chat>
2026-05-04 10:55:02 +03:00

24 lines
704 B
Makefile

CC = clang
CFLAGS = -Wall -Wextra -g -std=c11
COMMON_SRCS = forth_core.c forth_dict.c forth_words.c forth_interp.c main.c
LINUX_SRCS = $(COMMON_SRCS) platform_linux.c
KERNEL_SRCS = $(COMMON_SRCS) platform_kernel.c kernel_entry.S
KERNEL_LD = kernel.ld
TARGET = forth
KERNEL_TARGET = forth.kernel
all: $(TARGET)
$(TARGET): $(LINUX_SRCS) forth.h
$(CC) $(CFLAGS) -static -nostdlib -ffreestanding -fno-stack-protector -o $@ $(LINUX_SRCS)
$(KERNEL_TARGET): $(KERNEL_SRCS) forth.h $(KERNEL_LD)
$(CC) $(CFLAGS) -ffreestanding -nostdlib -fno-stack-protector -mno-red-zone -fno-pie -no-pie -o $@ $(KERNEL_SRCS) -T$(KERNEL_LD) -Wl,--build-id=none
clean:
rm -f $(TARGET) $(KERNEL_TARGET)
.PHONY: all clean