blob: eafcfdbdc708388a186d1ca96625804814239d05 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001NAME = qemu
2
3all: src patch config build install
4
5NUM_PROCESSORS=`cat /proc/cpuinfo | grep processor | wc -l`
6
7VER=2.11.1
8QEMUDIR=qemu-${VER}
9OUTDIR=bin-qemu-${VER}
10SRCPKG=${QEMUDIR}.tar.xz
11LKQEMUBIN=qemu-system-arm
12LXQEMUBIN=qemu-system-aarch64
13
14LKQEMUARGS="-machine virt -cpu cortex-a15 -m 64"
15LXQEMUARGS="-machine virt -cpu cortex-a53 -m 64"
16
17.PHONY: patch
18
19src:
20 @sh -c "if [ ! -d ${QEMUDIR} ]; then \
21 tar Jxvf ${SRCPKG}; \
22 fi"
23
24patch:
25
26config:
27 @sh -c "if [ -d ${QEMUDIR} ]; then \
28 cd ${QEMUDIR} && ./configure --target-list=arm-softmmu,aarch64-softmmu --disable-gtk --disable-tpm; \
29 fi"
30
31build:
32 @sh -c "if [ -d ${QEMUDIR} ]; then \
33 cd ${QEMUDIR} && molyq make -j${NUM_PROCESSORS}; \
34 fi"
35
36install:
37 @sh -c "if [ -d ${QEMUDIR} ]; then \
38 mkdir -p ${OUTDIR}; \
39 cp ${QEMUDIR}/arm-softmmu/qemu-system-arm ${OUTDIR}/; \
40 cp ${QEMUDIR}/aarch64-softmmu/qemu-system-aarch64 ${OUTDIR}/; \
41 fi"
42
43clean:
44 rm -fr ${QEMUDIR} config-temp config.log
45
46runlk:
47 mosesq `pwd`/${OUTDIR}/${LKQEMUBIN} ${LKQEMUARGS} -kernel ../../out/qemu/lk.bin -nographic
48
49runlinux:
50 mosesq `pwd`/${OUTDIR}/${LXQEMUBIN} ${LXQEMUARGS} -kernel ../../out/qemu/Image -initrd ../../out/qemu/initramfs.bin -nographic -append \"root=/dev/ramdisk console=ttyAMA0\"