{
    "version": "0.1.0",
    "name": "{{ projectName }}",
    "artefact": {
        "type": "executable",
        "outputPrefix": "",
        "outputSuffix": "",
        "extension": "elf"
    },
    "generator": "make",
    "commands": {
        "build": [
            "make"
        ]
    },
    "addSourceFolders": [
        "src"
    ],
    "addIncludeFolders": [
        "include"
    ],
    "targets": {
        "{{ boardName }}": {
            "addSymbols": [
                "{{ deviceMacro }}",
                "{{ boardMacro }}"
            ],
            "toolchains": {
                "riscv-none-gcc": {
                    "common": {
                        "addTarget": [
                            "-march={{ march }}",
                            "-mabi={{ mabi }}",
                            "-mcmodel=medany", 
                            "-msmall-data-limit=8"
                        ],
                        "addDebugging": [
                            "-g3"
                        ],
                        "addOptimizations": [
                            "-fmessage-length=0",
                            "-fsigned-char",
                            "-ffunction-sections",
                            "-fdata-sections"
                        ],
                        "addWarnings": [
{% if useSomeWarnings -%}
                            "-Wall"
                            ,"-Wextra"
{% if useWerror -%}
                            ,"-Werror"
{% endif -%}
{% if useMostWarnings -%}
                            ,"-Wunused"
                            ,"-Wuninitialized"
                            ,"-Wmissing-declarations"
                            ,"-Wconversion"
                            ,"-Wpointer-arith"
                            ,"-Wpadded"
                            ,"-Wshadow"
                            ,"-Wlogical-op"
                            ,"-Waggregate-return"
                            ,"-Wfloat-equal"
{% endif -%}
{% endif -%}
                        ],
                        "addMiscellaneous": [
                        ]
                    },
                    "tools": {
                        "c": {
                            "addOptimizations": [
                                "-std=gnu11"
                            ],
                            "addWarnings": [
{% if useSomeWarnings and useMostWarnings -%}
                                "-Wmissing-prototypes",
                                "-Wstrict-prototypes",
                                "-Wbad-function-cast"
{% endif -%}
                            ]
                        },
                        "cpp": {
                            "addOptimizations": [
                                "-std=gnu++14",
                                "-fabi-version=0",
                                "-fno-exceptions",
                                "-fno-rtti",
                                "-fno-use-cxa-atexit",
                                "-fno-threadsafe-statics"
                            ],
                            "addWarnings": [
{% if useSomeWarnings and useMostWarnings -%}
                                "-Wabi",
                                "-Wctor-dtor-privacy",
                                "-Wnoexcept",
                                "-Wnon-virtual-dtor",
                                "-Wstrict-null-sentinel",
                                "-Wsign-promo",
				"-Werror"
{% endif -%}
                            ]
                        },
                        "as": {
                            "addMiscellaneous": [
                                "-x assembler-with-cpp"
                            ]
                        },
                        "ld": {
                            "addMiscellaneous": [
                                "-nostartfiles"
                                ,"-Xlinker --gc-sections"
{% if useNano -%}
                                ,"--specs=nano.specs"
{% endif -%}
                                ,"-L\"../../ldscripts\""
                                ,"-T"
                                ,"mem.ld"
                                ,"-T"
                                ,"libs.ld"
                                ,"-T"
                                ,"sections.ld"
                            ]
                        }
                    },
                    "profiles": {
                        "debug": {
                            "addSymbols": [
                                "DEBUG"
				,"OS_USE_CPP_INTERRUPTS"
                               ,"OS_USE_TRACE_UART0"
                            ],
                            "addOptimizations": [
{% if useOg -%}
                                "-Og"
{% else -%}
                                "-O0"
{% endif -%}
                            ]
                        },
                        "release": {
                            "addSymbols": [
                                "NDEBUG"
				,"OS_USE_CPP_INTERRUPTS"
                            ],
                            "addOptimizations": [
                                "-Os"
                            ]
                        }
                    }
                }
            }
        }
    }
}
