Skip to content

Commit

Permalink
Make Nintendont compilable with WSL
Browse files Browse the repository at this point in the history
Also will make bin2h compiled automatically depending on the OS
  • Loading branch information
UltiNaruto committed May 6, 2021
1 parent eae8129 commit e054c31
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>dev
endif

SUBPROJECTS := multidol kernel/asm resetstub \
fatfs/libfat-arm.a fatfs/libfat-ppc.a \
codehandler kernel kernelboot \
loader/source/ppc/PADReadGC loader/source/ppc/IOSInterface loader
kernel/bin2h fatfs/libfat-arm.a \
fatfs/libfat-ppc.a codehandler \
kernel kernelboot loader/source/ppc/PADReadGC \
loader/source/ppc/IOSInterface loader
.PHONY: all forced clean $(SUBPROJECTS)

all: loader
Expand Down Expand Up @@ -55,6 +56,12 @@ codehandler:
@echo "Building Nintendont code handler"
@echo " "
$(MAKE) -C codehandler

kernel/bin2h:
@echo " "
@echo "Building Binary to Assembly Converter"
@echo " "
$(MAKE) -C kernel/bin2h

kernel: kernel/asm fatfs/libfat-arm.a codehandler
@echo " "
Expand All @@ -80,7 +87,7 @@ kernelboot:
@echo " "
$(MAKE) -C kernelboot

loader: multidol resetstub fatfs/libfat-ppc.a kernel kernelboot loader/source/ppc/PADReadGC loader/source/ppc/IOSInterface
loader: multidol resetstub kernel/bin2h fatfs/libfat-ppc.a kernel kernelboot loader/source/ppc/PADReadGC loader/source/ppc/IOSInterface
@echo " "
@echo "Building Nintendont loader"
@echo " "
Expand All @@ -93,6 +100,7 @@ clean:
$(MAKE) -C multidol clean
$(MAKE) -C kernel/asm clean
$(MAKE) -C resetstub clean
$(MAKE) -C kernel/bin2h clean
$(MAKE) -C fatfs -f Makefile.arm clean
$(MAKE) -C fatfs -f Makefile.ppc clean
$(MAKE) -C codehandler clean
Expand Down
29 changes: 29 additions & 0 deletions kernel/bin2h/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Target :=
ifeq ($(OS),Windows_NT)
Target := bin2h.exe
else
ifeq ($(shell grep Microsoft /proc/version), $(shell cat /proc/version))
Target := bin2h_wsl
else
Target := bin2h
endif
endif

.PHONY: all forced clean bin2h bin2h_wsl bin2h.exe

all: $(Target)
forced: clean all

bin2h:
@bash make.sh

bin2h_wsl:
@./make.cmd
@mv bin2h.exe bin2h

bin2h.exe:
@make.cmd

clean:
@rm -fr bin2h
@rm -fr bin2h.exe
Binary file removed kernel/bin2h/bin2h
Binary file not shown.
Binary file removed kernel/bin2h/bin2h.exe
Binary file not shown.
3 changes: 1 addition & 2 deletions kernel/bin2h/make.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gcc main.c -s -Os -static -o bin2h.exe
pause
gcc main.c -s -Os -static -o bin2h.exe
Binary file removed loader/loader.dol
Binary file not shown.

0 comments on commit e054c31

Please sign in to comment.