-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile.config
More file actions
49 lines (44 loc) · 1.68 KB
/
Makefile.config
File metadata and controls
49 lines (44 loc) · 1.68 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include Makefile.common
.PHONY : check-python
check-python :
$(PYTHON) -c 'import sys; e = 1 if sys.version_info < (3, 0) \
else 0; print("Need Python 3 or later to generate $(CONFIG)") \
if e == 1 else None; exit(e)'
.PHONY : check-empty-config
check-empty-config :
if ! grep . $(CONFIG) > /dev/null 2> /dev/null; then \
echo "Unexpected empty $(CONFIG)" \
"run 'make config' to generate it properly"; \
false; \
fi
.PHONY : check-old-config
check-old-config :
if grep '=[01]' $(CONFIG) > /dev/null 2> /dev/null; then \
echo "Old style $(CONFIG) found, please back up it," \
"run 'make config', and reconfigure for new format"; \
false; \
fi
.PHONY : menuconfig
menuconfig :
$(MAKE) $(V-makeopt-$(V)) -f Makefile.config check-python V=$(V)
$(MAKE) $(V-makeopt-$(V)) -f Makefile.config check-old-config V=$(V)
CC=$(CC) $(PYTHON) scripts/kconfig/menuconfig.py
CC=$(CC) $(PYTHON) scripts/kconfig/kconfig.py Kconfig /dev/null \
/dev/null /dev/null .config # Show warnings if necessary
.PHONY : default-config
default-config :
$(MAKE) $(V-makeopt-$(V)) -f Makefile.config check-python V=$(V)
$(MAKE) $(V-makeopt-$(V)) -f Makefile.config check-old-config V=$(V)
: >> $(CONFIG)
if ! CC=$(CC) $(PYTHON) scripts/kconfig/kconfig.py Kconfig .config \
/dev/null /dev/null .config; then \
echo "scripts/kconfig/kconfig.py fails"; \
if ! grep . $(CONFIG) > /dev/null 2> /dev/null; then \
echo "Removing empty $(CONFIG)"; $(RM) $(CONFIG); \
fi; \
false; \
fi # Remove empty $(CONFIG) in case of failure
# Update the modification time of $(CONFIG) to avoid running
# default-config every time Makefile is used. If $(TOUCH)
# is not available, it is okay.
-$(TOUCH) $(CONFIG)