forked from OpenXiangShan/NEMU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
54 lines (40 loc) · 1.41 KB
/
config.mk
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
50
51
52
53
54
COLOR_RED := $(shell echo "\033[1;31m")
COLOR_END := $(shell echo "\033[0m")
ifeq ($(wildcard .config),)
$(warning $(COLOR_RED)Warning: .config does not exists!$(COLOR_END))
$(warning $(COLOR_RED)To build the porject, first run 'make menuconfig'.$(COLOR_END))
endif
Q := @
KCONFIG_PATH := $(NEMU_HOME)/tools/kconfig
FIXDEP_PATH := $(NEMU_HOME)/tools/fixdep
Kconfig := $(NEMU_HOME)/Kconfig
rm-distclean += include/generated include/config .config .config.old
silent := -s
CONF := $(KCONFIG_PATH)/build/conf
MCONF := $(KCONFIG_PATH)/build/mconf
FIXDEP := $(FIXDEP_PATH)/build/fixdep
$(CONF):
$(Q)$(MAKE) $(silent) -C $(KCONFIG_PATH) NAME=conf
$(MCONF):
$(Q)$(MAKE) $(silent) -C $(KCONFIG_PATH) NAME=mconf
$(FIXDEP):
$(Q)$(MAKE) $(silent) -C $(FIXDEP_PATH)
menuconfig: $(MCONF) $(CONF) $(FIXDEP)
$(Q)$(MCONF) $(Kconfig)
$(Q)$(CONF) $(silent) --syncconfig $(Kconfig)
savedefconfig: $(CONF)
$(Q)$< $(silent) --$@=configs/defconfig $(Kconfig)
%defconfig: $(CONF)
$(Q)$< $(silent) --defconfig=configs/$@ $(Kconfig)
.PHONY: menuconfig savedefconfig defconfig
# Help text used by make help
help:
@echo ' menuconfig - Update current config utilising a menu based program'
@echo ' savedefconfig - Save current config as configs/defconfig (minimal config)'
distclean: clean
-@rm -rf $(rm-distclean)
.PHONY: help distclean
define call_fixdep
@$(FIXDEP) $(1) $(2) unused > $(1).tmp
@mv $(1).tmp $(1)
endef