~ruther/avr-device

ref: 1e0eb40c3a8d82c6a3452a21e3cb3c6e56ce346f avr-device/patch/makedeps.py -rw-r--r-- 830 bytes
1e0eb40c — Andrew Dona-Couch Add support for ATmega2560 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
makedeps.py
Copyright 2017 Adam Greig
Licensed under the MIT and Apache 2.0 licenses.

Generate make dependency file for each device.
"""

import yaml
import os.path
import argparse
import svdpatch


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("devices", nargs="*")
    args = parser.parse_args()
    for dpath in args.devices:
        with open(dpath) as f:
            device = yaml.safe_load(f)
        device["_path"] = dpath
        deps = svdpatch.yaml_includes(device)
        depname = ".deps/{}.d".format(
            os.path.splitext(os.path.basename(dpath))[0])
        svdname = "svd/{}.patched.svd".format(
            os.path.splitext(os.path.basename(dpath))[0])
        print("{} {} {}: {}".format(dpath, svdname, depname, " ".join(deps)))

if __name__ == "__main__":
    main()
Do not follow this link