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 #--------------------------------------------------------------
19 include $(TOPDIR)/include/verbose.mk
21 OPENWRTVERSION:=$(RELEASE)
23 OPENWRTVERSION:=$(VERSION) ($(OPENWRTVERSION))
25 REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
27 OPENWRTVERSION:=$(OPENWRTVERSION)/r$(REV)
34 ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
40 @echo Collecting package info...
41 @-for dir in package/*/; do \
42 echo Source-Makefile: $${dir}Makefile; \
43 $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $$dir 2>&- || true; \
47 @./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@
50 -rm -f .pkginfo .config.in
52 ./scripts/config/mconf: .config.in
53 @$(MAKE) -C scripts/config all
55 ./scripts/config/conf: .config.in
56 @$(MAKE) -C scripts/config conf
58 config: ./scripts/config/conf FORCE
61 defconfig: ./scripts/config/conf FORCE
63 $< -D .config Config.in
65 oldconfig: ./scripts/config/conf FORCE
68 menuconfig: ./scripts/config/mconf FORCE
72 $(NO_TRACE_MAKE) -C scripts/config clean
74 package/%: .pkginfo FORCE
75 $(MAKE) -C package $(patsubst package/%,%,$@)
77 target/%: .pkginfo FORCE
78 $(MAKE) -C target $(patsubst target/%,%,$@)
81 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
83 .config: ./scripts/config/conf
84 @[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
85 @$< -D .config Config.in &> /dev/null
87 .prereq-build: $(TOPDIR)/include/prereq-build.mk
88 @$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
89 echo "Prerequisite check failed. Use FORCE=1 to override."; \
94 .prereq-packages: $(TOPDIR)/include/prereq.mk .pkginfo .config
95 @$(NO_TRACE_MAKE) -s -C package prereq 2>/dev/null || { \
96 echo "Prerequisite check failed. Use FORCE=1 to override."; \
101 prereq: .prereq-build .prereq-packages FORCE
103 download: .config FORCE
104 $(MAKE) toolchain/download
105 $(MAKE) package/download
106 $(MAKE) target/download
109 .config ./scripts/config/conf ./scripts/config/mconf: .prereq-build
110 world: .prereq-packages
114 $(MAKE) toolchain/install
115 $(MAKE) target/compile
116 $(MAKE) package/compile
117 $(MAKE) package/install
118 $(MAKE) target/install
124 rm -rf staging_dir_* toolchain_build_*
126 distclean: dirclean config-clean
127 rm -rf dl .*config* .pkg* .prereq
130 .SILENT: clean dirclean distclean config-clean download world