<commit_before>ARCH=i686-elf
TEST_CC=clang
GCOV=llvm-cov
GRUB_MKRESCUE=grub-mkrescue
CC=compiler/$(ARCH)/bin/$(ARCH)-gcc
LD=compiler/$(ARCH)/bin/$(ARCH)-gcc
AS=nasm
ASFLAGS=-felf32 -F dwarf -g
CFLAGS= -std=c11 -ffreestanding -O0 -Wall -Werror -Wextra -g -I ./include -I tlibc/include -D ARCH_X86
LDFLAGS=${CFLAGS} -nostdlib
TEST_CFLAGS= -std=c11 -O0 -Wall -Wextra -g -I ./include -coverage -Wno-format -D ARCH_USERLAND
QEMU_FLAGS= -m 1G -serial file:build/qemu-serial.log
VB=virtualbox
VBM=VBoxManage
TMP=/tmp

all: build/truthos.bin

tests: build/tests/kmem build/tests/physical_allocator

run-tests: tests
	./build/tests/kmem
	./build/tests/physical_allocator

build/boot.o:
	${AS} kernel/arch/x86/boot.s -o build/boot.o ${ASFLAGS}

build/libk.o: build/serial.o kernel/libk/*.c include/libk/*.h
	${CC} -c kernel/libk/kmem.c -o ${TMP}/kmem.o  ${CFLAGS}
	${CC} -c kernel/libk/kabort.c -o ${TMP}/kabort.o  ${CFLAGS}
	${CC} -c kernel/libk/kputs.c -o ${TMP}/kputs.o  ${CFLAGS}
	${CC} -c kernel/libk/klog.c -o ${TMP}/klog.o  ${CFLAGS}
	${CC} -c kernel/libk/physical_allocator.c -o ${TMP}/physical_allocator.o  ${CFLAGS}
	${LD} -r ${TMP}/kmem.o ${TMP}/kabort.o ${TMP}/kputs.o ${TMP}/klog.o ${TMP}/physical_allocator.o -o build/libk.o ${LDFLAGS}

build/processes.o: kernel/arch/x86/process.c kernel/arch/x86/process.s
	${CC} -c kernel/arch/x86/process.c -o ${TMP}/processesc.o ${CFLAGS}
	${AS} kernel/arch/x86/process.s -o ${TMP}/processess.o ${ASFLAGS}
	${LD} -r ${TMP}/processess.o ${TMP}/processesc.o -o build/processes.o ${LDFLAGS}

build/tests/kmem: kernel/libk/tests/stubs.c kernel/libk/tests/kmem.c
	${TEST_CC} kernel/libk/tests/stubs.c kernel/libk/tests/kmem.c  -o build/tests/kmem ${TEST_CFLAGS}

build/tests/physical_allocator: kernel/libk/tests/stubs.c kernel/libk/tests/physical_allocator.c
	${TEST_CC} kernel/libk/tests/stubs.c kernel/libk/tests/physical_allocator.c -o build/tests/physical_allocator ${TEST_CFLAGS}

build/io.o: kernel/arch/x86/io.s
	${AS} kernel/arch/x86/io.s -o build/io.o ${ASFLAGS}

build/kernel.o: build/libk.o build/terminal.o build/gdt.o build/idt.o build/tlibc.o build/keyboard.o build/timer.o build/paging.o build/io.o build/processes.o kernel/kernel.c build/lock.o
	${CC} -c kernel/kernel.c -o build/kernel.o  ${CFLAGS}

build/truthos.bin: build build/kernel.o build/boot.o<commit_msg>truthos.bin target depends on liker script<commit_after>ARCH=i686-elf
TEST_CC=clang
GCOV=llvm-cov
GRUB_MKRESCUE=grub-mkrescue
CC=compiler/$(ARCH)/bin/$(ARCH)-gcc
LD=compiler/$(ARCH)/bin/$(ARCH)-gcc
AS=nasm
ASFLAGS=-felf32 -F dwarf -g
CFLAGS= -std=c11 -ffreestanding -O0 -Wall -Werror -Wextra -g -I ./include -I tlibc/include -D ARCH_X86
LDFLAGS=${CFLAGS} -nostdlib
TEST_CFLAGS= -std=c11 -O0 -Wall -Wextra -g -I ./include -coverage -Wno-format -D ARCH_USERLAND
QEMU_FLAGS= -m 1G -serial file:build/qemu-serial.log
VB=virtualbox
VBM=VBoxManage
TMP=/tmp

all: build/truthos.bin

tests: build/tests/kmem build/tests/physical_allocator

run-tests: tests
	./build/tests/kmem
	./build/tests/physical_allocator

build/boot.o:
	${AS} kernel/arch/x86/boot.s -o build/boot.o ${ASFLAGS}

build/libk.o: build/serial.o kernel/libk/*.c include/libk/*.h
	${CC} -c kernel/libk/kmem.c -o ${TMP}/kmem.o  ${CFLAGS}
	${CC} -c kernel/libk/kabort.c -o ${TMP}/kabort.o  ${CFLAGS}
	${CC} -c kernel/libk/kputs.c -o ${TMP}/kputs.o  ${CFLAGS}
	${CC} -c kernel/libk/klog.c -o ${TMP}/klog.o  ${CFLAGS}
	${CC} -c kernel/libk/physical_allocator.c -o ${TMP}/physical_allocator.o  ${CFLAGS}
	${LD} -r ${TMP}/kmem.o ${TMP}/kabort.o ${TMP}/kputs.o ${TMP}/klog.o ${TMP}/physical_allocator.o -o build/libk.o ${LDFLAGS}

build/processes.o: kernel/arch/x86/process.c kernel/arch/x86/process.s
	${CC} -c kernel/arch/x86/process.c -o ${TMP}/processesc.o ${CFLAGS}
	${AS} kernel/arch/x86/process.s -o ${TMP}/processess.o ${ASFLAGS}
	${LD} -r ${TMP}/processess.o ${TMP}/processesc.o -o build/processes.o ${LDFLAGS}

build/tests/kmem: kernel/libk/tests/stubs.c kernel/libk/tests/kmem.c
	${TEST_CC} kernel/libk/tests/stubs.c kernel/libk/tests/kmem.c  -o build/tests/kmem ${TEST_CFLAGS}

build/tests/physical_allocator: kernel/libk/tests/stubs.c kernel/libk/tests/physical_allocator.c
	${TEST_CC} kernel/libk/tests/stubs.c kernel/libk/tests/physical_allocator.c -o build/tests/physical_allocator ${TEST_CFLAGS}

build/io.o: kernel/arch/x86/io.s
	${AS} kernel/arch/x86/io.s -o build/io.o ${ASFLAGS}

build/kernel.o: build/libk.o build/terminal.o build/gdt.o build/idt.o build/tlibc.o build/keyboard.o build/timer.o build/paging.o build/io.o build/processes.o kernel/kernel.c build/lock.o
	${CC} -c kernel/kernel.c -o build/kernel.o  ${CFLAGS}

build/truthos.bin: build build/kernel.o build/boot.o kernel/arch/x86/linker.ld
{'fraction_non_alphanumeric': 0.18431706797357766, 'fraction_numerical': 0.012358832303430642, 'mean_word_length': 4.004264392324094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6994848', 'n_tokens_mistral': 2081, 'n_tokens_neox': 2046, 'n_words': 355}