diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index a42670c..1235522 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -15,14 +15,14 @@ PATHS = { "substitute": "substituted.c", "output": "render_bytebeat", "fwrite_le_header": "fwrite_le.h", - "fwrite_le": "fwrite_le.c" + "fwrite_le": "fwrite_le.c", + "include_directory": "include" } # Solve paths PATHS["template"] = path_join(PATHS["src_dir"], PATHS["template"]) PATHS["substitute"] = path_join(PATHS["build_dir"], PATHS["substitute"]) PATHS["output"] = path_join(PATHS["build_dir"], PATHS["output"]) -PATHS["fwrite_le_header"] = PATHS["src_dir"] + "/" + PATHS["fwrite_le_header"] PATHS["fwrite_le"] = path_join(PATHS["src_dir"], PATHS["fwrite_le"]) # Add `.` directory before all paths for compilation @@ -30,6 +30,7 @@ PATHS["template"] = path_join(".", PATHS["template"]) PATHS["substitute"] = path_join(".", PATHS["substitute"]) PATHS["output"] = path_join(".", PATHS["output"]) PATHS["fwrite_le"] = path_join(".", PATHS["fwrite_le"]) +PATHS["include_directory"] = path_join(".", PATHS["include_directory"]) # Default parameters DEFAULT_PARAMETERS = { @@ -223,7 +224,7 @@ if __name__ == "__main__": "block_size": args.block_size, "silent_mode": args.silent, "verbose_mode": args.verbose and not args.silent, - "fwrite_le": "../" + PATHS["fwrite_le_header"] + "fwrite_le": PATHS["fwrite_le_header"] }, read_file(PATHS["template"]), args.show_substituted_values)) # Compile by invoking the shell script @@ -231,6 +232,6 @@ if __name__ == "__main__": # Let the system execute aliases by calling os.system command = " ".join([CC, CFLAGS, INPUT_FILE, PATHS["fwrite_le"], "-o", - OUTPUT_FILE]) + OUTPUT_FILE, "-I" + PATHS["include_directory"]]) print(command, flush=True) exit(system(command)) diff --git a/src/fwrite_le.h b/include/fwrite_le.h similarity index 100% rename from src/fwrite_le.h rename to include/fwrite_le.h