Use the platform framework for tools as well

This commit is contained in:
Pierre Pronchery 2018-09-16 17:27:15 +02:00
parent 64e9615a93
commit b27bab4ff2
3 changed files with 13 additions and 15 deletions

View File

@ -4,23 +4,12 @@
#include <stddef.h>
#include "drivers/bus.h"
#include "drivers/clock.h"
#include "drivers/console.h"
#define TOOLS_BUS "tty"
#define TOOLS_CLOCK "sys"
#define TOOLS_CONSOLE "stdio"
#include <kernel/platform.h>
/* init */
int init(void)
{
ukBus * bus;
bus = bus_init(NULL, TOOLS_BUS);
console_init(bus, TOOLS_CONSOLE);
clock_init(NULL, TOOLS_CLOCK);
platform_init();
return 0;
}

4
tools/platform.conf Normal file
View File

@ -0,0 +1,4 @@
#tools
tty bus
stdio console at tty bus
sys clock

View File

@ -1,4 +1,4 @@
targets=crtbegin.o,crtend.o,crti.o,crtn.o,start.o,uKernel
targets=crtbegin.o,crtend.o,crti.o,crtn.o,platform.c,start.o,uKernel
cppflags_force=-nostdinc -isystem ../include -I../src
cflags_force=`../tools/platform.sh -V NATIVE_CFLAGS -C "$$ARCH"`
cflags=-W -Wall -g -O2
@ -24,13 +24,18 @@ sources=crti.S
type=object
sources=crtn.S
[platform.c]
type=script
script=../src/kernel/platform.sh
depends=platform.conf,../src/kernel/platform.sh
[start.o]
type=object
sources=start.S
[uKernel]
type=binary
sources=bus.c,clock.c,console.c,init.c,main.c
sources=bus.c,clock.c,console.c,init.c,platform.c,main.c
ldflags=$(OBJDIR)crti.o $(OBJDIR)crtbegin.o $(OBJDIR)start.o $(OBJDIR)../src/lib/libuKernel.a $(OBJDIR)../src/drivers/clock/sys.o $(OBJDIR)../src/drivers/console/stdio.o $(OBJDIR)crtend.o $(OBJDIR)crtn.o `$(CC) -print-libgcc-file-name`
depends=$(OBJDIR)crtbegin.o,$(OBJDIR)crtend.o,$(OBJDIR)start.o,$(OBJDIR)../src/lib/libuKernel.a,$(OBJDIR)../src/drivers/clock/sys.o,$(OBJDIR)../src/drivers/console/stdio.o