source: trunk/debian/buildenv/qemu.mk @ 919

Last change on this file since 919 was 694, checked in by amain, 3 years ago

Split firmware build from rootfs creation and debian build environment creation

File size: 2.3 KB
Line 
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
18QEMU_INTERPRETER=$(shell cat /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH) 2>/dev/null | grep interpreter | awk '{print $$2}')
19
20debian/buildenv/qemu: debian/buildenv/qemu-prepare debian/buildenv/qemu-build
21        touch $@
22
23debian/buildenv/qemu-clean:
24        rm -rf $(DEBIAN_BUILD_DIR)/usr/src/qemu
25        rm -f debian/buildenv/qemu-prepare
26        rm -f debian/buildenv/qemu-build
27
28debian/buildenv/qemu-prepare: debian/buildenv/create
29        $(CHROOT) bash -c "export LC_ALL=C; apt-get -y install libglib2.0-dev flex bison build-essential autoconf libtool"
30        mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/qemu
31        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
32        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
33        touch $@
34
35debian/buildenv/qemu-build: debian/buildenv/qemu-prepare
36        $(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"
37        $(CHROOT_USER) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make"
38        $(CHROOT) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make install"
39        $(CHROOT) cp /usr/local/bin/qemu-$(TARGET_ARCH) /usr/local/bin/qemu-$(TARGET_ARCH)-static
40        touch $@
41
42.PHONY: debian/buildenv/qemu-clean
43
Note: See TracBrowser for help on using the repository browser.