Skip to content

Commit

Permalink
now proper #include file names
Browse files Browse the repository at this point in the history
  • Loading branch information
gonsie committed Aug 7, 2013
1 parent 161eec6 commit 82d722d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions file_writer.py
Expand Up @@ -7,7 +7,7 @@
def write_gate_h(filename_prefix, types_list):
f = open(filename_prefix+"_types.h", "w")
f.write(header+"\n")
filename = filename_prefix.split("/")[-1].split(".")[0]
filename = filename_prefix.split("/")[-1]
f.write("#ifndef _"+filename+"_types_h\n")
f.write("#define _"+filename+"_types_h\n\n")
# total gate count def
Expand All @@ -23,7 +23,8 @@ def write_gate_c(filename_prefix, types_list, gate_types):
f.write(header+"\n")
f.write("#include <stdio.h>\n")
f.write("#include \"gates_model.h\"\n")
f.write("#include \""+filename_prefix+"_types.h\"\n\n")
filename = filename_prefix.split("/")[-1]
f.write("#include \""+filename+"_types.h\"\n\n")
# gate functions
for k in types_list:
f.write(gate_types[k].generateC() + "\n")
Expand All @@ -38,7 +39,8 @@ def write_lookup_c(filename_prefix, types_list, gate_types):
f = open(filename_prefix+"_lookups.c", "w")
f.write(header+"\n")
f.write("#include \"gates_model.h\"\n")
f.write("#inclue \"" + filename_prefix + "_types.h\"\n")
filename = filename_prefix.split("/")[-1]
f.write("#include \"" + filename + "_types.h\"\n")
# input size
f.write("\nint gate_input_size[GATE_TYPE_COUNT] = {\n\t")
for t in types_list:
Expand Down

0 comments on commit 82d722d

Please sign in to comment.