mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-08-03 17:26:08 -04:00
Improve directory structure
This commit is contained in:
parent
51a3d34004
commit
3300dcf8b7
@ -7,20 +7,27 @@ THOR_FLAGS=-DCONFIG_HISTORY=y
|
|||||||
KERNEL_LINK_FLAGS=$(COMMON_LINK_FLAGS) -T linker.ld
|
KERNEL_LINK_FLAGS=$(COMMON_LINK_FLAGS) -T linker.ld
|
||||||
|
|
||||||
KERNEL_CPP_FILES=$(wildcard src/*.cpp)
|
KERNEL_CPP_FILES=$(wildcard src/*.cpp)
|
||||||
KERNEL_CPP_STL_FILES=$(wildcard src/stl/*.cpp)
|
|
||||||
KERNEL_CPP_DRIVERS_FILES=$(wildcard src/drivers/*.cpp)
|
KERNEL_CPP_DRIVERS_FILES=$(wildcard src/drivers/*.cpp)
|
||||||
|
KERNEL_CPP_FS_FILES=$(wildcard src/fs/*.cpp)
|
||||||
|
KERNEL_CPP_VFS_FILES=$(wildcard src/vfs/*.cpp)
|
||||||
|
|
||||||
KERNEL_D_FILES=$(KERNEL_CPP_FILES:%.cpp=%.cpp.d)
|
KERNEL_D_FILES=$(KERNEL_CPP_FILES:%.cpp=%.cpp.d)
|
||||||
KERNEL_D_STL_FILES=$(KERNEL_CPP_STL_FILES:%.cpp=%.cpp.d)
|
|
||||||
KERNEL_D_DRIVERS_FILES=$(KERNEL_CPP_DRIVERS_FILES:%.cpp=%.cpp.d)
|
KERNEL_D_DRIVERS_FILES=$(KERNEL_CPP_DRIVERS_FILES:%.cpp=%.cpp.d)
|
||||||
|
KERNEL_D_FS_FILES=$(KERNEL_CPP_FS_FILES:%.cpp=%.cpp.d)
|
||||||
|
KERNEL_D_VFS_FILES=$(KERNEL_CPP_VFS_FILES:%.cpp=%.cpp.d)
|
||||||
|
|
||||||
|
KERNEL_O_FILES=$(KERNEL_CPP_FILES:%.cpp=%.cpp.o)
|
||||||
|
KERNEL_O_DRIVERS_FILES=$(KERNEL_CPP_DRIVERS_FILES:%.cpp=%.cpp.o)
|
||||||
|
KERNEL_O_FS_FILES=$(KERNEL_CPP_FS_FILES:%.cpp=%.cpp.o)
|
||||||
|
KERNEL_O_VFS_FILES=$(KERNEL_CPP_VFS_FILES:%.cpp=%.cpp.o)
|
||||||
|
|
||||||
#TODO Generate also the o files coming from s files automatically, ignoring crti and crtn
|
#TODO Generate also the o files coming from s files automatically, ignoring crti and crtn
|
||||||
KERNEL_O_FILES=boot_16_64.o boot_32_64.o $(KERNEL_CPP_FILES:%.cpp=%.cpp.o) $(KERNEL_CPP_STL_FILES:%.cpp=%.cpp.o) $(KERNEL_CPP_DRIVERS_FILES:%.cpp=%.cpp.o) src/isrs.s.o src/irqs.s.o src/arch.s.o src/syscalls.s.o src/task_switch.s.o
|
O_FILES=boot_16_64.o boot_32_64.o $(KERNEL_O_FILES) $(KERNEL_O_FS_FILES) $(KERNEL_O_VFS_FILES) $(KERNEL_O_DRIVERS_FILES) src/isrs.s.o src/irqs.s.o src/arch.s.o src/syscalls.s.o src/task_switch.s.o
|
||||||
|
|
||||||
CRTBEGIN_OBJ:=$(shell $(CC) $(CFLAGS) -print-file-name=crtbegin.o)
|
CRTBEGIN_OBJ:=$(shell $(CC) $(CFLAGS) -print-file-name=crtbegin.o)
|
||||||
CRTEND_OBJ:=$(shell $(CC) $(CFLAGS) -print-file-name=crtend.o)
|
CRTEND_OBJ:=$(shell $(CC) $(CFLAGS) -print-file-name=crtend.o)
|
||||||
|
|
||||||
LINK_O_FILES=src/crti.s.o $(CRTBEGIN_OBJ) $(KERNEL_O_FILES) $(CRTEND_OBJ) src/crtn.s.o
|
LINK_O_FILES=src/crti.s.o $(CRTBEGIN_OBJ) $(O_FILES) $(CRTEND_OBJ) src/crtn.s.o
|
||||||
|
|
||||||
boot_16.o: src/boot/boot_16.cpp
|
boot_16.o: src/boot/boot_16.cpp
|
||||||
$(CC) $(CPP_FLAGS_16) $(THOR_FLAGS) $(WARNING_FLAGS) -c src/boot/boot_16.cpp -o boot_16.o
|
$(CC) $(CPP_FLAGS_16) $(THOR_FLAGS) $(WARNING_FLAGS) -c src/boot/boot_16.cpp -o boot_16.o
|
||||||
@ -40,24 +47,31 @@ src/%.s.o: src/%.s
|
|||||||
src/%.cpp.d: $(KERNEL_CPP_FILES)
|
src/%.cpp.d: $(KERNEL_CPP_FILES)
|
||||||
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/$*.cpp.o src/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/$*.cpp.o src/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
||||||
|
|
||||||
src/stl/%.cpp.d: $(KERNEL_CPP_STL_FILES)
|
|
||||||
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/stl/$*.cpp.o src/stl/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
|
||||||
|
|
||||||
src/drivers/%.cpp.d: $(KERNEL_CPP_DRIVERS_FILES)
|
src/drivers/%.cpp.d: $(KERNEL_CPP_DRIVERS_FILES)
|
||||||
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/drivers/$*.cpp.o src/drivers/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/drivers/$*.cpp.o src/drivers/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
||||||
|
|
||||||
src/%.cpp.o:
|
src/fs/%.cpp.d: $(KERNEL_CPP_FS_FILES)
|
||||||
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/fs/$*.cpp.o src/fs/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
||||||
|
|
||||||
src/stl/%.cpp.o:
|
src/vfs/%.cpp.d: $(KERNEL_CPP_VFS_FILES)
|
||||||
|
@ $(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -MM -MT src/vfs/$*.cpp.o src/vfs/$*.cpp | sed -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
|
||||||
|
|
||||||
|
src/%.cpp.o:
|
||||||
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
src/drivers/%.cpp.o:
|
src/drivers/%.cpp.o:
|
||||||
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
src/vfs/%.cpp.o:
|
||||||
|
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
src/fs/%.cpp.o:
|
||||||
|
$(CC) $(CPP_FLAGS_64) $(THOR_FLAGS) $(WARNING_FLAGS) -c $< -o $@
|
||||||
|
|
||||||
-include $(KERNEL_D_FILES)
|
-include $(KERNEL_D_FILES)
|
||||||
-include $(KERNEL_D_STL_FILES)
|
|
||||||
-include $(KERNEL_D_DRIVERS_FILES)
|
-include $(KERNEL_D_DRIVERS_FILES)
|
||||||
|
-include $(KERNEL_D_VFS_FILES)
|
||||||
|
-include $(KERNEL_D_FS_FILES)
|
||||||
|
|
||||||
kernel.bin: $(LINK_O_FILES)
|
kernel.bin: $(LINK_O_FILES)
|
||||||
$(CC) $(KERNEL_LINK_FLAGS) $(CPP_FLAGS_64) -o kernel.bin.o $(LINK_O_FILES)
|
$(CC) $(KERNEL_LINK_FLAGS) $(CPP_FLAGS_64) -o kernel.bin.o $(LINK_O_FILES)
|
||||||
@ -65,9 +79,10 @@ kernel.bin: $(LINK_O_FILES)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(KERNEL_D_FILES)
|
rm -f $(KERNEL_D_FILES)
|
||||||
rm -f $(KERNEL_D_STL_FILES)
|
|
||||||
rm -f $(KERNEL_D_DRIVERS_FILES)
|
rm -f $(KERNEL_D_DRIVERS_FILES)
|
||||||
rm -f $(KERNEL_O_FILES)
|
rm -f $(KERNEL_D_FS_FILES)
|
||||||
|
rm -f $(KERNEL_D_VFS_FILES)
|
||||||
|
rm -f $(O_FILES)
|
||||||
rm -f crti.o
|
rm -f crti.o
|
||||||
rm -f crts.o
|
rm -f crts.o
|
||||||
rm -f *.bin
|
rm -f *.bin
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
#include <vector.hpp>
|
#include <vector.hpp>
|
||||||
#include <string.hpp>
|
#include <string.hpp>
|
||||||
|
|
||||||
#include "vfs.hpp"
|
#include "vfs/vfs.hpp"
|
||||||
#include "file.hpp"
|
#include "vfs/file.hpp"
|
||||||
|
|
||||||
namespace disks {
|
namespace disks {
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
#include <pair.hpp>
|
#include <pair.hpp>
|
||||||
|
|
||||||
#include "disks.hpp"
|
#include "disks.hpp"
|
||||||
#include "file_system.hpp"
|
#include "vfs/file_system.hpp"
|
||||||
#include "fat32_specs.hpp"
|
#include "fs/fat32_specs.hpp"
|
||||||
|
|
||||||
namespace fat32 {
|
namespace fat32 {
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
#include "ata.hpp"
|
#include "ata.hpp"
|
||||||
#include "thor.hpp"
|
#include "thor.hpp"
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
#include "fat32.hpp"
|
#include "fs/fat32.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
#include <algorithms.hpp>
|
#include <algorithms.hpp>
|
||||||
#include <errors.hpp>
|
#include <errors.hpp>
|
||||||
|
|
||||||
#include "fat32.hpp"
|
#include "fs/fat32.hpp"
|
||||||
|
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
#include "rtc.hpp"
|
#include "rtc.hpp"
|
||||||
|
|
@ -23,7 +23,7 @@
|
|||||||
#include "gdt.hpp"
|
#include "gdt.hpp"
|
||||||
#include "terminal.hpp"
|
#include "terminal.hpp"
|
||||||
#include "scheduler.hpp"
|
#include "scheduler.hpp"
|
||||||
#include "vfs.hpp"
|
#include "vfs/vfs.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
#include "keyboard.hpp"
|
#include "keyboard.hpp"
|
||||||
#include "terminal.hpp"
|
#include "terminal.hpp"
|
||||||
#include "acpi.hpp"
|
#include "acpi.hpp"
|
||||||
#include "vfs.hpp"
|
|
||||||
#include "rtc.hpp"
|
#include "rtc.hpp"
|
||||||
|
#include "vfs/vfs.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -12,15 +12,14 @@
|
|||||||
#include <directory_entry.hpp>
|
#include <directory_entry.hpp>
|
||||||
#include <mount_point.hpp>
|
#include <mount_point.hpp>
|
||||||
|
|
||||||
#include "vfs.hpp"
|
#include "vfs/vfs.hpp"
|
||||||
|
#include "vfs/file_system.hpp"
|
||||||
|
|
||||||
|
#include "fs/fat32.hpp"
|
||||||
|
|
||||||
#include "scheduler.hpp"
|
#include "scheduler.hpp"
|
||||||
#include "file_system.hpp"
|
|
||||||
#include "flags.hpp"
|
#include "flags.hpp"
|
||||||
|
|
||||||
#include "fat32.hpp"
|
|
||||||
|
|
||||||
#include "disks.hpp"
|
|
||||||
|
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
Loading…
x
Reference in New Issue
Block a user