@@ -169,16 +169,22 @@ OBJCOPY := $(shell command which objcopy)$(EXT)
169169# LICENSE in the root directory of this reporsitory.
170170# -----------------------------------------------------------------------------
171171# .PHONY: confirm
172- all : confirm clean setup shell32 $(BIN_DIR ) /bootcd.iso
172+ all : confirm clean setup dosshell $(BIN_DIR ) /bootcd.iso
173173setup :
174- $(MKDIR ) -p $(BUI_DIR ) $(BUI_DIR ) /bin $(BUI_DIR ) /bin/content $(BUI_DIR ) /hex
175- $(MKDIR ) -p $(BIN_DIR ) /content/img $(BUI_DIR ) /obj $(BUI_DIR ) /obj/pe
176- $(MKDIR ) -p $(OBJ_DIR ) /user32/TurboVision/platform
177- $(MKDIR ) -p $(OBJ_DIR ) /user32/TurboVision
178- $(MKDIR ) -p $(OBJ_DIR ) /user32/rtl
179- $(MKDIR ) -p $(OBJ_DIR ) /user32/shell32
180- $(MKDIR ) -p $(OBJ_DIR ) /stl
181-
174+ @ ( $( MKDIR) -p $( BUI_DIR) $( BUI_DIR) /bin $( BUI_DIR) /bin/content $( BUI_DIR) /hex ; \
175+ $(MKDIR) -p $(BIN_DIR)/content/img ;\
176+ $(MKDIR) -p $(BIN_DIR)/content/img/shell ;\
177+ $(MKDIR) -p $(BUI_DIR)/obj ;\
178+ $(MKDIR) -p $(BUI_DIR)/obj/pe ;\
179+ $(MKDIR) -p $(OBJ_DIR)/user32/TurboVision/platform ;\
180+ $(MKDIR) -p $(OBJ_DIR)/user32/TurboVision ;\
181+ $(MKDIR) -p $(OBJ_DIR)/user32/rtl ;\
182+ $(MKDIR) -p $(OBJ_DIR)/user32/dosshell ;\
183+ $(MKDIR) -p $(OBJ_DIR)/user32/winshell ;\
184+ $(MKDIR) -p $(OBJ_DIR)/user32/conshell ;\
185+ $(MKDIR) -p $(OBJ_DIR)/user32/amishell ;\
186+ $(MKDIR) -p $(OBJ_DIR)/stl \
187+ )
182188 $(COPY) $(IMG_DIR)/*.bmp $(BIN_DIR)/content/img
183189 ( cd $(SRC_DIR)/fntres ;\
184190 $(SRC_DIR)/fntres/build.sh ;\
@@ -285,7 +291,11 @@ CFLAGS_CC:= -std=c++20 $(CFLAGS_C) \
285291 -fno-threadsafe-statics
286292
287293LDFLAGS := -nostdlib -T $(COR_DIR ) /kernel.ld -Map $(BIN_DIR ) /kernel.map
288- LDSHFLGS := -nostdlib -T $(U32_DIR ) /shell32/shell32.ld -Map $(BIN_DIR ) /shell32.map
294+
295+ LDSHFLGS := -nostdlib -T $(U32_DIR ) /dosshell/dosshell.ld -Map $(BIN_DIR ) /dosshell.map
296+ LDWHFLGS := -nostdlib -T $(U32_DIR ) /winshell/winshell.ld -Map $(BIN_DIR ) /winshell.map
297+ LDCHFLGS := -nostdlib -T $(U32_DIR ) /conshell/conshell.ld -Map $(BIN_DIR ) /conshell.map
298+ LDAHFLGS := -nostdlib -T $(U32_DIR ) /conshell/amishell.ld -Map $(BIN_DIR ) /amishell.map
289299
290300ASMFLAGS := -f win32 -O2 -DDOS_MODE=32
291301ISOGUI ?= 0
@@ -314,15 +324,15 @@ BIN := $(BASEDIR)/build/bin
314324PART_START_SECTOR := 2048
315325USB_SIZE_MIB := 64
316326
317- KERNEL_PASS := 0
318- SHELL32_PASS := 1
319- STL32_PASS := 2
327+ KERNEL_PASS := 0
328+ DOSSHELL_PASS := 1
329+ STL32_PASS := 2
320330
321331# -----------------------------------------------------------------------------
322332# source files for the C-kernel ...
323333# -----------------------------------------------------------------------------
324334SRC_SHELL :=\
325- $(SRC ) /user32/shell32/shell32 .cc \
335+ $(SRC ) /user32/dosshell/dosshell .cc \
326336 $(SRC ) /user32/rtl/rtl_ExitProcess.c
327337
328338RUN_CPO := \
@@ -428,10 +438,10 @@ OBJS := $(OBJ_DIR)/coff/ckernel.o \
428438# -----------------------------------------------------------------------------
429439# *.o bject files for linkage stage of the shell ...
430440# -----------------------------------------------------------------------------
431- SHOBJS := \
432- $(OBJ_DIR ) /user32/shell32/shell32.o \
433- $(OBJ_DIR ) /user32/shell32 /no_rtti.o \
434- $(OBJ_DIR ) /user32/shell32/shell32_app.o \
441+ DOS32OBJS := \
442+ $(OBJ_DIR ) /user32/dosshell/dosshell.o \
443+ $(OBJ_DIR ) /user32/dosshell /no_rtti.o \
444+ $(OBJ_DIR ) /user32/dosshell/dosshell_app.o \
435445 $(OBJ_DIR ) /user32/symbol_table.o \
436446 $(OBJ_DIR ) /user32/TurboVision/Application.o \
437447 $(OBJ_DIR ) /user32/TurboVision/TObject.o \
@@ -446,6 +456,28 @@ SHOBJS := \
446456 $(OBJ_DIR ) /user32/rtl/rtl_ExitProcess.o \
447457 $(OBJ_DIR ) /stl/stl_init.o
448458
459+ # -----------------------------------------------------------------------------
460+ # *.o bject files for linkage stage of the C64 simulator ...
461+ # -----------------------------------------------------------------------------
462+ WIN32OBJS := \
463+ $(OBJ_DIR ) /user32/winshell/winshell.o \
464+ $(OBJ_DIR ) /user32/no_rtti.o \
465+ $(OBJ_DIR ) /coff/video.o \
466+ $(OBJ_DIR ) /coff/vga.o \
467+ $(OBJ_DIR ) /coff/bitmap.o
468+
469+ # -----------------------------------------------------------------------------
470+ # *.o bject files for linkage stage of c64 kernel ...
471+ # -----------------------------------------------------------------------------
472+ CON32OBJS := \
473+ $(OBJ_DIR ) /user32/conshell/conshell.o
474+
475+ # -----------------------------------------------------------------------------
476+ # *.o bject files for linkage stage of c64 kernel ...
477+ # -----------------------------------------------------------------------------
478+ AMI32OBJS := \
479+ $(OBJ_DIR ) /user32/amishell/amishell.o
480+
449481ISO_FILES := /boot2.bin /kernel.bin
450482LBA := $(COR_DIR ) /lba.inc
451483ISO := $(BIN_DIR ) /bootcd.iso
@@ -533,58 +565,63 @@ $(BIN_DIR)/content/boot2.bin: $(COR_DIR)/boot/boot2.asm
533565# compile all *.c, *.cc, and *.asm files to *.o bject files ...
534566# -----------------------------------------------------------------------------
535567define compile_rule
536- $(2 ) / %.s: $(3 ) /%.c
568+ $(OBJ_DIR ) / $( 1 ) %.s: $(2 ) /%.c
537569 $(MKDIR ) -p $(dir $$@ ) $(DEP_DIR ) /coff/$(dir $$* )
538570 $(GCC ) -m32 $(CFLAGS_C ) -MMD -MP \
539571 -MF $(DEP_DIR ) /coff/$$* .d -MT $$@ \
540572 -S $$< -o $$@
541- @if [ "$(1 ) " = "$(SHELL32_PASS ) " ] || [ "$(1 ) " = "$(STL32_PASS ) " ]; then \
542- $(SED ) -i "/^[[:space:]]*\.ident[[:space:]]*\"GCC:/d" $$@ ; \
543- fi
544-
545- $(2 ) / %.s: $(3 ) /%.cc
573+ # @if [ "$(1)" = "$(DOSSHELL_PASS )" ] || [ "$(1)" = "$(STL32_PASS)" ]; then \
574+ # $(SED) -i "/^[[:space:]]*\.ident[[:space:]]*\"GCC:/d" $$@; \
575+ # fi
576+
577+ $(OBJ_DIR ) / $( 1 ) %.s: $(2 ) /%.cc
546578 $(MKDIR ) -p $(dir $$@ ) $(DEP_DIR ) /coff/$(dir $$* )
547579 $(CPP ) -m32 $(CFLAGS_CC ) -MMD -MP \
548580 -MF $(DEP_DIR ) /coff/$$* .d -MT $$@ \
549581 -S $$< -o $$@
550- @if [ "$(1 ) " = "$(SHELL32_PASS ) " ] || [ "$(1 ) " = "$(STL32_PASS ) " ]; then \
551- $(SED ) -i "/^[[:space:]]*\.ident[[:space:]]*\"GCC:/d" $$@ ; \
552- fi
582+ # @if [ "$(1)" = "$(DOSSHELL_PASS )" ] || [ "$(1)" = "$(STL32_PASS)" ]; then \
583+ # $(SED) -i "/^[[:space:]]*\.ident[[:space:]]*\"GCC:/d" $$@; \
584+ # fi
553585
554- $(2 ) / %.o: $(3 ) /%.s
586+ $(OBJ_DIR ) / $( 1 ) %.o: $(2 ) /%.s
555587 $(GCC ) -m32 $(CFLAGS_C ) -c $$< -o $$(patsubst % .s,% .o,$$@ )
556588
557- $(2 ) / %.o: $(3 ) /%.asm
589+ $(OBJ_DIR ) / $( 1 ) %.o: $(2 ) /%.asm
558590 $(MKDIR ) -p $(dir $$@ )
559591 nasm $(ASMFLAGS ) $$< -o $$@
560592endef
561593
562- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(COR_DIR)))
563- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(COR_DIR)/fs/iso9660))
564- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(COR_DIR)/video))
594+ $(eval $(call compile_rule,coff,$(COR_DIR)))
595+ $(eval $(call compile_rule,coff,$(COR_DIR)/fs/iso9660))
596+ $(eval $(call compile_rule,coff,$(COR_DIR)/video))
565597
566598# -----------------------------------------------------------------------------
567599# compile rule for program loaders ...
568600# -----------------------------------------------------------------------------
569- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(COR_DIR)/loader/elf))
570- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(COR_DIR)/loader/pe))
601+ $(eval $(call compile_rule,coff,$(COR_DIR)/loader/elf))
602+ $(eval $(call compile_rule,coff,$(COR_DIR)/loader/pe))
571603
572- $(eval $(call compile_rule,$(KERNEL_PASS),$(OBJ_DIR)/ coff,$(SRC_DIR)/fntres))
604+ $(eval $(call compile_rule,coff,$(SRC_DIR)/fntres))
573605
574606# -----------------------------------------------------------------------------
575607# static RTL - run time library ...
576608# -----------------------------------------------------------------------------
577- $(eval $(call compile_rule,$(STL32_PASS),$(OBJ_DIR)/ stl,$(SRC_DIR)/stl/src))
609+ $(eval $(call compile_rule,stl,$(SRC_DIR)/stl/src))
578610
579611# -----------------------------------------------------------------------------
580612# create TurboVision (BORLAND) text user interface ...
581613# -----------------------------------------------------------------------------
582- $(eval $(call compile_rule,$(SHELL32_PASS),$(OBJ_DIR)/user32/TurboVision,$(SRC_DIR)/user32/TurboVision/src))
583- $(eval $(call compile_rule,$(SHELL32_PASS),$(OBJ_DIR)/user32/TurboVision/platform,$(SRC_DIR)/user32/TurboVision/src/platform))
584- $(eval $(call compile_rule,$(SHELL32_PASS),$(OBJ_DIR)/user32/rtl,$(SRC_DIR)/user32/rtl))
614+ $(eval $(call compile_rule,user32/TurboVision,$(SRC_DIR)/user32/TurboVision/src))
615+ $(eval $(call compile_rule,user32/TurboVision/platform,$(SRC_DIR)/user32/TurboVision/src/platform))
616+ $(eval $(call compile_rule,user32/rtl,$(SRC_DIR)/user32/rtl))
617+
618+ $(eval $(call compile_rule,user32,$(SRC_DIR)/user32))
585619
586- $(eval $(call compile_rule,$(SHELL32_PASS),$(OBJ_DIR)/user32,$(SRC_DIR)/user32))
587- $(eval $(call compile_rule,$(SHELL32_PASS),$(OBJ_DIR)/user32/shell32,$(SRC_DIR)/user32/shell32))
620+ $(eval $(call compile_rule,user32/dosshell,$(SRC_DIR)/user32/dosshell))
621+ $(eval $(call compile_rule,user32/winshell,$(SRC_DIR)/user32/winshell))
622+
623+ $(eval $(call compile_rule,user32/conshell,$(SRC_DIR)/user32/conshell))
624+ $(eval $(call compile_rule,user32/amishell,$(SRC_DIR)/user32/amishell))
588625
589626DEPS := $(patsubst $(OBJ_DIR ) /coff/% .o,$(DEP_DIR ) /coff/% .d,$(OBJS ) )
590627-include $(DEPS )
@@ -602,19 +639,54 @@ $(OBJ_DIR)/kernel.bin: $(OBJ_DIR)/coff/kernel.o
602639# -----------------------------------------------------------------------------
603640# create PE32 shell32 application
604641# -----------------------------------------------------------------------------
605- $(BIN_DIR ) /content/shell32 .exe : $(SHOBJS ) \
606- $(SRC_DIR)/user32/shell32/shell32 .ld
607- $(GCC) -m32 -mconsole $(CFLAGS_C) -o $(BIN_DIR)/content/shell32.exe $(SHOBJS )
642+ $(BIN_DIR ) /content/shell/dosshell .exe : $(DOS32OBJS ) \
643+ $(SRC_DIR)/user32/dosshell/dosshell .ld
644+ $(GCC) -m32 -mconsole $(CFLAGS_C) -o $@ $(DOS32OBJS )
608645
609- shell32 : $(BIN_DIR ) /content/shell32 .exe
610- strip $(BIN_DIR ) /content/shell32 .exe
646+ dosshell : $(BIN_DIR ) /content/shell/dosshell .exe
647+ strip $(BIN_DIR ) /content/shell/dosshell .exe
611648 objcopy --remove-section .eh_frame \
612649 --remove-section .eh_frame_hdr \
613- --remove-section .gcc_except_table \
614- $(BIN_DIR)/content/shell32.exe \
615- $(BIN_DIR)/content/shell32.exe
616- echo "dodo"
650+ --remove-section .gcc_except_table \
651+ $(BIN_DIR)/content/shell/dosshell.exe \
652+ $(BIN_DIR)/content/shell/dosshell.exe
653+ # -----------------------------------------------------------------------------
654+ $(BIN_DIR ) /content/shell/winshell.exe : $(WIN32OBJS ) \
655+ $(SRC_DIR)/user32/winshell/winshell.ld
656+ $(GCC) -m32 -mconsole $(CFLAGS_C) -o $@ $(WIN32OBJS)
617657
658+ winshell : $(BIN_DIR ) /content/shell/winshell.exe
659+ strip $(BIN_DIR ) /content/shell/winshell.exe
660+ objcopy --remove-section .eh_frame \
661+ --remove-section .eh_frame_hdr \
662+ --remove-section .gcc_except_table \
663+ $(BIN_DIR)/content/shell/winshell.exe \
664+ $(BIN_DIR)/content/shell/winshell.exe
665+ # -----------------------------------------------------------------------------
666+ $(BIN_DIR ) /content/shell/conshell.exe : $(WIN32OBJS ) \
667+ $(SRC_DIR)/user32/conshell/conshell.ld
668+ $(GCC) -m32 -mconsole $(CFLAGS_C) -o $@ $(WIN32OBJS)
669+
670+ conshell : $(BIN_DIR ) /content/shell/conshell.exe
671+ strip $(BIN_DIR ) /content/shell/conshell.exe
672+ objcopy --remove-section .eh_frame \
673+ --remove-section .eh_frame_hdr \
674+ --remove-section .gcc_except_table \
675+ $(BIN_DIR)/content/shell/conshell.exe \
676+ $(BIN_DIR)/content/shell/conshell.exe
677+ # -----------------------------------------------------------------------------
678+ $(BIN_DIR ) /content/shell/conshell.exe : $(AMI32OBJS ) \
679+ $(SRC_DIR)/user32/conshell/amishell.ld
680+ $(GCC) -m32 -mconsole $(CFLAGS_C) -o $@ $(AMI32OBJS)
681+
682+ amishell : $(BIN_DIR ) /content/shell/amishell.exe
683+ strip $(BIN_DIR ) /content/shell/amishell.exe
684+ objcopy --remove-section .eh_frame \
685+ --remove-section .eh_frame_hdr \
686+ --remove-section .gcc_except_table \
687+ $(BIN_DIR)/content/shell/amishell.exe \
688+ $(BIN_DIR)/content/shell/amishell.exe
689+ # -----------------------------------------------------------------------------
618690$(BIN_DIR ) /bootcd.iso : \
619691 $(BIN_DIR)/content/boot1.bin $(BIN_DIR)/content/boot2.bin \
620692 $(OBJ_DIR)/coff/int86_blob.o \
@@ -645,6 +717,7 @@ $(HEX_DIR)/unifont.hex: \
645717clean :
646718 $(RM ) -rf $(BUI_DIR ) /bin
647719 $(MKDIR ) -p $(BUI_DIR ) /bin/content
720+ $(MKDIR ) -p $(BUI_DIR ) /bin/content/shell
648721 $(MKDIR ) -p $(BUI_DIR ) /{obj/coff,obj/elf,obj/inc}
649722
650723# -----------------------------------------------------------------------------
0 commit comments