diff --git a/examples/make.py b/examples/make.py index b7efdc620d00d7d68accc8473db228d315e0fc89..a5dd5efc28901f165836dd7871b1ed347e9a563e 100644 --- a/examples/make.py +++ b/examples/make.py @@ -1,15 +1,15 @@ import os, glob, subprocess script_path = os.path.dirname(os.path.realpath(__file__)); for c_file in glob.glob(script_path + "/*/*.c", recursive=False): - print("compiling", c_file) - args = [ - "gcc", - "-L", - "../target/release", - "-lreowolf_rs", - "-Wl,-R../target/release", - c_file, - "-o", - c_file[:-2] - ]; - subprocess.run(args); \ No newline at end of file + print("compiling", c_file) + args = [ + "gcc", # compiler + "-L", # lib path flag + "./", # where to look for libs + "-lreowolf_rs", # add lib called "reowolf_rs" + "-Wl,-R./", # pass -R flag to linker: produce relocatable object + c_file, # input source file + "-o", # output flag + c_file[:-2] # output filename + ]; + subprocess.run(args);