mirror of https://github.com/PrimeDecomp/prime.git
Update Makefile & transform-dep.py
This commit is contained in:
parent
228319e2a5
commit
38acae22fe
3
Makefile
3
Makefile
|
@ -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
|
||||||
|
|
|
@ -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,8 +30,15 @@ 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:]
|
||||||
# use $WINEPREFIX/dosdevices to resolve path
|
if path[0] == 'z':
|
||||||
path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/')))
|
# 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
|
||||||
|
path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/')))
|
||||||
out_text += "\t" + path + suffix + "\n"
|
out_text += "\t" + path + suffix + "\n"
|
||||||
|
|
||||||
return out_text
|
return out_text
|
||||||
|
|
Loading…
Reference in New Issue