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)
27 include $(INCLUDE_DIR
)/depends.mk
28 include $(INCLUDE_DIR
)/subdir.mk
29 include tools
/Makefile
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 SCAN_COOKIE?
=$(shell echo
$$$$)
53 tmp
/.packageinfo tmp
/.targetinfo
: FORCE
55 $(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_DEPTH
=2 SCAN_EXTRA
=""
56 $(NO_TRACE_MAKE
) -s
-f
include/scan.mk SCAN_TARGET
="packageinfo" SCAN_DIR
="package" SCAN_NAME
="package" SCAN_DEPS
="$(TOPDIR)/include/package*.mk" SCAN_DEPTH
=4 SCAN_EXTRA
=""
61 tmp
/.config-
%.in
: tmp
/.
%info scripts
/metadata.pl
62 .
/scripts
/metadata.pl
$*_config
< $< > $@ ||
rm -f
$@
64 .config
: .
/scripts
/config
/conf tmp
/.config-target.in tmp
/.config-package.in
65 if
[ \
! -f .config
]; then \
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
93 if
[ \
! -f .config
-a
-e
$(HOME
)/.openwrt
/defconfig
]; then \
94 cp
$(HOME
)/.openwrt
/defconfig .config
; \
98 kernel_oldconfig
: .config FORCE
99 $(NO_TRACE_MAKE
) -C target
/linux oldconfig
101 kernel_menuconfig
: .config FORCE
102 $(NO_TRACE_MAKE
) -C target
/linux menuconfig
104 package
/% target
/%: tmp
/.packageinfo
105 toolchain
/% package
/% target
/%: tmp
/.targetinfo
106 package
/% target
/% toolchain
/%: FORCE
107 $(MAKE
) -C
$(patsubst %/$*,%,$@
) $*
110 tmp
/.prereq-build
: include/prereq-build.mk
113 $(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
114 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
119 tmp
/.prereq-
%: include/prereq.mk tmp
/.
%info .config
122 $(NO_TRACE_MAKE
) -s
-C
$* prereq
2>/dev
/null ||
{ \
123 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
128 prereq
: tmp
/.prereq-build tmp
/.prereq-package tmp
/.prereq-target FORCE
130 download
: .config FORCE
131 $(MAKE
) tools
/download
132 $(MAKE
) toolchain
/download
133 $(MAKE
) package
/download
134 $(MAKE
) target
/download
136 world
: .config
$(tools
/stamp
) FORCE
137 $(MAKE
) toolchain
/install
138 $(MAKE
) target
/compile
139 $(MAKE
) package
/compile
140 $(MAKE
) package
/install
141 $(MAKE
) target
/install
142 $(MAKE
) package
/index
145 rm -rf build_
* bin tmp
148 rm -rf staging_dir_
* toolchain_build_
* tool_build
150 distclean: dirclean config-clean symlinkclean docs
/clean
156 docs docs
/compile
: FORCE
157 $(MAKE
) -C docs compile
160 $(MAKE
) -C docs
clean
163 -find package
-type l | xargs
rm -f
166 .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