Root/Makefile

Source at commit 646a755372317d681048948ae6792bdb7b82249c created 8 years 9 months ago.
By Xiangfu Liu, disable CONFIG_ALL, add Tile and gottet
1# Makefile for OpenWrt
2#
3# Copyright (C) 2007 OpenWrt.org
4#
5# This is free software, licensed under the GNU General Public License v2.
6# See /LICENSE for more information.
7#
8
9TOPDIR:=${CURDIR}
10LC_ALL:=C
11LANG:=C
12export TOPDIR LC_ALL LANG
13
14world:
15
16include $(TOPDIR)/include/host.mk
17
18ifneq ($(OPENWRT_BUILD),1)
19  # XXX: these three lines are normally defined by rules.mk
20  # but we can't include that file in this context
21  empty:=
22  space:= $(empty) $(empty)
23  _SINGLE=export MAKEFLAGS=$(space);
24
25  override OPENWRT_BUILD=1
26  export OPENWRT_BUILD
27  include $(TOPDIR)/include/debug.mk
28  include $(TOPDIR)/include/depends.mk
29  include $(TOPDIR)/include/toplevel.mk
30else
31  include rules.mk
32  include $(INCLUDE_DIR)/depends.mk
33  include $(INCLUDE_DIR)/subdir.mk
34  include target/Makefile
35  include package/Makefile
36  include tools/Makefile
37  include toolchain/Makefile
38
39$(toolchain/stamp-install): $(tools/stamp-install)
40$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
41$(package/stamp-cleanup): $(target/stamp-compile)
42$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
43$(package/stamp-install): $(package/stamp-compile)
44$(package/stamp-rootfs-prepare): $(package/stamp-install)
45$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare)
46
47$(BUILD_DIR)/.prepared: Makefile
48    @mkdir -p $$(dirname $@)
49    @touch $@
50
51prepare: $(target/stamp-compile)
52
53clean: FORCE
54    $(_SINGLE)$(SUBMAKE) target/linux/clean
55    rm -rf $(BUILD_DIR) $(BIN_DIR) $(BUILD_LOG_DIR)
56
57dirclean: clean
58    rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
59    rm -rf $(TMP_DIR)
60
61tmp/.prereq_packages: .config
62    unset ERROR; \
63    for package in $(sort $(prereq-y) $(prereq-m)); do \
64        $(_SINGLE)$(NO_TRACE_MAKE) -s -r -C package/$$package prereq || ERROR=1; \
65    done; \
66    if [ -n "$$ERROR" ]; then \
67        echo "Package prerequisite check failed."; \
68        false; \
69    fi
70    touch $@
71
72# check prerequisites before starting to build
73prereq: $(target/stamp-prereq) tmp/.prereq_packages
74
75prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
76world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
77    $(_SINGLE)$(SUBMAKE) -r package/index
78
79# update all feeds, re-create index files, install symlinks
80package/symlinks:
81    $(SCRIPT_DIR)/feeds update -a
82    $(SCRIPT_DIR)/feeds install -a
83
84# re-create index files, install symlinks
85package/symlinks-install:
86    $(SCRIPT_DIR)/feeds update -i
87    $(SCRIPT_DIR)/feeds install -a
88
89# remove all symlinks, don't touch ./feeds
90package/symlinks-clean:
91    $(SCRIPT_DIR)/feeds uninstall -a
92
93.PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
94
95endif
96

Archive Download this file



interactive