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:
parent
7865fdf85d
commit
81f3b8baa2
7 changed files with 11 additions and 29 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,3 +6,4 @@
|
|||
|
||||
/config.mk
|
||||
/kernelmq
|
||||
/arch/*/kernelmq
|
||||
|
|
2
Makefile
2
Makefile
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export OUTPUT = kernel
|
||||
export OUTPUT = kernelmq
|
||||
|
||||
ARCHES = $(shell ls -d */)
|
||||
ARCHES := $(ARCHES:/=)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
4
arch/none/main.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue