organize by arch
This commit is contained in:
parent
6c3a03a4bc
commit
e51314ffac
9
Makefile
9
Makefile
@ -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
|
CXXFLAGS += -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-rtti -fno-pie
|
||||||
DEBUG_FLAGS += -g -Og -DDEBUG -fno-omit-frame-pointer -fno-inline
|
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))
|
CPPFLAGS += $(foreach dir, $(SUBDIRS), -I$(dir))
|
||||||
|
|
||||||
asmsrc=$(wildcard *.asm)
|
asmsrc=$(wildcard *.asm)
|
||||||
asmobj=$(asmsrc:%.asm=%.o)
|
asmobj=$(asmsrc:%.asm=%.o)
|
||||||
csrc=$(shell find $(SUBDIRS) -type f -name "*.c")# $(wildcard *.c)
|
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)
|
deps = $(csrc:%.c=%.d)
|
||||||
|
|
||||||
kernel:$(asmobj) $(cobj) linker.ld
|
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
|
#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 $@
|
$(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 $@
|
$(CC) $(CFLAGS) $(CPPFLAGS) -mgeneral-regs-only -c $< -o $@
|
||||||
|
|
||||||
%.o:%.asm
|
%.o:%.asm
|
||||||
|
@ -10,7 +10,6 @@ struct interrupt_frame {
|
|||||||
uint32_t ss;
|
uint32_t ss;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Exception
|
|
||||||
// Exception
|
// Exception
|
||||||
#define DECLARE_INTERRUPT(int_nb) \
|
#define DECLARE_INTERRUPT(int_nb) \
|
||||||
void print_handler_##int_nb(struct interrupt_frame *frame, ulong error_code);
|
void print_handler_##int_nb(struct interrupt_frame *frame, ulong error_code);
|
Loading…
Reference in New Issue
Block a user