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
48 @
$(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
=""
50 tmp
/.targetinfo
: FORCE
51 @
$(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
=""
54 @
-rm -rf tmp
/.pkginfo tmp
/.targetinfo
56 tmp
/.config.in
: tmp
/.pkginfo
57 @.
/scripts
/metadata.pl package_config
< $< > $@ ||
rm -f
$@
59 tmp
/.config-target.in
: tmp
/.targetinfo
60 @.
/scripts
/metadata.pl target_config
< $< > $@ ||
rm -f
$@
62 .config
: .
/scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in
63 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
64 @
$< -D .config Config.in
&> /dev
/null
67 @
$(MAKE
) -C scripts
/config
all
70 @
$(MAKE
) -C scripts
/config conf
72 config
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
76 $(NO_TRACE_MAKE
) -C scripts
/config
clean
78 defconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
80 $< -D .config Config.in
82 oldconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
85 menuconfig
: scripts
/config
/mconf tmp
/.config.in tmp
/.config-target.in FORCE
88 kernel_menuconfig
: .config FORCE
89 -$(MAKE
) target
/linux-prepare
90 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
93 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
94 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
97 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
98 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
101 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
103 toolchain
/%: tmp
/.targetinfo FORCE
104 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
106 tmp
/.prereq-build
: include/prereq-build.mk
109 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
110 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
115 tmp
/.prereq-packages
: include/prereq.mk tmp
/.pkginfo .config
118 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
119 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
124 tmp
/.prereq-target
: include/prereq.mk tmp
/.targetinfo .config
127 @
$(NO_TRACE_MAKE
) -s
-C target prereq
2>/dev
/null ||
{ \
128 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
133 prereq
: tmp
/.prereq-build tmp
/.prereq-packages tmp
/.prereq-target FORCE
135 download
: .config FORCE
136 $(MAKE
) tools
/download
137 $(MAKE
) toolchain
/download
138 $(MAKE
) package
/download
139 $(MAKE
) target
/download
142 $(MAKE
) tools
/install
143 $(MAKE
) toolchain
/install
144 $(MAKE
) target
/compile
145 $(MAKE
) package
/compile
146 $(MAKE
) package
/install
147 $(MAKE
) target
/install
148 $(MAKE
) package
/index
151 rm -rf build_
* bin tmp
154 rm -rf staging_dir_
* toolchain_build_
* tool_build
156 distclean: dirclean config-clean symlinkclean docclean
163 $(MAKE
) -C docs
/ openwrt.pdf
166 $(MAKE
) -C docs
/ clean
169 find package
-type l | xargs
rm -f
171 .SILENT
: clean dirclean
distclean symlinkclean config-clean download world