KraKern

C++ Kernel
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/KraKern

commit 51a27121a7332a99194f7e14bbce8d2e3659c12a
parent a4da11ed597d682d8019f0c76bc3237b8db84484
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Thu,  2 Jun 2016 06:02:32 +0200

Add(Makefile & Build)

Diffstat:
A.travis.yml | 9+++++++++
MMakefile | 40+++++++++++++++++++++++++++-------------
2 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -0,0 +1,9 @@ +language: cpp +script: make +sudo: false +addons: + apt: + packages: + - g++ + - nasm + - build-essential diff --git a/Makefile b/Makefile @@ -23,40 +23,54 @@ ASMFLAGS = -f elf -o ## Versions VERSION = 1.0 EXTRAVERSION = dev +SHA = $(shell git rev-parse --verify HEAD) include ./boot/$(ARCH)/Makefile include ./kernel/Makefile include ./lib/Makefile include ./modules/$(ARCH)/Makefile +TOTAL= $(shell echo $(OBJS) | sed 's/ /\n/g' | wc -l) +CURRENT= 01 + all: $(KERNEL) $(KERNEL): $(OBJS) - $(LD) $(LDFLAG) -o $@ $^ + @$(LD) $(LDFLAG) -o $@ $^ + @echo "Linking kernel to $@..." + @echo "Compilation done for $(KERNEL)-$(VERSION)-$(ARCH) ($(SHA))" %.o: %.cpp - $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DNAME=\"$(KERNEL)\" -DARCH=\"$(ARCH)\" -DEXTRAVERSION=\"$(EXTRAVERSION)\" -c $< -o $@ + @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DNAME=\"$(KERNEL)\" -DARCH=\"$(ARCH)\" -DEXTRAVERSION=\"$(EXTRAVERSION)\" -DHASH=\"$(SHA)\" -c $< -o $@ + @echo "[$(shell printf "%02d" $(CURRENT))/$(TOTAL)]\tCompiling (C++) $@..." + $(eval CURRENT=$(shell echo $$(($(CURRENT)+1)))) %.o: %.s $(CC) $(CFLAGS) -c $< -o $@ %.o: %.asm - $(ASM) $(ASMFLAGS) -c $< -o $@ + @$(ASM) $(ASMFLAGS) -c $< -o $@ + @echo "[$(shell printf "%02d" $(CURRENT))/$(TOTAL)]\tCompiling (ASM) $@..." + $(eval CURRENT=$(shell echo $$(($(CURRENT)+1)))) install: $(KERNEL) - rm -f kern.img - cp clean.img kern.img - sudo losetup -o 32256 /dev/loop1 ./kern.img - sudo mount /dev/loop1 /mnt - sudo cp $(KERNEL) /mnt/boot/. - sudo umount /mnt - sudo losetup -d /dev/loop1 - ./qemu.sh + @echo "Installing kernel image..." + @rm -f kern.img + @cp clean.img kern.img + @sudo losetup -o 32256 /dev/loop1 ./kern.img + @sudo mount /dev/loop1 /mnt + @sudo cp $(KERNEL) /mnt/boot/. + @sudo umount /mnt + @sudo losetup -d /dev/loop1 + @echo "Launching KVM..." + @./qemu.sh clean: - rm -f $(OBJS) + @rm -f $(OBJS) + @echo "Cleaning objects..." fclean: clean - rm -f $(KERNEL) + @rm -f $(KERNEL) + @echo "Cleaning Kernel..." re: fclean all