3 # Copyright (C) 2006 OpenWrt.org
4 # Copyright (C) 2006 by Felix Fietkau <openwrt@nbd.name>
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
11 #VERSION:=2.0 # uncomment for final release
13 #--------------------------------------------------------------
14 # Just run 'make menuconfig', configure stuff, then run 'make'.
15 # You shouldn't need to mess with anything beyond this point...
16 #--------------------------------------------------------------
20 SHELL
:=/usr
/bin
/env bash
23 export TOPDIR
=${CURDIR}
24 ifeq ($(KBUILD_VERBOSE
),99)
25 MAKE
:=3>/dev
/null
$(MAKE
)
27 export IS_TTY
=$(shell tty
-s
&& echo
1 || echo
0)
29 include $(TOPDIR
)/include/verbose.mk
31 OPENWRTVERSION
:=$(RELEASE
)
33 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
35 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
37 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
43 .config scripts
/config
/conf scripts
/config
/mconf
: tmp
/.prereq-build
44 world
: tmp
/.prereq-packages tmp
/.prereq-target
49 @
$(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="pkginfo" SCAN_DIR
="package" SCAN_NAME
="package" SCAN_DEPS
="$(shell ls include/package*.mk) include/kernel.mk" SCAN_EXTRA
=""
51 tmp
/.targetinfo
: FORCE
53 @
$(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="targetinfo" SCAN_DIR
="target/linux" SCAN_NAME
="target" SCAN_DEPS
="$(shell ls include/kernel*.mk)" SCAN_EXTRA
=""
56 @
-rm -rf tmp
/.pkginfo tmp
/.targetinfo
58 tmp
/.config.in
: tmp
/.pkginfo
59 @.
/scripts
/metadata.pl package_config
< $< > $@ ||
rm -f
$@
61 tmp
/.config-target.in
: tmp
/.targetinfo
62 @.
/scripts
/metadata.pl target_config
< $< > $@ ||
rm -f
$@
64 .config
: .
/scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in
65 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
66 @
$< -D .config Config.in
&> /dev
/null
69 @
$(MAKE
) -C scripts
/config
all
72 @
$(MAKE
) -C scripts
/config conf
74 config
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
78 $(NO_TRACE_MAKE
) -C scripts
/config
clean
80 defconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
82 $< -D .config Config.in
84 oldconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
87 menuconfig
: scripts
/config
/mconf tmp
/.config.in tmp
/.config-target.in FORCE
90 kernel_menuconfig
: .config FORCE
91 -$(MAKE
) target
/linux-prepare
92 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
95 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
98 package
/%: scan_packages
99 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
101 target
/%: scan_packages
102 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
103 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
106 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
108 toolchain
/%: tmp
/.targetinfo FORCE
109 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
111 tmp
/.prereq-build
: include/prereq-build.mk
114 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
115 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
120 tmp
/.prereq-packages
: include/prereq.mk tmp
/.pkginfo .config
123 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
124 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
129 tmp
/.prereq-target
: include/prereq.mk tmp
/.targetinfo .config
132 @
$(NO_TRACE_MAKE
) -s
-C target prereq
2>/dev
/null ||
{ \
133 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
138 prereq
: tmp
/.prereq-build tmp
/.prereq-packages tmp
/.prereq-target FORCE
140 download
: .config FORCE
141 $(MAKE
) tools
/download
142 $(MAKE
) toolchain
/download
143 $(MAKE
) package
/download
144 $(MAKE
) target
/download
147 $(MAKE
) tools
/install
148 $(MAKE
) toolchain
/install
149 $(MAKE
) target
/compile
150 $(MAKE
) package
/compile
151 $(MAKE
) package
/install
152 $(MAKE
) target
/install
153 $(MAKE
) package
/index
156 rm -rf build_
* bin tmp
159 rm -rf staging_dir_
* toolchain_build_
* tool_build
161 distclean: dirclean config-clean symlinkclean docclean
168 $(MAKE
) -C docs
/ openwrt.pdf
171 $(MAKE
) -C docs
/ clean
174 find package
-type l
-exec
rm -f
{} +
176 .SILENT
: clean dirclean
distclean symlinkclean config-clean download world