<commit_before>#Target - name of executable
TARGET := myos.bin

include check_compiler.mk

#Directories
SRCDIRS := kernel lib keyboard shell 
ASMSOURCES := $(foreach DIR, $(SRCDIRS), $(wildcard $(DIR)/*.asm))
CSOURCES := $(foreach DIR, $(SRCDIRS), $(wildcard $(DIR)/*.c))
ASMOBJECTS := $(CSOURCES:%.c=%.c.o)
COBJECTS := $(ASMSOURCES:%.asm=%.asm.o)

#Default target
.PHONY : all
all : $(TARGET)

#Linking
$(TARGET) : $(COBJECTS) $(ASMOBJECTS)
	$(LD) $(LDFLAGS) -o $@ $^
	
#Compiling ASM Sources
%.asm.o : %.asm
	$(AA) $(AFLAGS) -o $@ $<

#Compiling C Sources
%.c.o : %.c
	$(CC) $(CFLAGS) $(CINCLUDES) -o $@ -c $<

#Run Qemu with os binary
qemu : $(TARGET)
	qemu-system-i386 -s -kernel myos.bin

#Run Qemu in debug mode -> default $gdb myos.bin
#								   $target remote localhost:1234
qemu-debug : $(TARGET)
	qemu-system-i386 -s -S -kernel myos.bin

#Run Qemu in curses mode
qemu-curses : $(TARGET)
	qemu-system-i386 -s -curses -kernel myos.bin

#Remove executables and object files
clean : 
	$(RM) myos.bin
	$(foreach DIR, $(SRCDIRS), $(RM) $(DIR)/*.o)<commit_msg>Makefile fix circular error<commit_after>#Target - name of executable
TARGET := myos.bin

#Check for operating system and determine compiler
include check_compiler.mk

#Directories
SRCDIRS := kernel lib keyboard shell 
ASMSOURCES := $(foreach DIR, $(SRCDIRS), $(wildcard $(DIR)/*.asm))
CSOURCES := $(foreach DIR, $(SRCDIRS), $(wildcard $(DIR)/*.c))
COBJECTS := $(CSOURCES:%.c=%.c.o)
ASMOBJECTS := $(ASMSOURCES:%.asm=%.a.o)

#Default target
.PHONY : all
all : $(TARGET)

#Linking
$(TARGET) :  $(ASMOBJECTS) $(COBJECTS)
	$(LD) $(LDFLAGS) -o $@ $^
	
#Compiling ASM Sources
%.a.o : %.asm
	$(AA) $(AFLAGS) -o $@ $<

#Compiling C Sources
%.c.o : %.c
	$(CC) $(CFLAGS) $(CINCLUDES) -o $@ -c $<

#Run Qemu with os binary
qemu : $(TARGET)
	qemu-system-i386 -s -kernel myos.bin

#Run Qemu in debug mode -> default $gdb myos.bin
#								   $target remote localhost:1234
qemu-debug : $(TARGET)
	qemu-system-i386 -s -S -kernel myos.bin

#Run Qemu in curses mode
qemu-curses : $(TARGET)
	qemu-system-i386 -s -curses -kernel myos.bin

#Remove executables and object files
clean : 
	$(RM) myos.bin
	$(foreach DIR, $(SRCDIRS), $(RM) $(DIR)/*.o)
{'fraction_non_alphanumeric': 0.18932481751824817, 'fraction_numerical': 0.011861313868613138, 'mean_word_length': 3.9170403587443947, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3893278', 'n_tokens_mistral': 945, 'n_tokens_neox': 851, 'n_words': 239}