|
32 | 32 | handy way to define multi-line variables in makefiles, for use with custom |
33 | 33 | headers. Remember to export the variable to the environment. |
34 | 34 | """ |
| 35 | + |
35 | 36 | import argparse |
36 | 37 | import os |
37 | 38 | import sys |
38 | 39 |
|
39 | 40 | import kconfiglib |
40 | 41 |
|
41 | | - |
42 | 42 | DEFAULT_SYNC_DEPS_PATH = "deps/" |
43 | 43 |
|
44 | 44 |
|
@@ -79,9 +79,7 @@ def main(): |
79 | 79 | Enable generation of symbol dependency information for incremental builds, |
80 | 80 | optionally specifying the output directory (default: {}). See the docstring of |
81 | 81 | Kconfig.sync_deps() in Kconfiglib for more information. |
82 | | -""".format( |
83 | | - DEFAULT_SYNC_DEPS_PATH |
84 | | - ), |
| 82 | +""".format(DEFAULT_SYNC_DEPS_PATH), |
85 | 83 | ) |
86 | 84 |
|
87 | 85 | parser.add_argument( |
@@ -119,17 +117,16 @@ def main(): |
119 | 117 | kconf = kconfiglib.Kconfig(args.kconfig, suppress_traceback=True) |
120 | 118 | kconf.load_config() |
121 | 119 |
|
122 | | - if args.header_path is None: |
123 | | - if "KCONFIG_AUTOHEADER" in os.environ: |
124 | | - kconf.write_autoconf() |
125 | | - else: |
126 | | - # Kconfiglib defaults to include/generated/autoconf.h to be |
127 | | - # compatible with the C tools. 'config.h' is used here instead for |
128 | | - # backwards compatibility. It's probably a saner default for tools |
129 | | - # as well. |
130 | | - kconf.write_autoconf("config.h") |
131 | | - else: |
| 120 | + if args.header_path is not None: |
132 | 121 | kconf.write_autoconf(args.header_path) |
| 122 | + elif "KCONFIG_AUTOHEADER" in os.environ: |
| 123 | + kconf.write_autoconf() |
| 124 | + else: |
| 125 | + # Kconfiglib defaults to include/generated/autoconf.h to be |
| 126 | + # compatible with the C tools. 'config.h' is used here instead for |
| 127 | + # backwards compatibility. It's probably a saner default for tools |
| 128 | + # as well. |
| 129 | + kconf.write_autoconf("config.h") |
133 | 130 |
|
134 | 131 | if args.config_out is not None: |
135 | 132 | kconf.write_config(args.config_out, save_old=False) |
|
0 commit comments