mrmp/architecture.py

33 lines
716 B
Python
Raw Normal View History

2021-10-10 13:22:02 +00:00
import os
import distribution
2021-10-10 14:27:52 +00:00
import subsystem
2021-10-10 13:22:02 +00:00
2021-10-10 13:44:03 +00:00
X86 = 'x86_64'
I86 = 'i686'
2021-10-10 13:22:02 +00:00
class Architecture:
2021-10-10 14:27:52 +00:00
def __init__(self, name, bits, subsystems):
2021-10-10 13:22:02 +00:00
self.name = name
2021-10-10 13:44:03 +00:00
self.bits = bits
2021-10-10 13:22:02 +00:00
self.distribution = distribution.Distribution(self)
2021-10-10 14:27:52 +00:00
self.subsystems = {s: subsystem.SubSystem(self, s) for s in subsystems}
2021-10-10 13:22:02 +00:00
def __str__(self):
lines = [
f'Name: {self.name}',
]
return os.linesep.join(lines)
2021-10-10 13:46:37 +00:00
2021-10-10 14:27:52 +00:00
x86 = Architecture(X86, 64, [subsystem.MAIN,
'clang64', 'mingw64', 'ucrt64'])
i86 = Architecture(I86, 32, [subsystem.MAIN,
'clang32', 'mingw32'])
2021-10-10 13:44:03 +00:00
ARCHITECTURES = {
2021-10-10 14:27:52 +00:00
X86: x86,
I86: i86,
2021-10-10 13:44:03 +00:00
}