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 export IS_TTY
=$(shell tty
-s
&& echo
1 || echo
0)
26 include $(TOPDIR
)/include/verbose.mk
28 OPENWRTVERSION
:=$(RELEASE
)
30 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
32 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
34 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
40 .config scripts
/config
/conf scripts
/config
/mconf
: tmp
/.prereq-build
41 world
: tmp
/.prereq-package tmp
/.prereq-target
47 SCAN_COOKIE?
=$(shell echo
$$$$)
50 tmp
/.packageinfo tmp
/.targetinfo
: FORCE
52 $(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="targetinfo" SCAN_DIR
="target/linux" SCAN_NAME
="target" SCAN_DEPS
="profiles/*.mk $(TOPDIR)/include/kernel*.mk" SCAN_EXTRA
=""
53 $(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="packageinfo" SCAN_DIR
="package" SCAN_NAME
="package" SCAN_DEPS
="$(TOPDIR)/include/package*.mk" SCAN_EXTRA
=""
58 tmp
/.config-
%.in
: tmp
/.
%info scripts
/metadata.pl
59 .
/scripts
/metadata.pl
$*_config
< $< > $@ ||
rm -f
$@
61 .config
: .
/scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in
62 if
[ \
! -f .config
]; then \
63 [ -e
$(HOME
)/.openwrt
/defconfig
] && cp
$(HOME
)/.openwrt
/defconfig .config
; \
64 $(NO_TRACE_MAKE
) menuconfig
; \
66 $< -D .config Config.in
&> /dev
/null
69 $(MAKE
) -C scripts
/config
all
72 $(MAKE
) -C scripts
/config conf
76 config
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
80 $(NO_TRACE_MAKE
) -C scripts
/config
clean
82 defconfig
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
84 $< -D .config Config.in
86 oldconfig
: scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in FORCE
89 menuconfig
: scripts
/config
/mconf tmp
/.config-target.in tmp
/.config-package.in FORCE
90 if
[ \
! -f .config
-a
-e
$(HOME
)/.openwrt
/defconfig
]; then \
91 cp
$(HOME
)/.openwrt
/defconfig .config
; \
95 kernel_menuconfig
: .config FORCE
96 -$(MAKE
) target
/linux-prepare
97 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
100 package
/% target
/%: tmp
/.packageinfo
101 toolchain
/% package
/% target
/%: tmp
/.targetinfo
102 package
/% target
/% tools
/% toolchain
/%: FORCE
103 $(MAKE
) -C
$(patsubst %/$*,%,$@
) $*
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-
%: include/prereq.mk tmp
/.
%info .config
118 $(NO_TRACE_MAKE
) -s
-C
$* prereq
2>/dev
/null ||
{ \
119 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
124 prereq
: tmp
/.prereq-build tmp
/.prereq-package tmp
/.prereq-target FORCE
126 download
: .config FORCE
127 $(MAKE
) tools
/download
128 $(MAKE
) toolchain
/download
129 $(MAKE
) package
/download
130 $(MAKE
) target
/download
133 $(MAKE
) tools
/install
134 $(MAKE
) toolchain
/install
135 $(MAKE
) target
/compile
136 $(MAKE
) package
/compile
137 $(MAKE
) package
/install
138 $(MAKE
) target
/install
139 $(MAKE
) package
/index
142 rm -rf build_
* bin tmp
145 rm -rf staging_dir_
* toolchain_build_
* tool_build
147 distclean: dirclean config-clean symlinkclean docs
/clean
153 docs docs
/compile
: FORCE
154 $(MAKE
) -C docs compile
157 $(MAKE
) -C docs
clean
160 -find package
-type l | xargs
rm -f
163 .SILENT
: clean dirclean
distclean symlinkclean config-clean download world help tmp
/.packageinfo tmp
/.targetinfo tmpinfo-clean tmp
/.config-package.in tmp
/.config-target.in .config scripts
/config
/mconf scripts
/config
/conf menuconfig tmp
/.prereq-build tmp
/.prereq-package tmp
/.prereq-target