1
0

bytebeat_compiler.py: use name CFLAGS instead of CC_FLAGS

This commit is contained in:
Intel A80486DX2-66 2023-12-24 20:05:48 +03:00
parent 43b065c0fa
commit e0a9e7f7ef
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -23,7 +23,7 @@ PATHS["output"] = path_join(PATHS["build_dir"], PATHS["output"])
# Default parameters # Default parameters
DEFAULT_PARAMETERS = { DEFAULT_PARAMETERS = {
"CC": "gcc", "CC": "gcc",
"CC_FLAGS": "-Ofast -Wall -Wextra -Wpedantic -Wno-unused-variable -Wno-unused-but-set-variable", "CFLAGS": "-Ofast -Wall -Wextra -Wpedantic -Wno-unused-variable -Wno-unused-but-set-variable",
"INPUT_FILE": PATHS["substitute"], "INPUT_FILE": PATHS["substitute"],
"OUTPUT_FILE": PATHS["output"] "OUTPUT_FILE": PATHS["output"]
} }
@ -55,7 +55,7 @@ def substitute_vars(replacements: dict, text: str) -> str:
return text return text
CC = fetch("CC") CC = fetch("CC")
CC_FLAGS = fetch("CC_FLAGS") CFLAGS = fetch("CC_FLAGS")
INPUT_FILE = fetch("INPUT_FILE") INPUT_FILE = fetch("INPUT_FILE")
OUTPUT_FILE = fetch("OUTPUT_FILE") OUTPUT_FILE = fetch("OUTPUT_FILE")
@ -63,7 +63,7 @@ if __name__ == "__main__":
parser = ArgumentParser(description=\ parser = ArgumentParser(description=\
"Substitutes supplied C (non-JavaScript!) bytebeat into the template, " "Substitutes supplied C (non-JavaScript!) bytebeat into the template, "
"then attempts to compile the instance of the template. Uses " "then attempts to compile the instance of the template. Uses "
"environmental variables `CC`, `CC_FLAGS`, `INPUT_FILE`, " "environmental variables `CC`, `CFLAGS`, `INPUT_FILE`, "
"`OUTPUT_FILE`.") "`OUTPUT_FILE`.")
parser.add_argument("file", type=str, parser.add_argument("file", type=str,
help="bytebeat formula file (use `-` to read from stdin)") help="bytebeat formula file (use `-` to read from stdin)")
@ -156,4 +156,4 @@ if __name__ == "__main__":
print("Compiling") print("Compiling")
# Let the system execute aliases by calling os.system # Let the system execute aliases by calling os.system
system(" ".join([CC, CC_FLAGS, INPUT_FILE, "-o", OUTPUT_FILE])) system(" ".join([CC, CFLAGS, INPUT_FILE, "-o", OUTPUT_FILE]))