Fix kernel Makefile cleaning root directory files if CPU is unset.
This commit is contained in:
parent
60f85af7c4
commit
825029a24a
|
@ -30,26 +30,32 @@ BOOTOBJS:=
|
||||||
|
|
||||||
ifeq ($(CPU),x86)
|
ifeq ($(CPU),x86)
|
||||||
X86FAMILY:=1
|
X86FAMILY:=1
|
||||||
CPUOBJS:=$(CPU)/boot.o $(CPU)/base.o
|
CPUDIR:=$(CPU)
|
||||||
|
CPUOBJS:=$(CPUDIR)/boot.o $(CPUDIR)/base.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CPU),x64)
|
ifeq ($(CPU),x64)
|
||||||
X86FAMILY:=1
|
X86FAMILY:=1
|
||||||
|
CPUDIR:=$(CPU)
|
||||||
CXXFLAGS:=$(CXXFLAGS) -mno-red-zone -mno-mmx -mno-sse -mno-sse2
|
CXXFLAGS:=$(CXXFLAGS) -mno-red-zone -mno-mmx -mno-sse -mno-sse2
|
||||||
CPUOBJS:=$(CPU)/boot.o $(CPU)/base.o
|
CPUOBJS:=$(CPUDIR)/boot.o $(CPUDIR)/base.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef CPUDIR
|
||||||
|
CPUDIR=.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef X86FAMILY
|
ifdef X86FAMILY
|
||||||
CPUOBJS:=$(CPUOBJS) \
|
CPUOBJS:=$(CPUOBJS) \
|
||||||
$(CPU)/memorymanagement.o \
|
$(CPUDIR)/memorymanagement.o \
|
||||||
x86-family/memorymanagement.o \
|
x86-family/memorymanagement.o \
|
||||||
$(CPU)/interrupt.o \
|
$(CPUDIR)/interrupt.o \
|
||||||
x86-family/interrupt.o \
|
x86-family/interrupt.o \
|
||||||
x86-family/ioport.o \
|
x86-family/ioport.o \
|
||||||
x86-family/pic.o \
|
x86-family/pic.o \
|
||||||
x86-family/gdt.o \
|
x86-family/gdt.o \
|
||||||
x86-family/idt.o \
|
x86-family/idt.o \
|
||||||
$(CPU)/syscall.o \
|
$(CPUDIR)/syscall.o \
|
||||||
x86-family/cmos.o \
|
x86-family/cmos.o \
|
||||||
x86-family/time.o \
|
x86-family/time.o \
|
||||||
x86-family/mtrr.o \
|
x86-family/mtrr.o \
|
||||||
|
@ -60,10 +66,10 @@ endif
|
||||||
|
|
||||||
# Object files that constitute the kernel.
|
# Object files that constitute the kernel.
|
||||||
|
|
||||||
CRTI_OBJ:=$(CPU)/crti.o
|
CRTI_OBJ:=$(CPUDIR)/crti.o
|
||||||
CRTBEGIN_OBJ:=$(shell $(HOSTCXX) $(CXXFLAGS) -print-file-name=crtbegin.o)
|
CRTBEGIN_OBJ:=$(shell $(HOSTCXX) $(CXXFLAGS) -print-file-name=crtbegin.o)
|
||||||
CRTEND_OBJ:=$(shell $(HOSTCXX) $(CXXFLAGS) -print-file-name=crtend.o)
|
CRTEND_OBJ:=$(shell $(HOSTCXX) $(CXXFLAGS) -print-file-name=crtend.o)
|
||||||
CRTN_OBJ:=$(CPU)/crtn.o
|
CRTN_OBJ:=$(CPUDIR)/crtn.o
|
||||||
|
|
||||||
LIBS=\
|
LIBS=\
|
||||||
-nostdlib \
|
-nostdlib \
|
||||||
|
@ -78,7 +84,7 @@ ata.o \
|
||||||
clock.o \
|
clock.o \
|
||||||
com.o \
|
com.o \
|
||||||
copy.o \
|
copy.o \
|
||||||
$(CPU)/kthread.o \
|
$(CPUDIR)/kthread.o \
|
||||||
crc32.o \
|
crc32.o \
|
||||||
debugger.o \
|
debugger.o \
|
||||||
descriptor.o \
|
descriptor.o \
|
||||||
|
|
Loading…
Reference in New Issue