source: trunk/Makefile @ 727

Last change on this file since 727 was 727, checked in by amain, 4 years ago

Make clean improvements

File size: 2.8 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
45world: .config openwrt/all debian/rootfs
46        @echo Make DebWrt completed
47        @echo
48        @echo "DEBWRTVERSION : $$DEBWRTVERSION"
49        @echo "TARGET_ARCH   : $$TARGET_ARCH"
50        @echo "TARGET        : $$TARGET"
51        @echo "SUB_TARGET    : $$SUB_TARGET"
52        @echo "LINUX_VERSION : $$OPENWRT_LINUX_VERSION ($$LINUX_VERSION)" 
53
54update-targets: openwrt/prepare
55        cat $(OPENWRT_BUILD_DIR)/tmp/.config-target.in \
56                |  awk 'BEGIN{ print "# note: this file has been generated" } \
57               /select HAS_SUB/ { print $0; next } \
58               /select[ \t]+[[:lower:]]+/ { print; next } \
59               /select/ {next} \
60               // { print $0 }' \
61        >$(TOPDIR)/config/kernel/target/target.in
62        cat $(OPENWRT_BUILD_DIR)/target/Config.in | grep -v 'source "tmp/.config-target.in"' >$(TOPDIR)/config/kernel/target/archs.in
63
64board:
65        @echo "Architecture: " $(TARGET_ARCH)
66        @echo "Target      : " $(TARGET)
67        @echo "Sub-Target  : " $(SUB_TARGET)
68
69flash:
70        cd $(INSTALL_DIR) && $(SCRIPT_FLASH) "$(call qstrip,$(CONFIG_FLASH_IP))" "$(CONFIG_DEBWRT_TARGET_IMAGE_NAME_TRX)" || echo
71        @echo "Note: wait a couple of minutes before rebooting your device. It takes time to write the firmware to the flash."
72
73ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
74clean: openwrt/clean debian/clean plugins/clean
75else
76clean: debian/clean config/clean plugins/clean
77endif
78        rm -rf $(BIN_DIR)
79
80ifeq ($(CONFIG_DEBWRT_FIRMWARE),y)
81dirclean: openwrt/dirclean debian/clean config/clean plugins/clean
82else
83dirclean: debian/clean config/clean plugins/clean
84endif
85        rm -rf $(BIN_DIR)
86        rm -f .config
87
88.PHONY: clean all world flash board update-targets
89
90FORCE: ;
91.PHONY: FORCE
92.NOTPARALLEL:
Note: See TracBrowser for help on using the repository browser.