From 8fa3f22e388b75276737466e984a49545cb8a108 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 5 Feb 2023 11:16:42 +0200 Subject: Remove makefile include targets --- devices/Makefile | 8 ++++---- i686/Makefile | 5 ++++- i686/boot.S | 2 +- rules.mk | 5 ++--- src/Makefile | 14 +++++--------- src/kernel.cpp | 12 ++++++------ src/mem/vmm.c | 2 +- src/mmap.h | 2 +- 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/devices/Makefile b/devices/Makefile index c799df7..711e103 100644 --- a/devices/Makefile +++ b/devices/Makefile @@ -1,10 +1,10 @@ include ../Makefile.config +INCLUDES := -I../${ARCH} +CFLAGS += ${INCLUDES} +CXXFLAGS += ${INCLUDES} + devs.SRCS = pic_8259.c uart_16550.cpp vga.cpp i8042.c pckbd.c mouse.c -devs.OBJS = include include ../rules.mk -include: - mkdir -p $@ - ln -sTf ../../${ARCH}/sys $@/sys diff --git a/i686/Makefile b/i686/Makefile index 6bbc642..9aa0ed1 100644 --- a/i686/Makefile +++ b/i686/Makefile @@ -1,9 +1,12 @@ include ../Makefile.config +INCLUDES := -isystem../grub +CFLAGS += ${INCLUDES} +CXXFLAGS += ${INCLUDES} + arch.SRCS = boot.S init.s \ gdt.c lgdt.c \ lidt.c isr.c -arch.OBJS = include include ../rules.mk diff --git a/i686/boot.S b/i686/boot.S index 16d54a3..1eea9a3 100644 --- a/i686/boot.S +++ b/i686/boot.S @@ -1,5 +1,5 @@ #define ASM_FILE -#include +#include #include "macros.s" /* Declare a multiboot header that marks this program as a kernel */ diff --git a/rules.mk b/rules.mk index 4e2730a..94de391 100644 --- a/rules.mk +++ b/rules.mk @@ -6,9 +6,9 @@ $(foreach V,$(filter %.SRCS, ${.VARIABLES}),\ ) # extra flags -CFLAGS += -isysteminclude -I../lib \ +CFLAGS += -I../lib \ -Werror=implicit-function-declaration -CXXFLAGS += -isysteminclude -I../lib -Drestrict=__restrict__ \ +CXXFLAGS += -I../lib -Drestrict=__restrict__ \ -Werror=shadow # Suffix rules @@ -57,7 +57,6 @@ clean.base: FORCE @echo " -> Cleaning $(shell pwd | xargs basename)" @$(foreach V,$(filter %.OBJS, ${.VARIABLES}), rm -rf $($(V))) @rm -rf *.a - @rm -rf include @rm -rf tst/test_* %: %.base ; diff --git a/src/Makefile b/src/Makefile index c3e4931..1aa8617 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,11 @@ include ../Makefile.config +INCLUDES := -isystem../grub -I../${ARCH} -I../devices +CFLAGS += ${INCLUDES} +CXXFLAGS += ${INCLUDES} + kernel.SRCS := multiboot2.c mmap.c kernel.cpp mem/vmm.c -kernel.OBJS := include conf.h +kernel.OBJS := conf.h TESTS += tst/test_taskqueue tst/test_roundrobin @@ -13,11 +17,3 @@ conf.h: conf.h.in @sed -i 's/@VERSION@/$(shell git describe)/' conf.h @sed -i 's/@CC@/$(shell ${CC} --version | head -n1)/' conf.h -include: - mkdir -p $@ - ln -sTf ../../grub $@/grub - ln -sTf ../../${ARCH} $@/arch - ln -sTf ../../${ARCH}/sys $@/sys - ln -sTf ../../devices $@/devices - ln -sTf ../../lib $@/lib - diff --git a/src/kernel.cpp b/src/kernel.cpp index 751bcb0..063fe11 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -7,15 +7,15 @@ extern "C" { #include "conf.h" #include "mem.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #include } -#include -#include +#include +#include FILE *stdin; FILE *stdout; diff --git a/src/mem/vmm.c b/src/mem/vmm.c index 3d34a0a..77b06a8 100644 --- a/src/mem/vmm.c +++ b/src/mem/vmm.c @@ -1,5 +1,5 @@ #include "../mem.h" -#include +#include extern struct DirectoryEntry k_pagedir[1024]; extern struct TableEntry k_ptable0x300[1024]; diff --git a/src/mmap.h b/src/mmap.h index 2bf42c4..13f40f2 100644 --- a/src/mmap.h +++ b/src/mmap.h @@ -1,7 +1,7 @@ #pragma once #include "boot.h" -#include +#include __attribute__((section(".multiboot.text"))) unsigned multiboot2_mmap(const struct multiboot_mmap_entry entries[], unsigned entry_count, unsigned bitmap[1024 * 32]); -- cgit v1.2.1