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 export TOPDIR
=${shell pwd
}
21 include $(TOPDIR
)/include/verbose.mk
23 OPENWRTVERSION
:=$(RELEASE
)
25 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
27 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
29 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
34 ifneq ($(shell .
/scripts
/timestamp.pl
-p .pkginfo package Makefile
),.pkginfo
)
35 .pkginfo .config
: FORCE
39 .config scripts
/config
/conf scripts
/config
/mconf
: .prereq-build
40 world
: .prereq-packages
44 @echo Collecting package
info...
45 @
-for
dir in package
/*/; do \
46 echo Source-Makefile
: $${dir}Makefile
; \
47 $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 -C
$$dir || echo
"ERROR: please fix $${dir}Makefile" >&2; \
51 -rm -f .pkginfo .config.in
54 @.
/scripts
/gen_menuconfig.pl
< $< > $@ ||
rm -f
$@
56 .config
: .
/scripts
/config
/conf .config.in
57 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
58 @
$< -D .config Config.in
&> /dev
/null
61 @
$(MAKE
) -C scripts
/config
all
64 @
$(MAKE
) -C scripts
/config conf
66 config
: scripts
/config
/conf .config.in FORCE
70 $(NO_TRACE_MAKE
) -C scripts
/config
clean
72 defconfig
: scripts
/config
/conf .config.in FORCE
74 $< -D .config Config.in
76 oldconfig
: scripts
/config
/conf .config.in FORCE
79 menuconfig
: scripts
/config
/mconf .config.in FORCE
82 package
/%: .pkginfo FORCE
83 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
85 target
/%: .pkginfo FORCE
86 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
89 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
92 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
94 .prereq-build
: include/prereq-build.mk
95 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
96 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
97 rm -rf
$(TOPDIR
)/tmp
; \
100 @
rm -rf
$(TOPDIR
)/tmp
103 .prereq-packages
: include/prereq.mk .pkginfo .config
104 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
105 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
108 @
rm -rf
"$(TOPDIR)/tmp"
111 prereq
: .prereq-build .prereq-packages FORCE
113 download
: .config FORCE
114 $(MAKE
) tools
/download
115 $(MAKE
) toolchain
/download
116 $(MAKE
) package
/download
117 $(MAKE
) target
/download
120 $(MAKE
) tools
/install
121 $(MAKE
) toolchain
/install
122 $(MAKE
) target
/compile
123 $(MAKE
) package
/compile
124 $(MAKE
) package
/install
125 $(MAKE
) target
/install
126 $(MAKE
) package
/index
132 rm -rf staging_dir_
* toolchain_build_
* tool_build
134 distclean: dirclean config-clean
135 rm -rf dl .
*config
* .pkg
* .prereq
137 .SILENT
: clean dirclean
distclean config-clean download world