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
21 export TOPDIR
=${shell pwd
}
22 include $(TOPDIR
)/include/verbose.mk
24 OPENWRTVERSION
:=$(RELEASE
)
26 OPENWRTVERSION
:=$(VERSION
) ($(OPENWRTVERSION
))
28 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
30 OPENWRTVERSION
:=$(OPENWRTVERSION
)/r
$(REV
)
35 ifneq ($(shell .
/scripts
/timestamp.pl
-p .pkginfo package Makefile
),.pkginfo
)
36 .pkginfo .config
: FORCE
40 .config scripts
/config
/conf scripts
/config
/mconf
: .prereq-build
41 world
: .prereq-packages
45 @echo Collecting package
info...
46 @
-for
dir in package
/*/; do \
47 echo Source-Makefile
: $${dir}Makefile
; \
48 $(NO_TRACE_MAKE
) --no-print-dir DUMP
=1 -C
$$dir || echo
"ERROR: please fix $${dir}Makefile" >&2; \
52 -rm -f .pkginfo .config.in
55 @.
/scripts
/gen_menuconfig.pl
< $< > $@ ||
rm -f
$@
57 .config
: .
/scripts
/config
/conf .config.in
58 @
[ -f .config
] ||
$(NO_TRACE_MAKE
) menuconfig
59 @
$< -D .config Config.in
&> /dev
/null
62 @
$(MAKE
) -C scripts
/config
all
65 @
$(MAKE
) -C scripts
/config conf
67 config
: scripts
/config
/conf .config.in FORCE
71 $(NO_TRACE_MAKE
) -C scripts
/config
clean
73 defconfig
: scripts
/config
/conf .config.in FORCE
75 $< -D .config Config.in
77 oldconfig
: scripts
/config
/conf .config.in FORCE
80 menuconfig
: scripts
/config
/mconf .config.in FORCE
83 package
/%: .pkginfo FORCE
84 $(MAKE
) -C package
$(patsubst package
/%,%,$@
)
86 target
/%: .pkginfo FORCE
87 $(MAKE
) -C target
$(patsubst target
/%,%,$@
)
90 $(MAKE
) -C tools
$(patsubst tools
/%,%,$@
)
93 $(MAKE
) -C toolchain
$(patsubst toolchain
/%,%,$@
)
95 .prereq-build
: include/prereq-build.mk
96 @
$(NO_TRACE_MAKE
) -s
-f
$(TOPDIR
)/include/prereq-build.mk prereq
2>/dev
/null ||
{ \
97 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
98 rm -rf
$(TOPDIR
)/tmp
; \
101 @
rm -rf
$(TOPDIR
)/tmp
104 .prereq-packages
: include/prereq.mk .pkginfo .config
105 @
$(NO_TRACE_MAKE
) -s
-C package prereq
2>/dev
/null ||
{ \
106 echo
"Prerequisite check failed. Use FORCE=1 to override."; \
109 @
rm -rf
"$(TOPDIR)/tmp"
112 prereq
: .prereq-build .prereq-packages FORCE
114 download
: .config FORCE
115 $(MAKE
) tools
/download
116 $(MAKE
) toolchain
/download
117 $(MAKE
) package
/download
118 $(MAKE
) target
/download
121 $(MAKE
) tools
/install
122 $(MAKE
) toolchain
/install
123 $(MAKE
) target
/compile
124 $(MAKE
) package
/compile
125 $(MAKE
) package
/install
126 $(MAKE
) target
/install
127 $(MAKE
) package
/index
133 rm -rf staging_dir_
* toolchain_build_
* tool_build
135 distclean: dirclean config-clean
136 rm -rf dl .
*config
* .pkg
* .prereq
138 .SILENT
: clean dirclean
distclean config-clean download world