<commit_before>NAME    = kernel
VERSION = 0.00
BINARY = $(NAME)-$(VERSION)
ISO = $(BINARY).iso

CC = gcc
LD = ld
AS = nasm

CC_OBJS  := $(patsubst %.c, %.o, $(shell find . -name '*.c'))
AS_OBJS := $(patsubst %.asm, %.o, $(shell find . -name '*.asm'))

OBJS = $(AS_OBJS) $(CC_OBJS)

all: $(OBJS)
	@echo "LD $(BINARY)"
	$(LD) -melf_i386 -T memmap -nostdlib -o $(BINARY) $(OBJS)

clean:
	@echo "RM  OBJS"
	rm -rf $(OBJS)
	@echo "RM  $(BINARY)"
	rm -rf $(BINARY)
	rm -rf ./iso/boot/kernel
	rm -rf *.iso
	rm -rf bochsout.txt

grub-iso:
	cp $(BINARY) ./iso/boot/kernel
	grub-mkrescue -o $(BINARY).iso ./iso 

qemu:
	@echo "QEMU  $(BINARY)"
	qemu-system-i386 -m 32M -s -kernel $(BINARY)

bochs:
	@echo "BOCHS $(ISO)"
	bochs -f bochsrc.txt

%.o: %.c
	@echo "CC  $<"
	$(CC) -m32 -Iinclude -Wall -Wextra -O0 -ffreestanding -fno-asynchronous-unwind-tables -c $< -o $@
<commit_msg>Makefile: fixed memory crash bug<commit_after>NAME    = kernel
VERSION = 0.00
BINARY = $(NAME)-$(VERSION)
ISO = $(BINARY).iso

CC = gcc
LD = ld
AS = nasm

CC_OBJS  := $(patsubst %.c, %.o, $(shell find . -name '*.c'))
AS_OBJS := $(patsubst %.asm, %.o, $(shell find . -name '*.asm'))

OBJS = $(AS_OBJS) $(CC_OBJS)

all: $(OBJS)
	@echo "LD $(BINARY)"
	$(LD) -melf_i386 -T memmap -nostdlib -o $(BINARY) $(OBJS)

clean:
	@echo "RM  OBJS"
	rm -rf $(OBJS)
	@echo "RM  $(BINARY)"
	rm -rf $(BINARY)
	rm -rf ./iso/boot/kernel
	rm -rf *.iso
	rm -rf bochsout.txt

grub-iso:
	cp $(BINARY) ./iso/boot/kernel
	grub-mkrescue -o $(BINARY).iso ./iso 

qemu:
	@echo "QEMU  $(BINARY)"
	qemu-system-i386 -m 128M -s -kernel $(BINARY)

bochs:
	@echo "BOCHS $(ISO)"
	bochs -f bochsrc.txt

%.o: %.c
	@echo "CC  $<"
	$(CC) -m32 -Iinclude -Wall -Wextra -O0 -ffreestanding -fno-asynchronous-unwind-tables -c $< -o $@

{'fraction_non_alphanumeric': 0.2167235494880546, 'fraction_numerical': 0.016496018202502846, 'mean_word_length': 3.0251716247139586, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3964574', 'n_tokens_mistral': 848, 'n_tokens_neox': 816, 'n_words': 218}