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)
35 ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
36 @echo Collecting package info...
37 @-for dir in package/*/; do \
38 echo Source-Makefile: $${dir}Makefile; \
39 $(NO_TRACE_MAKE) --no-print-dir DUMP=1 -C $$dir 2>&- || true; \
44 @./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@
47 -rm -f .pkginfo .config.in
49 ./scripts/config/mconf: .config.in
50 @$(MAKE) -C scripts/config all
52 ./scripts/config/conf: .config.in
53 @$(MAKE) -C scripts/config conf
55 config: ./scripts/config/conf FORCE
58 defconfig: ./scripts/config/conf FORCE
60 $< -D .config Config.in
62 oldconfig: ./scripts/config/conf FORCE
65 menuconfig: ./scripts/config/mconf FORCE
69 $(MAKE) -C scripts/config clean
71 package/%: .pkginfo FORCE
72 $(MAKE) -C package $(patsubst package/%,%,$@)
74 target/%: .pkginfo FORCE
75 $(MAKE) -C target $(patsubst target/%,%,$@)
78 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
80 .config: ./scripts/config/conf FORCE
81 @[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
82 @$< -D .config Config.in &> /dev/null
84 .prereq: $(TOPDIR)/include/prereq.mk .pkginfo
85 @$(NO_TRACE_MAKE) -s -f $(TOPDIR)/include/prereq.mk prereq 2>/dev/null || { \
86 echo "Prerequisite check failed. Use FORCE=1 to override."; \
93 download: .config FORCE
94 $(MAKE) toolchain/download
95 $(MAKE) package/download
96 $(MAKE) target/download
103 $(MAKE) toolchain/install
104 $(MAKE) target/compile
105 $(MAKE) package/compile
106 $(MAKE) package/install
107 $(MAKE) target/install
113 rm -rf staging_dir_* toolchain_build_*
115 distclean: dirclean config-clean
116 rm -rf dl .*config* .pkg* .prereq
119 .SILENT: clean dirclean distclean config-clean download world