1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-02-24 15:55:41 -05:00

Target "none" generates valid host executable

This commit is contained in:
Braiden Vasco 2017-11-08 12:09:14 +00:00
parent 7865fdf85d
commit 81f3b8baa2
7 changed files with 11 additions and 29 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@
/config.mk
/kernelmq
/arch/*/kernelmq

View file

@ -31,7 +31,7 @@ test: run-test
##########
all-kernel: all-arch
cp arch/$(ARCH)/kernel $(KERNEL)
cp arch/$(ARCH)/kernelmq $(KERNEL)
clean-kernel:
rm -f $(KERNEL)

View file

@ -1,4 +1,4 @@
export OUTPUT = kernel
export OUTPUT = kernelmq
ARCHES = $(shell ls -d */)
ARCHES := $(ARCHES:/=)

View file

@ -1,4 +1,4 @@
OBJS = dummy.c.o
OBJS = main.o
all: $(OUTPUT)
@ -6,7 +6,7 @@ clean:
rm -f $(OUTPUT) $(OBJS)
$(OUTPUT): $(OBJS)
$(CC) -T linker.ld -o $(OUTPUT) -ffreestanding -nostdlib -lgcc $(OBJS) $(LIBSRC) $(LIBK)
$(CC) -o $(OUTPUT) $(OBJS) $(LIBSRC) $(LIBK)
%.c.o: %.c
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -nostdinc -fno-builtin -fno-stack-protector -Wall -Wextra -I "$(INCLUDE)"
%.o: %.c
$(CC) -c $< -o $@ -std=gnu99 -Wall -Wextra -I $(INCLUDE)

View file

View file

@ -1,23 +0,0 @@
SECTIONS
{
.text BLOCK(4K) : ALIGN(4K)
{
*(.text)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
}

4
arch/none/main.c Normal file
View file

@ -0,0 +1,4 @@
int main()
{
return 0;
}