From 457277095a087362e613c942dc8b47c1372cfc37 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 5 Jul 2017 14:08:20 +0200 Subject: tried to fix libc tests, currently they draw in too many dependencies and don't link. We have to separate libc better from the rest of the kernel code (kernel_panic, libc library initializers) --- tests/libc/Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/libc/Makefile b/tests/libc/Makefile index 8e0c01d..2a7c53c 100644 --- a/tests/libc/Makefile +++ b/tests/libc/Makefile @@ -1,6 +1,9 @@ CC := gcc CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror -INCLUDES = -I../../src/libc +# TODO: make sure we can test the libc library without kernel code, +# this means we have to separate initializers like __stdio_init.. +# from the rest, also we have to provide a stub for kernel_panic +INCLUDES = -I../../src/libc -I../../src/kernel -I../../src/hardware -I../../src/drivers -I../../src/drivers/hdi/ps2 -I../../src/drivers/video -I../../src/gui LD := ld all: test @@ -17,17 +20,23 @@ test_strlcat: test_strlcat.o ../../src/libc/string.o test_strlcat.o: test_strlcat.c $(CC) $(CFLAGS) $(INCLUDES) -c -o test_strlcat.o test_strlcat.c -test_itoa: test_itoa.o ../../src/libc/stdlib.o ../../src/libc/string.o - $(CC) -o test_itoa test_itoa.o ../../src/libc/stdlib.o ../../src/libc/string.o +test_itoa: test_itoa.o ../../src/libc/stdlib.o ../../src/libc/string.o ../../src/kernel/memorymanagement.o ../../src/kernel/kernel.o + $(CC) -o test_itoa test_itoa.o ../../src/libc/stdlib.o ../../src/libc/string.o ../../src/kernel/memorymanagement.o ../../src/kernel/kernel.o test_itoa.o: test_itoa.c ../../src/libc/stdlib.o $(CC) $(CFLAGS) $(INCLUDES) -c -o test_itoa.o test_itoa.c ../../src/libc/string.o: ../../src/libc/string.c - $(CC) $(CFLAGS) -c -o ../../src/libc/string.o ../../src/libc/string.c + $(CC) $(CFLAGS) $(INCLUDES) -c -o ../../src/libc/string.o ../../src/libc/string.c ../../src/libc/stdlib.o: ../../src/libc/stdlib.c - $(CC) $(CFLAGS) -c -o ../src/stdlib.o ../src/stdlib.c + $(CC) $(CFLAGS) $(INCLUDES) -c -o ../../src/libc/stdlib.o ../../src/libc/stdlib.c + +../../src/kernel/memorymanagement.o: ../../src/kernel/memorymanagement.c + $(CC) $(CFLAGS) $(INCLUDES) -c -o ../../src/kernel/memorymanagement.o ../../src/kernel/memorymanagement.c + +../../src/kernel/kernel.o: ../../src/kernel/kernel.c + $(CC) $(CFLAGS) $(INCLUDES) -c -o ../../src/kernel/kernel.o ../../src/kernel/kernel.c test: test_strlcpy test_strlcat test_itoa ./test_strlcpy -- cgit v1.2.3-54-g00ecf