@@ -295,7 +295,6 @@ USB_SIZE_MIB := 64
295295# source files for the C-kernel ...
296296# -----------------------------------------------------------------------------
297297SRC_SHELL :=\
298- $(SRC ) /user32/shell32/shell_loader.cc \
299298 $(SRC ) /user32/shell32/shell.cc
300299
301300RUN_CPO := \
@@ -351,13 +350,6 @@ SRCC := $(COR_DIR)/ckernel.cc \
351350 $(SRC_KXSTL ) \
352351 \
353352 $(SRC_SHELL )
354- # -----------------------------------------------------------------------------
355- # source files for the C-kernel ...
356- # -----------------------------------------------------------------------------
357- SHSRCC := \
358- $(SRC ) /shell.c \
359- $(SRC ) /ps2_mouse.cc \
360- $(SRC ) /paging.c
361353
362354# -----------------------------------------------------------------------------
363355# *.o bject files for linkage stage of the C-kernel ...
@@ -386,13 +378,14 @@ OBJS := $(OBJ_DIR)/coff/ckernel.o \
386378 $(OBJ_DIR ) /coff/ahci.o \
387379 $(OBJ_DIR ) /coff/ps2_mouse.o \
388380 $(OBJ_DIR ) /coff/shell_loader.o \
389- $(OBJ_DIR ) /coff/shell.o \
390381 $(OBJ_DIR ) /coff/int86_blob.o \
391382 $(OBJ_DIR ) /coff/int86.o \
392383 $(OBJ_DIR ) /coff/pe.o \
393384 $(OBJ_DIR ) /coff/wm.o \
394385 $(OBJ_DIR ) /coff/kheap.o \
395386 \
387+ $(OBJ_DIR ) /coff/elf_loader.o \
388+ \
396389 $(RUN_CPO ) \
397390 $(OBJ_DIR ) /coff/kstl.o \
398391 \
@@ -403,14 +396,7 @@ OBJS := $(OBJ_DIR)/coff/ckernel.o \
403396# *.o bject files for linkage stage of the shell ...
404397# -----------------------------------------------------------------------------
405398SHOBJS := \
406- $(OBJ_DIR ) /coff/shell.o \
407- $(OBJ_DIR ) /coff/kheap.o \
408- $(OBJ_DIR ) /coff/math.o \
409- $(OBJ_DIR ) /coff/paging.o \
410- $(OBJ_DIR ) /coff/ps2_mouse.o \
411- $(OBJ_DIR ) /coff/vga.o \
412- $(OBJ_DIR ) /coff/video.o \
413- $(OBJ_DIR ) /coff/util.o
399+ $(OBJ_DIR ) /elf/shell.o
414400
415401ISO_FILES := /boot2.bin /kernel.bin
416402LBA := $(COR_DIR ) /lba.inc
@@ -519,10 +505,6 @@ $(eval $(call compile_rule,$(SRC_DIR)/fntres))
519505DEPS := $(patsubst $(OBJ_DIR ) /coff/% .o,$(DEP_DIR ) /coff/% .d,$(OBJS ) )
520506-include $(DEPS )
521507
522- $(OBJ_DIR ) /coff/% .o : $(SRC_DIR ) /user32/shell32/% .c
523- $(GCC ) $(CFLAGS_C ) -c $< -o $@
524- $(OBJ_DIR ) /coff/% .o : $(SRC_DIR ) /user32/shell32/% .cc
525- $(CPP ) $(CFLAGS_CC ) -c $< -o $@
526508# -----------------------------------------------------------------------------
527509# link C-kernel to finaly output binary image ...
528510# -----------------------------------------------------------------------------
@@ -549,12 +531,21 @@ $(SRC)/initrd.dat: $(BIN)/INITRD.EXE
549531$(BIN ) /INITRD.EXE : $(OBJ ) /make_initrd.o
550532 $(GCC ) -m32 -mconsole -O2 -Wall -Wextra -o $@ $<
551533 $(STRIP ) $@
552-
553- $(OBJ ) /shell.bin : $(SHOBJS ) $(SRC ) /shell.ld
554- $(LD ) $(LDSHFLGS ) -o $(OBJ ) /shell.bin $(SHOBJS )
555-
556- $(BIN ) /shell.exe : $(OBJ ) /shell.bin
534+ # -----------------------------------------------------------------------------
535+ #
536+ # -----------------------------------------------------------------------------
537+ $(OBJ_DIR ) /elf/% .o : $(SRC_DIR ) /user32/shell32/% .c
538+ $(GCC ) $(CFLAGS_C ) -c $< -o $@
539+ $(OBJ_DIR ) /elf/% .o : $(SRC_DIR ) /user32/shell32/% .cc
540+ $(CPP ) $(CFLAGS_CC ) -c $< -o $@
541+ $(OBJ_DIR ) /elf/shell.bin : \
542+ $(OBJ_DIR)/elf/user32.o \
543+ $(SRC_DIR)/user32/shell32/shell.ld
544+ $(LD) $(LDSHFLGS) -o $(OBJ_DIR)/elf/shell.bin $(SHOBJS)
545+ $(BIN ) /shell.elf : $(OBJ_DIR ) /elf/shell.bin
557546 $(OBJCOPY ) -O binary $(OBJ ) /shell.bin $(BIN ) /shell.exe
547+ shell : $(BIN ) /shell.elf
548+ echo " dodo"
558549
559550$(BIN_DIR ) /bootcd.iso : \
560551 $(BIN_DIR)/content/boot1.bin $(BIN_DIR)/content/boot2.bin \
@@ -594,7 +585,7 @@ clean:
594585bootcd :
595586 /mingw64/bin/qemu-system-x86_64.exe \
596587 -drive file=$(BIN_DIR)/bootcd.iso,if=none,media=cdrom,id=cdrom0 \
597- -machine q35,i8042=on \
588+ -machine q35,i8042=on \
598589 -device ich9-ahci,id=ahci0 \
599590 -device ide-cd,drive=cdrom0,bus=ahci0.0 \
600591 -boot d -m 512M
0 commit comments