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-package tmp
/.prereq-target
50 tmp
/.packageinfo
: $(wildcard package
/*/Makefile
include/package
*.mk
include/kernel.mk
)
51 tmp
/.targetinfo
: $(wildcard target
/*/Makefile
include/kernel
*.mk
)
54 @
$(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="$*info" SCAN_DIR
="$(patsubst target,target/linux,$*)" SCAN_NAME
="$*" SCAN_DEPS
="$^" SCAN_EXTRA
=""
59 tmp
/.config-
%.in
: tmp
/.
%info
60 @.
/scripts
/metadata.pl
$*_config
< $< > $@ ||
rm -f
$@
64 .config
: .
/scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in
65 @
[ -f .config
] ||
{ \
66 [ -e
$(HOME
)/.openwrt
/defconfig
] && cp
$(HOME
)/.openwrt
/defconfig .config
; \
67 $(NO_TRACE_MAKE
) menuconfig
; \
69 @
$< -D .config Config.in
&> /dev
/null
72 @
$(MAKE
) -C scripts
/config
all
75 @
$(MAKE
) -C scripts
/config conf
79 config
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
83 $(NO_TRACE_MAKE
) -C scripts
/config
clean
85 defconfig
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
87 $< -D .config Config.in
89 oldconfig
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
92 menuconfig
: scripts
/config
/mconf tmp
/.config-target.in tmp
/.config-package.in FORCE
94 [ -e
$(HOME
)/.openwrt
/defconfig
] && cp
$(HOME
)/.openwrt
/defconfig .config
97 kernel_menuconfig
: .config FORCE
98 -$(MAKE
) target
/linux-prepare
99 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
102 package
/% target
/%: tmp
/.packageinfo
103 toolchain
/% package
/% target
/%: tmp
/.targetinfo
104 package
/% target
/% tools
/% toolchain
/%: FORCE
105 $(MAKE
) -C
$(patsubst %/$*,%,$@
) $*
108 tmp
/.prereq-build
: include/prereq-build.mk
111 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
112 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
117 tmp
/.prereq-
%: include/prereq.mk tmp
/.
%info .config
120 @
$(NO_TRACE_MAKE
) -s
-C
$* prereq
2>/dev
/null ||
{ \
121 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
126 prereq
: tmp
/.prereq-build tmp
/.prereq-package tmp
/.prereq-target FORCE
128 download
: .config FORCE
129 $(MAKE
) tools
/download
130 $(MAKE
) toolchain
/download
131 $(MAKE
) package
/download
132 $(MAKE
) target
/download
135 $(MAKE
) tools
/install
136 $(MAKE
) toolchain
/install
137 $(MAKE
) target
/compile
138 $(MAKE
) package
/compile
139 $(MAKE
) package
/install
140 $(MAKE
) target
/install
141 $(MAKE
) package
/index
144 rm -rf build_
* bin tmp
147 rm -rf staging_dir_
* toolchain_build_
* tool_build
149 distclean: dirclean config-clean symlinkclean docclean
156 $(MAKE
) -C docs
/ openwrt.pdf
159 $(MAKE
) -C docs
/ clean
162 find package
-type l
-exec
rm -f
{} +
164 .SILENT
: clean dirclean
distclean symlinkclean config-clean download world help