Teemex is a lightweight OS kernel. It was primarily created for learning purposes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ##
  2. ## Makefile
  3. ##
  4. ## This Makefile contains all neccesary build routines.
  5. ##
  6. ## Created on: 13.01.2018
  7. ## Author: Dennis Lucas Buchholz
  8. ##
  9. # Default programs used for building...
  10. CC := gcc
  11. LD := ld
  12. WARNINGS := -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align \
  13. -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations \
  14. -Wredundant-decls -Wnested-externs -Winline -Wno-long-long \
  15. -Wconversion -Wstrict-prototypes
  16. CFLAGS := -g -O2 -nostdlib -nostartfiles -nodefaultlibs -m32 -Iinclude $(WARNINGS)
  17. PREFIX := teemex
  18. INCLUDEDIR := $(PREFIX)/include
  19. LIBDIR := $(PREFIX)/lib
  20. OBJS := tty.o
  21. .PHONY: clean
  22. teemex: teemex.bin
  23. make clean
  24. lib/string.c.o: lib/string.c
  25. @$(CC) $(CFLAGS) -MMD -MP -c lib/string.c -o lib/string.c.o
  26. arch/x86/tty.c.o: arch/x86/tty.c
  27. @$(CC) $(CFLAGS) -MMD -MP -c arch/x86/tty.c -o arch/x86/tty.c.o
  28. arch/x86/boot.asm.o: arch/x86/boot.asm
  29. nasm -f elf32 -o arch/x86/boot.asm.o arch/x86/boot.asm
  30. init/main.c.o: init/main.c
  31. @$(CC) $(CFLAGS) -MMD -MP -c init/main.c -o init/main.c.o
  32. teemex.bin: lib/string.c.o arch/x86/boot.asm.o arch/x86/tty.c.o init/main.c.o
  33. ld -T arch/x86/linker.ld -m elf_i386 -o teemex.bin lib/string.c.o arch/x86/boot.asm.o arch/x86/tty.c.o init/main.c.o
  34. # Will come up with a better solution ... later :)
  35. clean:
  36. rm */*.o
  37. rm */*.d
  38. rm */*/*.o
  39. rm */*/*.d