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
26 OPENWRTVERSION
:=$(RELEASE
)
28 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
30 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
32 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
37 ifneq ($(shell .
/scripts
/timestamp.pl
-p .pkginfo package Makefile
),.pkginfo
)
38 .pkginfo .config
: FORCE
42 .config scripts
/config
/conf scripts
/config
/mconf
: .prereq-build
43 world
: .prereq-packages
47 @echo Collecting package
info...
48 @
-for
dir in package
/*/; do \
49 echo Source-Makefile
: $${dir}Makefile
; \
50 $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 -C
$$dir 3>/dev
/null || echo
"ERROR: please fix $${dir}Makefile" >&2; \
54 -rm -f .pkginfo .config.in
57 @.
/scripts
/gen_menuconfig.pl
< $< > $@ ||
rm -f
$@
59 .config
: .
/scripts
/config
/conf .config.in
60 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
61 @
$< -D .config Config.in
&> /dev
/null
64 @
$(MAKE
) -C scripts
/config
all
67 @
$(MAKE
) -C scripts
/config conf
69 config
: scripts
/config
/conf .config.in FORCE
73 $(NO_TRACE_MAKE
) -C scripts
/config
clean
75 defconfig
: scripts
/config
/conf .config.in FORCE
77 $< -D .config Config.in
79 oldconfig
: scripts
/config
/conf .config.in FORCE
82 menuconfig
: scripts
/config
/mconf .config.in FORCE
85 package
/%: .pkginfo FORCE
86 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
88 target
/%: .pkginfo FORCE
89 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
92 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
95 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
97 .prereq-build
: include/prereq-build.mk
98 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
99 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
100 rm -rf
$(TOPDIR
)/tmp
; \
103 @
rm -rf
$(TOPDIR
)/tmp
106 .prereq-packages
: include/prereq.mk .pkginfo .config
107 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
108 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
111 @
rm -rf
"$(TOPDIR)/tmp"
114 prereq
: .prereq-build .prereq-packages FORCE
116 download
: .config FORCE
117 $(MAKE
) tools
/download
118 $(MAKE
) toolchain
/download
119 $(MAKE
) package
/download
120 $(MAKE
) target
/download
123 $(MAKE
) tools
/install
124 $(MAKE
) toolchain
/install
125 $(MAKE
) target
/compile
126 $(MAKE
) package
/compile
127 $(MAKE
) package
/install
128 $(MAKE
) target
/install
129 $(MAKE
) package
/index
135 rm -rf staging_dir_
* toolchain_build_
* tool_build
137 distclean: dirclean config-clean
138 rm -rf dl .
*config
* .pkg
* .prereq
140 .SILENT
: clean dirclean
distclean config-clean download world