diff options
author | Marvin Borner | 2020-08-01 16:26:31 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-01 16:26:31 +0200 |
commit | 55cada295c1be54b84fc30360134c4c73e3cacf1 (patch) | |
tree | 681be98fab1cf0703f09c50726f01f90f6b2ee68 /Makefile | |
parent | 644b6073c99ae4a57a51f0bae6e949e7bba56a2f (diff) |
Restructured makefiles
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 52 |
1 files changed, 4 insertions, 48 deletions
@@ -1,54 +1,10 @@ # MIT License, Copyright (c) 2020 Marvin Borner -COBJS_KERNEL = src/main.o \ - src/drivers/vesa.o \ - src/drivers/cpu.o \ - src/drivers/serial.o \ - src/drivers/interrupts.o \ - src/drivers/interrupts_asm.o \ - src/drivers/keyboard.o \ - src/drivers/ide.o \ - src/drivers/timer.o \ - src/features/fs.o \ - src/features/psf.o \ - src/features/gui.o \ - src/features/load.o \ - src/lib/str.o \ - src/lib/mem.o \ - src/lib/math.o \ - src/lib/conv.o \ - src/lib/print.o -CC = cross/opt/bin/i686-elf-gcc -LD = cross/opt/bin/i686-elf-ld -OC = cross/opt/bin/i686-elf-objcopy -AS = nasm - -# Flags to make the binary smaller TODO: Remove after indirect pointer support! -CSFLAGS = -mpreferred-stack-boundary=2 -fno-asynchronous-unwind-tables -Os - -# TODO: Use lib as external library -CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -fno-builtin -mgeneral-regs-only -std=c99 -m32 -pedantic-errors -Isrc/lib/inc/ -Isrc/inc/ - -ASFLAGS = -f elf32 -O3 - all: compile clean -%.o: %.c - @$(CC) -c $(CFLAGS) $< -o $@ - -%_asm.o: %.asm - @$(AS) $(ASFLAGS) $< -o $@ - -kernel: $(COBJS_KERNEL) - -compile: kernel - @mkdir -p build/ - @$(AS) -f bin src/entry.asm -o build/boot.bin - @$(LD) -N -emain -Ttext 0x00050000 -o build/kernel.bin $(COBJS_KERNEL) --oformat binary - @$(CC) $(CFLAGS) -o build/debug.o $(COBJS_KERNEL) - @$(CC) $(CFLAGS) -fPIE -c apps/test.c -o build/test.o - @$(LD) -o build/test.elf -Tapps/link.ld build/test.o - @$(OC) -O binary build/test.elf build/test +compile: + @$(MAKE) --no-print-directory -C src/ + @$(MAKE) --no-print-directory -C apps/ clean: - @find src/ apps/ -name "*.o" -type f -delete + @find src/ apps/ \( -name "*.o" -or -name "*.elf" \) -type f -delete |