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 include $(TOPDIR
)/include/verbose.mk
25 ifeq ($(KBUILD_VERBOSE
),99)
26 MAKE
:=3>/dev
/null
$(MAKE
)
29 OPENWRTVERSION
:=$(RELEASE
)
31 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
33 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
35 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
40 ifneq ($(shell .
/scripts
/timestamp.pl
-p .pkginfo package Makefile
),.pkginfo
)
41 .pkginfo .config
: FORCE
45 .config scripts
/config
/conf scripts
/config
/mconf
: .prereq-build
46 world
: .prereq-packages
50 @echo Collecting package
info...
51 @
-for
dir in package
/*/; do \
52 echo Source-Makefile
: $${dir}Makefile
; \
53 $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 -C
$$dir 3>/dev
/null || echo
"ERROR: please fix $${dir}Makefile" >&2; \
57 -rm -f .pkginfo .config.in
60 @.
/scripts
/gen_menuconfig.pl
< $< > $@ ||
rm -f
$@
62 .config
: .
/scripts
/config
/conf .config.in
63 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
64 @
$< -D .config Config.in
&> /dev
/null
67 @
$(MAKE
) -C scripts
/config
all
70 @
$(MAKE
) -C scripts
/config conf
72 config
: scripts
/config
/conf .config.in FORCE
76 $(NO_TRACE_MAKE
) -C scripts
/config
clean
78 defconfig
: scripts
/config
/conf .config.in FORCE
80 $< -D .config Config.in
82 oldconfig
: scripts
/config
/conf .config.in FORCE
85 menuconfig
: scripts
/config
/mconf .config.in FORCE
88 package
/%: .pkginfo FORCE
89 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
91 target
/%: .pkginfo FORCE
92 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
95 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
98 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
100 .prereq-build
: include/prereq-build.mk
101 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
102 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
103 rm -rf
$(TOPDIR
)/tmp
; \
106 @
rm -rf
$(TOPDIR
)/tmp
109 .prereq-packages
: include/prereq.mk .pkginfo .config
110 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
111 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
114 @
rm -rf
"$(TOPDIR)/tmp"
117 prereq
: .prereq-build .prereq-packages FORCE
119 download
: .config FORCE
120 $(MAKE
) tools
/download
121 $(MAKE
) toolchain
/download
122 $(MAKE
) package
/download
123 $(MAKE
) target
/download
126 $(MAKE
) tools
/install
127 $(MAKE
) toolchain
/install
128 $(MAKE
) target
/compile
129 $(MAKE
) package
/compile
130 $(MAKE
) package
/install
131 $(MAKE
) target
/install
132 $(MAKE
) package
/index
138 rm -rf staging_dir_
* toolchain_build_
* tool_build
140 distclean: dirclean config-clean
141 rm -rf dl .
*config
* .pkg
* .prereq
143 .SILENT
: clean dirclean
distclean config-clean download world