Files
hackerlibultra/tools/compile_sjis.py
someone2639 efbd931cbc Set up Makefile for modern building (#1)
* set build options

* remove COMPARE and MDOERN_* switches

* remove tools makefile

* AR patching is gone too since we want a fullly decomped version

* AR is modern

* remove cwd changes

* edit my own tool to fix compile errors

* compile files generated with my own tool instead of the originals

* inline modern_gcc makefile

* port mips toolchain detection logic

* add util.mk for find-command

* remove forced AR order and strip/mdebug removal commands

* add -mabi=32 to as flags

---------

Co-authored-by: someone2639 <someone2639@gmail.com>
2025-02-17 11:28:31 -05:00

26 lines
605 B
Python
Executable File

#!/usr/bin/env python3
import sys, os
from shiftjis_conv import sjis_process
WORKING_DIR = os.getcwd()
fb = []
input_c_file = [i for i in sys.argv if ".c" in i][0]
CC = [i for i in sys.argv if "-D__CC=" in i][0][7:]
build_dir = [i for i in sys.argv if "-D__BUILD_DIR" in i][0][14:]
output_c_file = f"{build_dir}/{input_c_file}"
# Edit compile command to point to the converted file
sys.argv[sys.argv.index(input_c_file)] = output_c_file
with open(input_c_file) as f:
fb = f.read()
with open(output_c_file, "w+") as outf:
sjis_process(fb, outf)
os.system("%s %s" % (CC, " ".join(sys.argv[1:])))