organize by arch

This commit is contained in:
Mathieu Maret 2020-04-27 23:45:38 +02:00
parent 6c3a03a4bc
commit e51314ffac
17 changed files with 5 additions and 5 deletions

View File

@ -8,14 +8,15 @@ CFLAGS += -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-pie -fn
CXXFLAGS += -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-rtti -fno-pie
DEBUG_FLAGS += -g -Og -DDEBUG -fno-omit-frame-pointer -fno-inline
SUBDIRS := core drivers tests
ARCH?=x86
SUBDIRS := core drivers tests arch/$(ARCH)
CPPFLAGS += $(foreach dir, $(SUBDIRS), -I$(dir))
asmsrc=$(wildcard *.asm)
asmobj=$(asmsrc:%.asm=%.o)
csrc=$(shell find $(SUBDIRS) -type f -name "*.c")# $(wildcard *.c)
cobj=$(csrc:%.c=%.o) core/cpu_context_switch.o drivers/irq_pit.o
cobj=$(csrc:%.c=%.o) arch/$(ARCH)/cpu_context_switch.o arch/$(ARCH)/irq_pit.o
deps = $(csrc:%.c=%.d)
kernel:$(asmobj) $(cobj) linker.ld
@ -31,9 +32,9 @@ fd.iso: kernel
#https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html#x86-Function-Attributes
core/exception_handler.o:core/exception_handler.c
arch/$(ARCH)/exception_handler.o:arch/$(ARCH)/exception_handler.c
$(CC) $(CFLAGS) $(CPPFLAGS) -mgeneral-regs-only -c $< -o $@
core/irq_handler.o:core/irq_handler.c
arch/$(ARCH)/irq_handler.o:arch/$(ARCH)/irq_handler.c
$(CC) $(CFLAGS) $(CPPFLAGS) -mgeneral-regs-only -c $< -o $@
%.o:%.asm

View File

@ -10,7 +10,6 @@ struct interrupt_frame {
uint32_t ss;
};
// Exception
// Exception
#define DECLARE_INTERRUPT(int_nb) \
void print_handler_##int_nb(struct interrupt_frame *frame, ulong error_code);