Corrected colors
This commit is contained in:
parent
ced70b9c88
commit
36cb0bf7d1
62
Makefile
62
Makefile
|
@ -148,28 +148,28 @@ DriverDep=$(patsubst %.c,$(KOBJDIR)/%.d,$(DriverSources))
|
|||
|
||||
ifeq ($(compile-cross-cc), no)
|
||||
$(CROSS-CC-DIR)/bin/x86_64-elf-gcc:
|
||||
@echo ${CL2}[$@] ${NC} Downloading and extracting the cross-compiler...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC} Downloading and extracting the cross-compiler...${CL3}
|
||||
@wget $(LATEST-CROSS-CC) -O $(CROSS-CC-DIR).tar.xz -q -c --show-progress
|
||||
@tar -xaf $(CROSS-CC-DIR).tar.xz --skip-old-files
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
endif
|
||||
|
||||
ifeq ($(compile-cross-cc), yes)
|
||||
$(CROSS-CC-DIR)/bin/x86_64-elf-gcc:
|
||||
@echo ${CL2}[$@] ${NC} Downloading and extracting the cross-compiler sources...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC} Downloading and extracting the cross-compiler sources...${CL3}
|
||||
@wget $(LATEST-CROSS-CC-SOURCES) -O $(CROSS-CC-DIR)-builder.tar -q -c --show-progress
|
||||
@mkdir -p $(CROSS-CC-DIR)-builder
|
||||
@tar -xvf $(CROSS-CC-DIR)-builder.tar --skip-old-files -C $(CROSS-CC-DIR)-builder --strip-components 1
|
||||
cd $(CROSS-CC-DIR)-builder && make
|
||||
ln -s $(CROSS-CC-DIR)-builder/cross-cc $(CROSS-CC-DIR)
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
endif
|
||||
|
||||
./ProjectTree: ./.stylehlp_sh
|
||||
@cat ./.stylehlp_sh > ./ProjectTree
|
||||
@echo "\n" >> ./ProjectTree
|
||||
@echo -e "\n" >> ./ProjectTree
|
||||
@tree --dirsfirst -I "bin|obj|cross-cc*">> ./ProjectTree
|
||||
@echo ${CL2}[$@] ${CL}Generated.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Generated.${CL3}
|
||||
|
||||
$(KOBJDIR):
|
||||
@mkdir -p $(KOBJDIR)
|
||||
|
@ -195,7 +195,7 @@ $(KOBJDIR)/libc/atoi.o: $(KALEIDDIR)/libc/atoi.c | $(KOBJDIR)
|
|||
@$(KCC) -D_NEED_ATOUL $< -o $@.4
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 $@.3 $@.4 -o $@
|
||||
@rm -f $@.1 $@.2 $@.3 $@.4
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/libc/itoa.o: $(KALEIDDIR)/libc/itoa.c | $(KOBJDIR)
|
||||
@mkdir -p $(shell dirname $@)
|
||||
|
@ -205,12 +205,12 @@ $(KOBJDIR)/libc/itoa.o: $(KALEIDDIR)/libc/itoa.c | $(KOBJDIR)
|
|||
@$(KCC) -D_NEED_ULTOA $< -o $@.4
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 $@.3 $@.4 -o $@
|
||||
@rm -f $@.1 $@.2 $@.3 $@.4
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/libc/mem.o: $(KALEIDDIR)/libc/mem.c | $(KOBJDIR)
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(KCC) -fno-strict-aliasing $< -o $@
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
|
||||
## KERNEL SPECIAL RECIPES MAKEFILE ------------------------------------------- #
|
||||
|
@ -222,7 +222,7 @@ $(KOBJDIR)/kernel/ke/idt.o: $(KALEIDDIR)/kernel/ke/idt.c \
|
|||
@$(KCC) $< -o $@.2
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 -o $@
|
||||
@rm -f $@.1 $@.2
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/kernel/ke/cpuid.o: $(KALEIDDIR)/kernel/ke/cpuid.c \
|
||||
$(KALEIDDIR)/kernel/ke/cpuf.asm | $(KOBJDIR)
|
||||
|
@ -231,12 +231,12 @@ $(KOBJDIR)/kernel/ke/cpuid.o: $(KALEIDDIR)/kernel/ke/cpuid.c \
|
|||
@$(KCC_MATHS) $< -o $@.2
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 -o $@
|
||||
@rm -f $@.1 $@.2
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/kernel/ke/shcmds.o: $(KALEIDDIR)/kernel/sh/shcmds.c | $(KOBJDIR)
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(KCC_MATHS) -MM -MT $(@:%.d=%.o) -MF $@ $<
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/kernel/mm/paging.o: $(KALEIDDIR)/kernel/mm/paging.c \
|
||||
$(KALEIDDIR)/kernel/mm/paging.asm | $(KOBJDIR)
|
||||
|
@ -245,7 +245,7 @@ $(KOBJDIR)/kernel/mm/paging.o: $(KALEIDDIR)/kernel/mm/paging.c \
|
|||
@$(KCC) $< -o $@.2
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 -o $@
|
||||
@rm -f $@.1 $@.2
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(KOBJDIR)/kernel/mm/gdt.o: $(KALEIDDIR)/kernel/mm/gdt.c \
|
||||
$(KALEIDDIR)/kernel/mm/gdt.asm | $(KOBJDIR)
|
||||
|
@ -254,7 +254,7 @@ $(KOBJDIR)/kernel/mm/gdt.o: $(KALEIDDIR)/kernel/mm/gdt.c \
|
|||
@$(KCC) $< -o $@.2
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 -o $@
|
||||
@rm -f $@.1 $@.2
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
## DRIVERS SPECIAL RECIPES MAKEFILE ------------------------------------------ #
|
||||
|
||||
|
@ -264,7 +264,7 @@ $(KOBJDIR)/drivers/ata.o: $(KALEIDDIR)/drivers/ata.c $(KALEIDDIR)/drivers/ata.as
|
|||
@$(KCC) $< -o $@.2
|
||||
@$(LD) $(LDFLAGS) -r $@.1 $@.2 -o $@
|
||||
@rm -f $@.1 $@.2
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
|
||||
## DEPENDENCIES MAKEFILE ----------------------------------------------------- #
|
||||
|
@ -272,39 +272,39 @@ $(KOBJDIR)/drivers/ata.o: $(KALEIDDIR)/drivers/ata.c $(KALEIDDIR)/drivers/ata.as
|
|||
$(KOBJDIR)/%.d: %.c $(CROSS-CC-DIR)/bin/x86_64-elf-gcc | $(KOBJDIR)
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(KCC) -MM -MT $(@:%.d=%.o) -MF $@ $<
|
||||
@echo ${CL2}[$@] ${CL}Dependencies generated.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Dependencies generated.${CL3}
|
||||
|
||||
## MAIN MAKEFILE ------------------------------------------------------------- #
|
||||
|
||||
$(KOBJDIR)/%.o: %.c | $(KOBJDIR)
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(KCC) $< -o $@
|
||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||
|
||||
$(BINDIR)/kaleid: $(LOBJDIR)/kaleid.x86_64
|
||||
@echo ${CL2}[$@] ${NC}Objcopy...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC}Objcopy...${CL3}
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(OBJCOPY) -I elf64-x86-64 -O elf32-i386 $(LOBJDIR)/kaleid.x86_64 \
|
||||
$(BINDIR)/kaleid
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
|
||||
$(LOBJDIR)/kaleid.x86_64: $(LibCObj) $(KernObj) $(DriverObj) \
|
||||
$(LOBJDIR)/loader.o $(BUILDDIR)/kernel.ld
|
||||
@echo ${CL2}[$@] ${NC}Linking kernel objects...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC}Linking kernel objects...${CL3}
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(LD) $(LDFLAGS) -T $(BUILDDIR)/kernel.ld \
|
||||
$(LOBJDIR)/loader.o $(KernObj) $(DriverObj) $(LibCObj) \
|
||||
-o $(LOBJDIR)/kaleid.x86_64
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
|
||||
$(LOBJDIR)/loader.o: $(LOADERDIR)/loader.asm $(LOADERDIR)/*/*.inc
|
||||
@echo ${CL2}[$@] ${NC}Making loader...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC}Making loader...${CL3}
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(ASM) $(ASMFLAGS) $(LOADERDIR)/loader.asm -o $(LOBJDIR)/loader.o > /dev/null
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
|
||||
OS/K: $(dep) ./ProjectTree $(BINDIR)/kaleid
|
||||
@echo ${CL2}[[$@]] ${NC} OS/K successfully made, $(mode) mode.${CL3}
|
||||
@echo -e ${CL2}[[$@]] ${NC} OS/K successfully made, $(mode) mode.${CL3}
|
||||
|
||||
all : $(CROSS-CC-DIR)/bin/x86_64-elf-gcc
|
||||
@make OS/K -j $(NTHREADS)
|
||||
|
@ -369,28 +369,28 @@ dddnokvm: all installonimage
|
|||
## HD IMAGE RELATED ---------------------------------------------------------- #
|
||||
|
||||
installonimage: $(installdisk) $(MBRDIR)/grub.cfg
|
||||
@echo ${CL2}[$@] ${NC}Installing boot configuration on image...${CL3}
|
||||
@echo -e ${CL2}[$@] ${NC}Installing boot configuration on image...${CL3}
|
||||
@$(BUILDDIR)/install-os-k.sh $(installdisk) $(MBRDIR)/grub.cfg $(BINDIR)/kaleid
|
||||
@echo ${CL2}[$@] ${CL}Success.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Success.${CL3}
|
||||
|
||||
$(installdisk): $(BUILDDIR)/create_disk.sh
|
||||
@echo ${CL2}[$@]${NC} Constructing disk image $@...${CL3}
|
||||
@echo -e ${CL2}[$@]${NC} Constructing disk image $@...${CL3}
|
||||
@mkdir -p $(shell dirname $@)
|
||||
@$(BUILDDIR)/create_disk.sh $(installdisk)
|
||||
@echo ${CL2}[$@]${NC} Constructing disk image...${CL3}
|
||||
@echo -e ${CL2}[$@]${NC} Constructing disk image...${CL3}
|
||||
|
||||
|
||||
## CLEANUP RELATED ----------------------------------------------------------- #
|
||||
|
||||
dust:
|
||||
@rm -Rf $(OBJDIR)/*
|
||||
@echo ${CL2}[$@] ${CL}Cleaned.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Cleaned.${CL3}
|
||||
|
||||
clean:
|
||||
@rm -Rvf ./ProjectTree $(BUILDDIR)/*.log
|
||||
@rm -Rvf $(BINDIR) $(OBJDIR)
|
||||
@echo ${CL2}[$@] ${CL}Cleaned.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Cleaned.${CL3}
|
||||
|
||||
update-cross-cc:
|
||||
@rm -rf cross-cc
|
||||
@echo ${CL2}[$@] ${CL}Ready to update.${CL3}
|
||||
@echo -e ${CL2}[$@] ${CL}Ready to update.${CL3}
|
||||
|
|
Loading…
Reference in New Issue