NAME = kfs SRC = $(wildcard src/*.c src/crt0.S) LDSCRIPT = kfs.ld CPPFLAGS += LDFLAGS += -T $(LDSCRIPT) -nostdlib -Wl,--build-id=none -m32 CFLAGS += -W -Wall -Wextra -std=gnu99 -g \ -nostdinc -fno-builtin -fno-stack-protector -m32 CC = gcc OBJ = $(SRC:.c=.o) all: $(NAME) $(NAME): $(OBJ) $(LDSCRIPT) $(CC) -o $@ $^ $(LDFLAGS) clean: $(RM) $(OBJ) $(RM) $(NAME) mrproper: clean distclean: mrproper $(RM) $(addsuffix ~,$(SRC)) $(RM) $(wildcard $(addsuffix .sw*,$(addprefix .,$(SRC)))) boot: all qemu-system-i386 -kernel $(NAME) debug: all qemu-system-i386 -kernel $(NAME) -s -S .PHONY: all clean mrproper distclean boot