Update Makefile & transform-dep.py

Former-commit-id: 38acae22fe
This commit is contained in:
Luke Street 2022-09-11 21:07:45 -04:00
parent 6b306c1121
commit c6823f56cd
2 changed files with 15 additions and 3 deletions

View File

@ -76,6 +76,7 @@ ifeq ($(WINDOWS),1)
AS := $(DEVKITPPC)/bin/powerpc-eabi-as.exe AS := $(DEVKITPPC)/bin/powerpc-eabi-as.exe
CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp.exe -P CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp.exe -P
PYTHON := py PYTHON := py
SHA1SUM := sha1sum
else else
WIBO := $(shell command -v wibo 2> /dev/null) WIBO := $(shell command -v wibo 2> /dev/null)
ifdef WIBO ifdef WIBO
@ -88,11 +89,11 @@ else
AS := $(DEVKITPPC)/bin/powerpc-eabi-as AS := $(DEVKITPPC)/bin/powerpc-eabi-as
CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp -P CPP := $(DEVKITPPC)/bin/powerpc-eabi-cpp -P
PYTHON := python3 PYTHON := python3
SHA1SUM := shasum -a 1
endif endif
CC = $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe CC = $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe
LD := $(WINE) tools/mwcc_compiler/$(MWLD_VERSION)/mwldeppc.exe LD := $(WINE) tools/mwcc_compiler/$(MWLD_VERSION)/mwldeppc.exe
ELF2DOL := tools/elf2dol ELF2DOL := tools/elf2dol
SHA1SUM := shasum -a 1
TRANSFORM_DEP := tools/transform-dep.py TRANSFORM_DEP := tools/transform-dep.py
FRANK := tools/franklite.py FRANK := tools/franklite.py

View File

@ -1,12 +1,16 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import os import os
from platform import uname
wineprefix = os.path.join(os.environ['HOME'], '.wine') wineprefix = os.path.join(os.environ['HOME'], '.wine')
if 'WINEPREFIX' in os.environ: if 'WINEPREFIX' in os.environ:
wineprefix = os.environ['WINEPREFIX'] wineprefix = os.environ['WINEPREFIX']
winedevices = os.path.join(wineprefix, 'dosdevices') winedevices = os.path.join(wineprefix, 'dosdevices')
def in_wsl() -> bool:
return 'microsoft-standard' in uname().release
def import_d_file(in_file) -> str: def import_d_file(in_file) -> str:
out_text = '' out_text = ''
@ -26,6 +30,13 @@ def import_d_file(in_file) -> str:
path = line.strip() path = line.strip()
# lowercase drive letter # lowercase drive letter
path = path[0].lower() + path[1:] path = path[0].lower() + path[1:]
if path[0] == 'z':
# shortcut for z:
path = path[2:].replace('\\', '/')
elif in_wsl():
path = path[0:1] + path[2:]
path = os.path.join('/mnt', path.replace('\\', '/'))
else:
# use $WINEPREFIX/dosdevices to resolve path # use $WINEPREFIX/dosdevices to resolve path
path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/'))) path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/')))
out_text += "\t" + path + suffix + "\n" out_text += "\t" + path + suffix + "\n"