From a4534660fecb1b571c24ad82e67bc6c2fb814cb9 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sun, 24 Jan 2021 21:10:57 -0600 Subject: x86: reorganize the i386 directory Add structure to the internals of the x86 directory. Signed-off-by: Danny Holman --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c42fa08..fdf693c 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ CC=i686-elf-gcc +INCLUDE?=include CFLAGS?=-O2 -g LDFLAGS?= LIBS?= -CFLAGS:=$(CFLAGS) -ffreestanding -Wall -Wextra -Iinclude +INCLUDE:=$(INCLUDE) +CFLAGS:=$(CFLAGS) -ffreestanding -Wall -Wextra -I$(INCLUDE) LDFLAGS:=$(LDFLAGS) LIBS:=$(LIBS) -nostdlib -lgcc @@ -11,7 +13,8 @@ ARCHDIR=arch/i386 include $(ARCHDIR)/make.config -CFLAGS:=$(CFLAGS) $(KERNEL_ARCH_CFLAGS) +INCLUDE:=$(INCLUDE) $(KERNEL_ARCH_INCLUDE) +CFLAGS:=$(CFLAGS) $(KERNEL_ARCH_CFLAGS) -I$(INCLUDE) LDFLAGS:=$(LDFLAGS) $(KERNEL_ARCH_LDFLAGS) LIBS:=$(LIBS) $(KERNEL_ARCH_LIBS) @@ -22,19 +25,19 @@ KERNEL_OBJS=$(KERNEL_ARCH_OBJS) \ kernel/string.o \ kernel/io.o \ -OBJS=$(ARCHDIR)/crti.o \ +OBJS=$(ARCHDIR)/boot/crti.o \ $(ARCHDIR)/crtbegin.o \ $(KERNEL_OBJS) \ $(ARCHDIR)/crtend.o \ - $(ARCHDIR)/crtn.o \ + $(ARCHDIR)/boot/crtn.o \ LINK_LIST=$(LDFLAGS) \ - $(ARCHDIR)/crti.o \ + $(ARCHDIR)/boot/crti.o \ $(ARCHDIR)/crtbegin.o \ $(KERNEL_OBJS) \ $(LIBS) \ $(ARCHDIR)/crtend.o \ - $(ARCHDIR)/crtn.o \ + $(ARCHDIR)/boot/crtn.o \ .PHONY: all clean install install-headers install-kernel .SUFFIXES: .o .c .s @@ -42,7 +45,7 @@ LINK_LIST=$(LDFLAGS) \ all: $(KERNEL) $(KERNEL): $(OBJS) $(ARCHDIR)/linker.ld - @$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST) + @$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(LINK_LIST) @echo [LD] $@ $(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o: @@ -54,7 +57,7 @@ $(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o: .s.o: @$(CC) -MD -c $< -o $@ $(CFLAGS) - @echo [CC] $@ + @echo [AS] $@ clean: $(RM) $(KERNEL) -- cgit v1.2.3