将common文件夹下的c文件移动到lib文件夹下

This commit is contained in:
fslongjin 2022-09-28 21:45:38 +08:00
parent be9ac3d58b
commit 1872d9bd4a
18 changed files with 34 additions and 50 deletions

View File

@ -1,7 +1,7 @@
CFLAGS += -I .
kernel_common_subdirs:=libELF math
kernel_common_subdirs:= math
ECHO:
@echo "$@"
@ -10,38 +10,5 @@ $(kernel_common_subdirs): ECHO
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" PIC="$(PIC)"
all: glib.o printk.o cpu.o bitree.o kfifo.o wait_queue.o mutex.o wait.o unistd.o string.o semaphore.o $(kernel_common_subdirs)
all: $(kernel_common_subdirs)
glib.o: glib.c
gcc $(CFLAGS) -c glib.c -o glib.o
printk.o: printk.c
gcc $(CFLAGS) -c printk.c -o printk.o
cpu.o: cpu.c
gcc $(CFLAGS) -c cpu.c -o cpu.o
bitree.o: bitree.c
gcc $(CFLAGS) -c bitree.c -o bitree.o
kfifo.o: kfifo.c
gcc $(CFLAGS) -c kfifo.c -o kfifo.o
wait_queue.o: wait_queue.c
gcc $(CFLAGS) -c wait_queue.c -o wait_queue.o
mutex.o: mutex.c
gcc $(CFLAGS) -c mutex.c -o mutex.o
wait.o: sys/wait.c
gcc $(CFLAGS) -c sys/wait.c -o sys/wait.o
unistd.o: unistd.c
gcc $(CFLAGS) -c unistd.c -o unistd.o
string.o: string.c
gcc $(CFLAGS) -c string.c -o string.o
semaphore.o: semaphore.c
gcc $(CFLAGS) -c semaphore.c -o semaphore.o

View File

@ -1,7 +1,7 @@
CFLAGS += -I .
kernel_lib_subdirs:= libUI
kernel_lib_subdirs:= libUI sys libELF
kernel_lib_objs:= $(shell find ./*.c)

View File

@ -1,4 +1,4 @@
#include "bitree.h"
#include <common/bitree.h>
#include <mm/slab.h>
#include <common/errno.h>
#include <common/kfifo.h>

View File

@ -1,6 +1,6 @@
#include "cpu.h"
#include "kprint.h"
#include "printk.h"
#include <common/cpu.h>
#include <common/kprint.h>
#include <common/printk.h>
// #pragma GCC optimize("O0")
// cpu支持的最大cpuid指令的基础主功能号
uint Cpu_cpuid_max_Basic_mop;

View File

@ -1,5 +1,5 @@
#include "glib.h"
#include "string.h"
#include <common/glib.h>
#include <common/string.h>
/**
* @brief

View File

@ -1,14 +1,14 @@
//
// Created by longjin on 2022/1/22.
//
#include "printk.h"
#include "kprint.h"
#include <common/printk.h>
#include <common/kprint.h>
#include <mm/mm.h>
#include <common/spinlock.h>
#include <lib/libUI/textui.h>
#include "math.h"
#include <common/math.h>
#include <common/string.h>
static spinlock_t __printk_lock = {1};

View File

@ -1,4 +1,4 @@
#include "semaphore.h"
#include <common/semaphore.h>
#include <sched/sched.h>
#include <process/process.h>

View File

@ -1,5 +1,5 @@
#include "string.h"
#include "glib.h"
#include <common/string.h>
#include <common/glib.h>
/**
* @brief

17
kernel/lib/sys/Makefile Normal file
View File

@ -0,0 +1,17 @@
CFLAGS += -I .
kernel_lib_sys_objs:= $(shell find ./*.c)
ECHO:
@echo "$@"
$(kernel_lib_sys_objs): ECHO
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" PIC="$(PIC)"
$(kernel_lib_sys_objs): ECHO
gcc $(CFLAGS) -c $@ -o $@.o
all: $(kernel_lib_sys_objs) $(kernel_lib_sys_objs)
@echo $(kernel_lib_sys_objs)

View File

@ -1,4 +1,4 @@
#include "wait_queue.h"
#include <common/wait_queue.h>
#include <sched/sched.h>
#include <process/process.h>
#include <mm/slab.h>

View File

@ -5,7 +5,7 @@
#include <common/stdio.h>
#include <common/string.h>
#include <common/compiler.h>
#include <common/libELF/elf.h>
#include <common/elf.h>
#include <common/time.h>
#include <common/sys/wait.h>
#include <driver/video/video.h>