1 | # DebWrt - Debian on Embedded devices |
---|
2 | # |
---|
3 | # Copyright (C) 2015 Johan van Zoomeren <amain@debwrt.net> |
---|
4 | # |
---|
5 | # This program is free software: you can redistribute it and/or modify |
---|
6 | # it under the terms of the GNU General Public License as published by |
---|
7 | # the Free Software Foundation, either version 3 of the License, or |
---|
8 | # (at your option) any later version. |
---|
9 | # |
---|
10 | # This program is distributed in the hope that it will be useful, |
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | # GNU General Public License for more details. |
---|
14 | # |
---|
15 | # You should have received a copy of the GNU General Public License |
---|
16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
17 | |
---|
18 | QEMU_BIN=$(DEBIAN_BUILD_DIR)/usr/local/bin/qemu-$(TARGET_ARCH) |
---|
19 | QEMU_BIN_STATIC=$(QEMU_BIN) |
---|
20 | QEMU_INTERPRETER=$(shell cat /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH) 2>/dev/null | grep interpreter | awk '{print $$2}') |
---|
21 | |
---|
22 | debian/buildenv/qemu: debian/buildenv/qemu-prepare debian/buildenv/qemu-build |
---|
23 | touch $@ |
---|
24 | |
---|
25 | debian/buildenv/qemu-clean: |
---|
26 | rm -rf $(DEBIAN_BUILD_DIR)/usr/src/qemu |
---|
27 | rm -f debian/buildenv/qemu-prepare |
---|
28 | rm -f debian/buildenv/qemu-build |
---|
29 | |
---|
30 | debian/buildenv/qemu-prepare: debian/buildenv/create |
---|
31 | $(CHROOT) bash -c "export LC_ALL=C; apt-get -y install libglib2.0-dev flex bison build-essential autoconf libtool" |
---|
32 | mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/qemu |
---|
33 | wget -O $(DEBIAN_BUILD_DIR)/usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.bz2 http://wiki.qemu-project.org/download/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.bz2 |
---|
34 | tar xjf $(DEBIAN_BUILD_DIR)/usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.bz2 -C $(DEBIAN_BUILD_DIR)/usr/src/qemu |
---|
35 | touch $@ |
---|
36 | |
---|
37 | debian/buildenv/qemu-build: debian/buildenv/qemu-prepare |
---|
38 | $(CHROOT_USER) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && ./configure --static --target-list=$(TARGET_ARCH)-linux-user --disable-kvm --disable-vnc --disable-guest-base --disable-tpm --disable-guest-agent" |
---|
39 | $(CHROOT_USER) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make" |
---|
40 | $(CHROOT) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make install" |
---|
41 | $(CHROOT) cp /usr/local/bin/qemu-$(TARGET_ARCH) /usr/local/bin/qemu-$(TARGET_ARCH)-static |
---|
42 | touch $@ |
---|
43 | |
---|
44 | .PHONY: debian/buildenv/qemu-clean |
---|
45 | |
---|