xref: /optee_os/scripts/kconfig/kconfiglib/alldefconfig.py (revision c689edbb2550c76ae81dcecab717d82a564b2d7b)
1#!/usr/bin/env python3
2
3# Copyright (c) 2018-2019, Ulf Magnusson
4# SPDX-License-Identifier: ISC
5
6"""
7Writes a configuration file where all symbols are set to their their default
8values.
9
10The default output filename is '.config'. A different filename can be passed in
11the KCONFIG_CONFIG environment variable.
12
13Usage for the Linux kernel:
14
15  $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/alldefconfig.py
16"""
17import kconfiglib
18
19
20def main():
21    kconf = kconfiglib.standard_kconfig(__doc__)
22    kconf.load_allconfig("alldef.config")
23    print(kconf.write_config())
24
25
26if __name__ == "__main__":
27    main()
28