source: trunk/Makefile @ 872

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

qemu: add qemu-system support; quickly download latest debwrt rootfs and kernel and test it in the qemu emulator.

File size: 3.0 KB
Line 
1# DebWrt - Debian on Embedded devices
2#
3# Copyright (C) 2010 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# Debuging make file
19#OLD_SHELL := $(SHELL)
20#SHELL = $(warning [$@ ($^) ($?)])$(OLD_SHELL)
21#
22# make --debug=basic
23
24TOPDIR:=$(CURDIR)
25
26LC_ALL:=C
27
28all: world
29
30include rules/functions.mk
31include rules/scripts.mk
32include rules/debwrt.mk
33include rules/users.mk
34include rules/help.mk
35include config/config.mk
36
37ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
38        include openwrt/openwrt.mk
39        include openwrt/openwrt-deliver.mk
40endif
41
42include debian/debian.mk
43include plugins/plugins.mk
44
45include qemu/qemu.mk
46
47world: .config openwrt/all debian/rootfs
48        @echo Make DebWrt completed
49        @echo
50        @echo "DEBWRTVERSION : $$DEBWRTVERSION"
51        @echo "TARGET_ARCH   : $$TARGET_ARCH"
52        @echo "TARGET        : $$TARGET"
53        @echo "SUB_TARGET    : $$SUB_TARGET"
54        @echo "LINUX_VERSION : $$OPENWRT_LINUX_VERSION ($$LINUX_VERSION)" 
55
56update-targets: openwrt/prepare
57        cat $(OPENWRT_BUILD_DIR)/tmp/.config-target.in \
58                |  awk 'BEGIN{ print "# note: this file has been generated" } \
59               /select HAS_SUB/ { print $0; next } \
60               /select[ \t]+[[:lower:]]+/ { print; next } \
61               /select/ {next} \
62               // { print $0 }' \
63        >$(TOPDIR)/config/kernel/target/target.in
64        cat $(OPENWRT_BUILD_DIR)/target/Config.in | grep -v 'source "tmp/.config-target.in"' >$(TOPDIR)/config/kernel/target/archs.in
65
66board:
67        @echo "Architecture: " $(TARGET_ARCH)
68        @echo "Target      : " $(TARGET)
69        @echo "Sub-Target  : " $(SUB_TARGET)
70
71flash:
72        cd $(INSTALL_DIR) && $(SCRIPT_FLASH) "$(call qstrip,$(CONFIG_FLASH_IP))" "$(CONFIG_DEBWRT_TARGET_IMAGE_NAME_TRX)" || echo
73        @echo "Note: wait a couple of minutes before rebooting your device. It takes time to write the firmware to the flash."
74
75ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
76clean: openwrt/clean debian/clean plugins/clean
77else
78clean: debian/clean config/clean plugins/clean
79endif
80        rm -rf $(BIN_DIR)
81
82ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
83dirclean: openwrt/dirclean debian/clean config/clean plugins/clean
84else
85dirclean: debian/clean config/clean plugins/clean
86endif
87        rm -rf $(BIN_DIR)
88
89ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
90distclean: openwrt/distclean debian/clean config/clean plugins/clean
91else
92distclean: debian/clean config/clean plugins/clean
93endif
94        rm -rf $(BIN_DIR)
95        rm -rf $(BUILD_DIR)
96        rm -f .config
97
98
99.PHONY: clean all world flash board update-targets
100
101FORCE: ;
102.PHONY: FORCE
103.NOTPARALLEL:
Note: See TracBrowser for help on using the repository browser.