blob: eafcfdbdc708388a186d1ca96625804814239d05 [file] [log] [blame]
NAME = qemu
all: src patch config build install
NUM_PROCESSORS=`cat /proc/cpuinfo | grep processor | wc -l`
VER=2.11.1
QEMUDIR=qemu-${VER}
OUTDIR=bin-qemu-${VER}
SRCPKG=${QEMUDIR}.tar.xz
LKQEMUBIN=qemu-system-arm
LXQEMUBIN=qemu-system-aarch64
LKQEMUARGS="-machine virt -cpu cortex-a15 -m 64"
LXQEMUARGS="-machine virt -cpu cortex-a53 -m 64"
.PHONY: patch
src:
@sh -c "if [ ! -d ${QEMUDIR} ]; then \
tar Jxvf ${SRCPKG}; \
fi"
patch:
config:
@sh -c "if [ -d ${QEMUDIR} ]; then \
cd ${QEMUDIR} && ./configure --target-list=arm-softmmu,aarch64-softmmu --disable-gtk --disable-tpm; \
fi"
build:
@sh -c "if [ -d ${QEMUDIR} ]; then \
cd ${QEMUDIR} && molyq make -j${NUM_PROCESSORS}; \
fi"
install:
@sh -c "if [ -d ${QEMUDIR} ]; then \
mkdir -p ${OUTDIR}; \
cp ${QEMUDIR}/arm-softmmu/qemu-system-arm ${OUTDIR}/; \
cp ${QEMUDIR}/aarch64-softmmu/qemu-system-aarch64 ${OUTDIR}/; \
fi"
clean:
rm -fr ${QEMUDIR} config-temp config.log
runlk:
mosesq `pwd`/${OUTDIR}/${LKQEMUBIN} ${LKQEMUARGS} -kernel ../../out/qemu/lk.bin -nographic
runlinux:
mosesq `pwd`/${OUTDIR}/${LXQEMUBIN} ${LXQEMUARGS} -kernel ../../out/qemu/Image -initrd ../../out/qemu/initramfs.bin -nographic -append \"root=/dev/ramdisk console=ttyAMA0\"