Update compiler script.

It all works now.
\o/
This commit is contained in:
Curle 2019-07-24 21:50:26 +01:00
parent d2d532c535
commit f9dcdf5cc9

View File

@ -15,22 +15,24 @@ HFILES = "-Iinclude/ -Iinclude/reqs/ -Iinclude/bitfont/"
OBJECTS = ""
with open('c_files.txt') as file:
line = file.readline()
line = file.readline().strip()
while line:
line = line[:-3]
line = line[:-2]
if line == "kernel\interrupts":
print(f'{HFILES}')
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', '-ffreestanding', '-march=skylake', '-mgeneral-regs-only', '-fno-exceptions', '-fno-stack-protector', '-fno-stack-check', '-fno-strict-aliasing', '-fno-merge-all-constants', '-mno-stack-arg-probe', '-m64', '-mno-red-zone', '-maccumulate-outgoing-args', '--std=gnu11', '-Iinclude/', '-Iinclude/reqs', '-Iinclude/bitfont', '-Og', '-g3', '-Wall', '-Wextra', '-Wdouble-promotion', '-Wpedantic', '-fmessage-length=0', '-ffunction-sections', '-c', '-MMD', '-MP', f'-Wa,-adghlmns="{line}.out"', f'-MT"{line}.o"', '-o', f'{line}.o', f'{line}.c'], shell=True)
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', '-ffreestanding', '-march=skylake', '-mgeneral-regs-only', '-fno-exceptions', '-fno-stack-protector', '-fno-stack-check', '-fno-strict-aliasing', '-fno-merge-all-constants', '-mno-stack-arg-probe', '-m64', '-mno-red-zone', '-maccumulate-outgoing-args', '--std=gnu11', '-Iinclude/', '-Iinclude/reqs', '-Iinclude/bitfont', '-Og', '-g3', '-Wall', '-Wextra', '-Wdouble-promotion', '-Wpedantic', '-fmessage-length=0', '-ffunction-sections', '-c', '-MMD', '-MP', f'-Wa,-adghlmns={line}.out', f'-MT{line}.o', '-o', f'{line}.o', f'{line}.c'], shell=True)
else:
print(f'{HFILES}')
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', '-ffreestanding', '-march=skylake', '-mavx2', '-fno-exceptions', '-fno-stack-protector', '-fno-stack-check', '-fno-strict-aliasing', '-fno-merge-all-constants', '-mno-stack-arg-probe', '-m64', '-mno-red-zone', '-maccumulate-outgoing-args', '--std=gnu11', '-Iinclude/', '-Iinclude/reqs', '-Iinclude/bitfont', '-Og', '-g3', '-Wall', '-Wextra', '-Wdouble-promotion', '-Wpedantic', '-fmessage-length=0', '-ffunction-sections', '-c', '-MMD', '-MP', f'-Wa,-adghlmns="{line}.out"', f'-MT"{line}.o"', '-o', f'{line}.o', f'{line}.c'], shell=True)
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', '-ffreestanding', '-march=skylake', '-mavx2', '-fno-exceptions', '-fno-stack-protector', '-fno-stack-check', '-fno-strict-aliasing', '-fno-merge-all-constants', '-mno-stack-arg-probe', '-m64', '-mno-red-zone', '-maccumulate-outgoing-args', '--std=gnu11', '-Iinclude/', '-Iinclude/reqs', '-Iinclude/bitfont', '-Og', '-g3', '-Wall', '-Wextra', '-Wdouble-promotion', '-Wpedantic', '-fmessage-length=0', '-ffunction-sections', '-c', '-MMD', '-MP', f'-Wa,-adghlmns={line}.out', f'-MT{line}.o', '-o', f'{line}.o', f'{line}.c'], shell=True)
OBJECTS = line + ".o "
OBJECTS.replace('\\', '/')
OBJECTS.replace(' ', '')
os.path.normpath(OBJECTS)
with open('objects.list', 'a') as objectsfile:
objectsfile.write(OBJECTS)
ofile = OBJECTS.replace('\\', '/')
objectsfile.write(ofile + "\n")
line = file.readline()
line = file.readline().strip()
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', "-march=skylake", "-mavx2", "-s", "-nostdlib", "-Wl,-e,kernel_main", "-Wl,--dynamicbase,--export-all-symbols", "-Wl,--subsystem,10", "-Wl,-Map=output.map", "-Wl,--gc-sections", "-o \"Sync.exe\"", "@\"objects.list\""])
subprocess.run([f'{GCC_FOLDER}/bin/gcc.exe', "-march=skylake", "-mavx2", "-s", "-nostdlib", "-static-pie", "-Wl,--allow-multiple-definition", "-Wl,-e,kernel_main", "-Wl,--dynamicbase,--export-all-symbols", "-Wl,--subsystem,10", "-Wl,-Map=output.map", "-Wl,--gc-sections", "-o Sync.exe", "@objects.list"])