#!/usr/bin/env ruby
# SPDX-License-Identifier: MIT

# This script generates config.h C header file from .config

puts %Q{// This file is automatically generated by #{__FILE__}
// Please do not modify it

#pragma once

#include <stdbool.h>
#include "kconfig.h"

}

while l = STDIN.gets
  if l =~ /^(CONFIG_\w+)=(.*)/
    value = $2
    value = "true" if value == "y"

    puts "#define #{$1} #{value}"
  end
end
