aboutsummaryrefslogtreecommitdiff
path: root/tools/mkdeps.py
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-01-18 18:57:37 +0000
committerJuan J. Martinez <jjm@usebox.net>2021-01-18 18:59:02 +0000
commit1e15e1c7586d34bbe75efbcd235084553abdef56 (patch)
tree9484ec002101b3e3e635c41c6ea7b472a58a0de2 /tools/mkdeps.py
parent5a9c8f20cb385cdbb4e169e608514ff7a7b2cd6d (diff)
downloadubox-msx-lib-1e15e1c7586d34bbe75efbcd235084553abdef56.tar.gz
ubox-msx-lib-1e15e1c7586d34bbe75efbcd235084553abdef56.zip
Fixes for windows compatibility.
Although it is running on windows, we need a POSIX layer, so we'll use forward slashes. Also clean the lines.
Diffstat (limited to 'tools/mkdeps.py')
-rwxr-xr-xtools/mkdeps.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/mkdeps.py b/tools/mkdeps.py
index e0b2a10..05bac9b 100755
--- a/tools/mkdeps.py
+++ b/tools/mkdeps.py
@@ -35,7 +35,7 @@ def main():
args = parser.parse_args()
fix_path = args.dir if args.build is None else args.build
- fix_path = r"%s\1" % (fix_path.rstrip(os.sep) + os.sep)
+ fix_path = r"%s\1" % (fix_path.strip("/") + "/").replace("\\", "\\\\")
inc = ["-I%s" % d for d in args.include.split(":")]
cmd = ["sdcc", "-MM"] + inc
result = []
@@ -47,7 +47,8 @@ def main():
if out.returncode:
sys.exit("Error: %s" % out.stderr)
- result.append(re.sub(FIX_RE, fix_path, out.stdout.decode('utf-8')))
+ out = out.stdout.decode('utf-8').strip()
+ result.append(re.sub(FIX_RE, fix_path, out))
try:
old = open(args.deps, "rt").read()
@@ -56,7 +57,7 @@ def main():
print("%r not found, will generate" % args.deps)
old = None
- new = ''.join(result)
+ new = '\n'.join(result)
if new != old:
with open(args.deps, "wt") as fd: