docstr: Write the build scripts (Makefile, build_lib.sh)
  
  Args:
      model (ModelGraph): the hls4ml model.
docstr_tok: ["Write","the","build","scripts","(","Makefile",",","build_lib.sh",")","Args",":","model","(","ModelGraph",")",":","the","hls4ml","model","."]
code: def write_build_script(self, model):
      """Write the build scripts (Makefile, build_lib.sh)
  
      Args:
          model (ModelGraph): the hls4ml model.
      """
  
      # Makefile
      filedir = os.path.dirname(os.path.abspath(__file__))
      f = open(os.path.join(filedir, "../templates/quartus/Makefile"))
      fout = open(f"{model.config.get_output_dir()}/Makefile", "w")
  
      for line in f.readlines():
          line = line.replace(
              "myproject", model.config.get_project_name()
          )
  
          if "DEVICE   :=" in line:
              line = "DEVICE   := {}\n".format(
                  model.config.get_config_value("Part")
              )
  
          fout.write(line)
      f.close()
      fout.close()
  
      # build_lib.sh
      f = open(
          os.path.join(filedir, "../templates/quartus/build_lib.sh")
      )
      fout = open(f"{model.config.get_output_dir()}/build_lib.sh", "w")
  
      for line in f.readlines():
          line = line.replace(
              "myproject", model.config.get_project_name()
          )
          line = line.replace(
              "mystamp", model.config.get_config_value("Stamp")
          )
  
          fout.write(line)
      f.close()
      fout.close()
  
imports: import glob
  import os
  import tarfile
  from collections import OrderedDict
  from shutil import copyfile, copytree, rmtree
  import numpy
  import yaml
  from hls4ml.backends import get_backend
  from hls4ml.model.layers import Conv1D, Conv2D, Conv2DBatchnorm, Dense
  from hls4ml.utils.fixed_point_utils import FixedPointEmulator, ceil_log2, uint_to_binary
  from hls4ml.writer.writers import Writer
label_desc: Use image node_id 15 for calling the QuartusWriter obj's underlying member method code with example usage: obj.write_build_script(model) without return types