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

Last change on this file since 919 was 902, checked in by amain, 2 years ago

native: erlite native kernel compile support

File size: 2.7 KB
Line 
1# DebWrt - Debian on Embedded devices
2#
3# Copyright (C) 2010-2017 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
18debian/buildenv/create: debian/buildenv/prepare debian/buildenv/build-essential
19        touch $@
20
21debian/buildenv/prepare:
22        mkdir -p $(DEBIAN_BUILD_DIR)
23        sudo debootstrap --include=$(subst $(space),$(empty),$(CONFIG_DEBIAN_BUILDENV_INCLUDE_PACKAGES)) \
24                         $(DEBIAN_BUILD_VERSION) \
25                         $(DEBIAN_BUILD_DIR) \
26                         $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
27        sudo bash -c "echo 127.0.0.1 `hostname -s` localhost >$(DEBIAN_BUILD_DIR)/etc/hosts"
28        sudo bash -c "echo debwrt-$(TARGET_ARCH)-$(DEBIAN_BUILD_VERSION) > $(DEBIAN_BUILD_DIR)/etc/debian_chroot"
29        sudo bash -c "echo syntax on >$(DEBIAN_BUILD_DIR)/etc/vimrc"
30        sudo bash -c "echo 0 > /proc/sys/vm/mmap_min_addr" # for ARM targets
31        sudo bash -c "echo \"deb $(call qstrip,$(CONFIG_DEBIAN_BUILDENV_REPOSITORY)) $(DEBIAN_BUILD_VERSION) main\" >> $(DEBIAN_BUILD_DIR)/etc/apt/sources.list"
32        sudo bash -c "echo \"deb-src $(call qstrip,$(CONFIG_DEBIAN_BUILDENV_REPOSITORY)) $(DEBIAN_BUILD_VERSION) main\" >> $(DEBIAN_BUILD_DIR)/etc/apt/sources.list"
33        sudo chown $(USER):$(GROUP) $(DEBIAN_BUILD_DIR)/usr/src
34        sudo chroot $(DEBIAN_BUILD_DIR) apt-get update
35        sudo chroot $(DEBIAN_BUILD_DIR) groupadd -g $(shell id -g) debwrt
36        sudo chroot $(DEBIAN_BUILD_DIR) useradd -g debwrt -s /bin/bash -d /usr/src -m -u $(shell id -u) $$USER
37        sudo mkdir -p $(DEBIAN_BUILD_DIR)/etc/sudoers.d
38        sudo bash -c "echo \"$(USER) ALL=(ALL) NOPASSWD: ALL\" >$(DEBIAN_BUILD_DIR)/etc/sudoers.d/debwrt"
39        sudo chmod 0440 $(DEBIAN_BUILD_DIR)/etc/sudoers.d/debwrt
40        touch $@
41
42debian/buildenv/build-essential:
43        sudo chroot $(DEBIAN_BUILD_DIR) bash -c "export LC_ALL=C; apt-get -y --force-yes install build-essential dh-make debootstrap fakeroot zlib1g-dev openssh-client vim pkg-config dpatch libncurses5-dev devscripts subversion automake gcc-multilib g++-multilib quilt devscripts"
44        touch $@
45
46
47debian/buildenv/clean: debian/buildenv/qemu-clean debian/buildenv/emdebian-clean
48        sudo rm -rf $(DEBIAN_BUILD_DIR)
49        rm -f debian/buildenv/prepare
50        rm -f debian/buildenv/create
51        rm -f debian/buildenv/build-essential
52
53.PHONY: debian/buildenv/clean
54
Note: See TracBrowser for help on using the repository browser.