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 tmp
/info/.stamp-
$(1)-$(shell ls
$(2)/*/Makefile |
(md5sum || md5
) 2>/dev
/null | cut
-d
' ' -f1
)
51 STAMP_pkginfo
=$(call stamp
,pkginfo
,package
)
52 STAMP_targetinfo
=$(call stamp
,targetinfo
,target
/linux
)
57 @
rm -f tmp
/info/.stamp-
$(1)*
60 $(foreach FILE
,$(shell ls
$(2)/*/Makefile
),
65 tmp
/.
$(1): $(STAMP_
$(1))
66 @echo
-n Collecting
$(3) info...
67 @
$(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="$(1)" SCAN_DIR
="$(2)" SCAN_NAME
="$(3)" SCAN_DEPS
="$(4)"
71 $(eval
$(call scan_info
,pkginfo
,package
,package
,include/package.mk
))
72 $(eval
$(call scan_info
,targetinfo
,target
/linux
,target
,include/kernel-build.mk
include/kernel-version.mk
))
75 @
-rm -rf tmp
/.pkginfo tmp
/.targetinfo
77 tmp
/.config.in
: tmp
/.pkginfo
78 @.
/scripts
/metadata.pl package_config
< $< > $@ ||
rm -f
$@
80 tmp
/.config-target.in
: tmp
/.targetinfo
81 @.
/scripts
/metadata.pl target_config
< $< > $@ ||
rm -f
$@
83 .config
: .
/scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in
84 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
85 @
$< -D .config Config.in
&> /dev
/null
88 @
$(MAKE
) -C scripts
/config
all
91 @
$(MAKE
) -C scripts
/config conf
93 config
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
97 $(NO_TRACE_MAKE
) -C scripts
/config
clean
99 defconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
101 $< -D .config Config.in
103 oldconfig
: scripts
/config
/conf tmp
/.config.in tmp
/.config-target.in FORCE
106 menuconfig
: scripts
/config
/mconf tmp
/.config.in tmp
/.config-target.in FORCE
109 kernel_menuconfig
: .config FORCE
110 -$(MAKE
) target
/linux-prepare
111 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
114 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
115 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
118 @
$(NO_TRACE_MAKE
) -s tmp
/.pkginfo tmp
/.targetinfo
119 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
122 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
124 toolchain
/%: tmp
/.targetinfo FORCE
125 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
127 tmp
/.prereq-build
: include/prereq-build.mk
130 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
131 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
136 tmp
/.prereq-packages
: include/prereq.mk tmp
/.pkginfo .config
139 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
140 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
145 tmp
/.prereq-target
: include/prereq.mk tmp
/.targetinfo .config
148 @
$(NO_TRACE_MAKE
) -s
-C target prereq
2>/dev
/null ||
{ \
149 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
154 prereq
: tmp
/.prereq-build tmp
/.prereq-packages tmp
/.prereq-target FORCE
156 download
: .config FORCE
157 $(MAKE
) tools
/download
158 $(MAKE
) toolchain
/download
159 $(MAKE
) package
/download
160 $(MAKE
) target
/download
163 $(MAKE
) tools
/install
164 $(MAKE
) toolchain
/install
165 $(MAKE
) target
/compile
166 $(MAKE
) package
/compile
167 $(MAKE
) package
/install
168 $(MAKE
) target
/install
169 $(MAKE
) package
/index
172 rm -rf build_
* bin tmp
175 rm -rf staging_dir_
* toolchain_build_
* tool_build
177 distclean: dirclean config-clean
184 $(MAKE
) -C docs
/ openwrt.pdf
187 $(MAKE
) -C docs
/ clean
189 .SILENT
: clean dirclean
distclean config-clean download world