<commit_before># A very simple Makefile and incomplete Makefile
# originally for LetkuOS

SRCDIR=src
CC=tcc
CFLAGS=-nostdlib -I./include -Wall,Wl,-Ttext,0x100000, -static -DREVID="\"$(REVID)\""
AS=nasm
ASFLAGS=-f elf
LD=ld
LOOPDEVICE=/dev/loop0
HDIMAGE=LetkuOS.img
MOUNTPOINT=/mnt
KERNELBIN=LetkuOS.krn
TESTING=testing/
BOOTFILE=$(SRCDIR)/boot.asm
REVID=$(shell date)
all: bootstuff sources linking

bootstuff:
	@echo "Assembling $(BOOTFILE).."
	@$(AS) $(ASFLAGS) $(BOOTFILE) 	# assembly

sources:
	@echo "Compiling C source files to object files.."
	@$(CC) $(CFLAGS) -c $(SRCDIR)/main.c -o $(SRCDIR)/main.o	# C
	@$(CC) $(CFLAGS) -c $(SRCDIR)/scrn.c -o $(SRCDIR)/scrn.o	# C

linking:
	@echo "Linking $(BOOTFILE) with C object files.."
	@$(CC) $(CFLAGS) $(SRCDIR)/boot.o $(SRCDIR)/main.o $(SRCDIR)/scrn.o -o $(KERNELBIN)
	@echo ""
	@echo "Kernel compilation finished. Kernel at $(KERNELBIN)"

install: all
	@echo "Needing root access for loopdevice.."
	@sudo mount -tvfat -oloop=$(LOOPDEVICE),offset=32256 $(HDIMAGE) $(MOUNTPOINT)
	@sudo cp $(KERNELBIN) $(MOUNTPOINT)/boot/$(KERNELBIN)
	@sudo umount $(MOUNTPOINT)
	@echo Kernel image saved to $(HDIMAGE)
<commit_msg>Makefile now supports endless numbers of .c files - no need to hard code them anymore<commit_after># A very simple Makefile and incomplete Makefile
# originally for LetkuOS

SRCDIR=src
INCDIR=include
SOURCES  := $(wildcard $(SRCDIR)/*.c)
#INCLUDES := $(wildcard $(INCDIR)/*.h)
OBJECTS  := $(SOURCES:.c=.o)
CC=tcc
CFLAGS=-nostdlib -I./include -Wall,Wl,-Ttext,0x100000, -static -DREVID="\"$(REVID)\""
AS=nasm
ASFLAGS=-f elf
LD=ld
LOOPDEVICE=/dev/loop0
HDIMAGE=LetkuOS.img
MOUNTPOINT=/mnt
KERNELBIN=LetkuOS.krn
TESTING=testing/
BOOTFILE=$(SRCDIR)/boot.asm
BOOTOBJ=$(SRCDIR)/boot.o
REVID=$(shell date)


all: linking

bootstuff:
	@echo "Assembling $(BOOTFILE).."
	@$(AS) $(ASFLAGS) $(BOOTFILE) -o $(BOOTOBJ) 	# assembly

$(OBJECTS): $(SOURCES) #$(INCLUDES)
	@echo "Compiling C source files to object files.."
	$(CC) $(CFLAGS) -o $@ -c $*.c	# C


linking: bootstuff $(OBJECTS)
	@echo "Linking $(BOOTFILE) with C object files.."
	$(CC) $(CFLAGS) $(OBJECTS) $(BOOTOBJ) -o $(KERNELBIN)
	@echo ""
	@echo "Kernel compilation finished. Kernel at $(KERNELBIN)"


install: all
	@echo "Needing root access for loopdevice.."
	@sudo mount -tvfat -oloop=$(LOOPDEVICE),offset=32256 $(HDIMAGE) $(MOUNTPOINT)
	@sudo cp $(KERNELBIN) $(MOUNTPOINT)/boot/$(KERNELBIN)
	@sudo umount $(MOUNTPOINT)
	@echo Kernel image saved to $(HDIMAGE)

{'fraction_non_alphanumeric': 0.1768268066209124, 'fraction_numerical': 0.010496568429551878, 'mean_word_length': 5.0884520884520885, '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': '2285443', 'n_tokens_mistral': 1010, 'n_tokens_neox': 953, 'n_words': 249}