kernels: support NEMU over AM
This commit is contained in:
parent
56c864d5ef
commit
6052ab0244
1 changed files with 29 additions and 0 deletions
29
kernels/nemu/Makefile
Normal file
29
kernels/nemu/Makefile
Normal file
|
@ -0,0 +1,29 @@
|
|||
ARCH_SPLIT = $(subst -, ,$(ARCH))
|
||||
ISA = $(word 1,$(ARCH_SPLIT))
|
||||
PLATFORM = $(word 2,$(ARCH_SPLIT))
|
||||
|
||||
ifneq ($(PLATFORM), nemu)
|
||||
$(error Only support with NEMU)
|
||||
endif
|
||||
|
||||
TMPDEFCONFIG = tmp_defconfig
|
||||
|
||||
all:
|
||||
$(MAKE) save_config
|
||||
$(MAKE) build_am
|
||||
$(MAKE) restore_config
|
||||
$(MAKE) -C $(NEMU_HOME) run IMG=$(NEMU_HOME)/build/$(ISA)-nemu-interpreter-$(ARCH).bin
|
||||
|
||||
save_config:
|
||||
$(MAKE) -C $(NEMU_HOME) savedefconfig
|
||||
mv $(NEMU_HOME)/configs/defconfig $(NEMU_HOME)/configs/$(TMPDEFCONFIG)
|
||||
|
||||
build_am:
|
||||
$(MAKE) -C $(NEMU_HOME) $(ISA)-am_defconfig
|
||||
$(MAKE) -C $(NEMU_HOME) ARCH=$(ARCH) mainargs=$(mainargs)
|
||||
|
||||
restore_config:
|
||||
$(MAKE) -C $(NEMU_HOME) ARCH=$(ARCH) $(TMPDEFCONFIG)
|
||||
rm $(NEMU_HOME)/configs/$(TMPDEFCONFIG)
|
||||
|
||||
.PHONY: all save_config build_am restore_config
|
Loading…
Reference in a new issue