mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-09 06:02:28 +00:00
Get Python compiler working
It turns out we needed a file length field.
This commit is contained in:
parent
38aece42ba
commit
cabb0a7ede
6 changed files with 6370 additions and 41 deletions
20
third_party/python/makegen.py
vendored
20
third_party/python/makegen.py
vendored
|
@ -605,6 +605,8 @@ ARTIFACTS = set()
|
|||
|
||||
def MakeDirs(d):
|
||||
if d + "/" not in ARTIFACTS:
|
||||
if os.path.basename(d) != '__pycache__':
|
||||
return
|
||||
ARTIFACTS.add(d + "/")
|
||||
if d == "third_party/python/Lib":
|
||||
print()
|
||||
|
@ -643,24 +645,10 @@ for f in SAUCES:
|
|||
"\t\to/$(MODE)/%s\n"
|
||||
"\t@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<") % (c, c))
|
||||
ARTIFACTS.add(c)
|
||||
elif os.path.isfile(f):
|
||||
d = os.path.dirname(f)
|
||||
MakeDirs(d)
|
||||
b = os.path.basename(f)
|
||||
c = "%s/%s" % (d, b)
|
||||
print()
|
||||
print(("o/$(MODE)/%s:\t\\\n"
|
||||
"\t\t%s\t\\\n"
|
||||
"\t\to/$(MODE)/%s/\n"
|
||||
"\t@cp -f $< $@") % (c, f, d))
|
||||
print(("o/$(MODE)/%s.zip.o:\t\\\n"
|
||||
"\t\to/$(MODE)/%s\n"
|
||||
"\t@$(COMPILE) -AZIPOBJ $(ZIPOBJ) $(ZIPOBJ_FLAGS) $(OUTPUT_OPTION) $<") % (c, c))
|
||||
ARTIFACTS.add(c)
|
||||
else:
|
||||
elif os.path.basename(f) == '__pycache__':
|
||||
MakeDirs(f)
|
||||
ARTIFACTS.add(f + "/")
|
||||
|
||||
print()
|
||||
print("THIRD_PARTY_PYTHON_STDLIB_PY_OBJS =\t\\")
|
||||
print("THIRD_PARTY_PYTHON_STDLIB_PYC_OBJS =\t\\")
|
||||
print("\t" + "\t\\\n\t".join(sorted("o/$(MODE)/%s.zip.o" % (x) for x in ARTIFACTS)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue