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
=${shell pwd
}
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
)
42 ifneq ($(shell .
/scripts
/timestamp.pl
-p tmp
/.pkginfo package scripts Makefile
),tmp
/.pkginfo
)
46 ifneq ($(shell .
/scripts
/timestamp.pl
-p tmp
/.targetinfo target
/linux scripts Makefile
),tmp
/.targetinfo
)
47 tmp
/.targetinfo
: FORCE
51 .config scripts
/config
/conf scripts
/config
/mconf
: tmp
/.prereq-build
52 world
: tmp
/.prereq-packages
57 @echo Collecting package
info...
58 @
-for
dir in package
/*/; do \
59 [ -f
"$${dir}/Makefile" ] || continue
; \
60 echo Source-Makefile
: $${dir}Makefile
; \
61 $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 -C
$$dir 3>/dev
/null || echo
"ERROR: please fix $${dir}Makefile" >&2; \
67 @echo Collecting target
info...
68 @
-for
dir in target
/linux
/*/; do \
69 [ -f
"$${dir}/Makefile" ] || continue
; \
70 ( cd
"$$dir"; $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 3>/dev
/null || echo
"ERROR: please fix $${dir}Makefile" >&2 ); \
75 @
-rm -rf tmp
/.pkginfo tmp
/.targetinfo
77 tmp
/.config.in
: tmp
/.pkginfo
78 @.
/scripts
/gen_package_config.pl
< $< > $@ ||
rm -f
$@
80 tmp
/.config-target.in
: tmp
/.targetinfo
81 @.
/scripts
/gen_target_config.pl
< $< > $@ ||
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 package
/%: tmp
/.pkginfo tmp
/.targetinfo FORCE
110 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
112 target
/%: tmp
/.pkginfo tmp
/.targetinfo FORCE
113 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
116 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
118 toolchain
/%: tmp
/.targetinfo FORCE
119 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
121 tmp
/.prereq-build
: include/prereq-build.mk
123 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
124 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
129 tmp
/.prereq-packages
: include/prereq.mk tmp
/.pkginfo .config
131 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
132 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
137 prereq
: tmp
/.prereq-build tmp
/.prereq-packages FORCE
139 download
: .config FORCE
140 $(MAKE
) tools
/download
141 $(MAKE
) toolchain
/download
142 $(MAKE
) package
/download
143 $(MAKE
) target
/download
146 $(MAKE
) tools
/install
147 $(MAKE
) toolchain
/install
148 $(MAKE
) target
/compile
149 $(MAKE
) package
/compile
150 $(MAKE
) package
/install
151 $(MAKE
) target
/install
152 $(MAKE
) package
/index
155 rm -rf build_
* bin tmp
158 rm -rf staging_dir_
* toolchain_build_
* tool_build
160 distclean: dirclean config-clean
163 .SILENT
: clean dirclean
distclean config-clean download world