credit where credit is due
[openwrt/staging/dedeckeh.git] / openwrt / Makefile
1 # Makefile for OpenWrt
2 #
3 # Copyright (C) 2006 OpenWrt.org
4 # Copyright (C) 2006 by Felix Fietkau <openwrt@nbd.name>
5 #
6 # This is free software, licensed under the GNU General Public License v2.
7 # See /LICENSE for more information.
8 #
9
10 RELEASE:=Kamikaze
11 #VERSION:=2.0 # uncomment for final release
12
13 #--------------------------------------------------------------
14 # Just run 'make menuconfig', configure stuff, then run 'make'.
15 # You shouldn't need to mess with anything beyond this point...
16 #--------------------------------------------------------------
17 TOPDIR=${shell pwd}
18 export TOPDIR
19 include $(TOPDIR)/include/verbose.mk
20
21 OPENWRTVERSION:=$(RELEASE)
22 ifneq ($(VERSION),)
23 OPENWRTVERSION:=$(VERSION) ($(OPENWRTVERSION))
24 else
25 REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
26 ifneq ($(REV),)
27 OPENWRTVERSION:=$(OPENWRTVERSION)/r$(REV)
28 endif
29 endif
30 export OPENWRTVERSION
31
32 all: world
33
34 .pkginfo: FORCE
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; \
40 done > $@
41 endif
42
43 .config.in: .pkginfo
44 ./scripts/gen_menuconfig.pl < $< > $@ || rm -f $@
45
46 pkginfo-clean: FORCE
47 -rm -f .pkginfo .config.in
48
49 ./scripts/config/mconf: .config.in
50 $(MAKE) -C scripts/config all
51
52 ./scripts/config/conf: .config.in
53 $(MAKE) -C scripts/config conf
54
55 config: ./scripts/config/conf FORCE
56 $< Config.in
57
58 defconfig: ./scripts/config/conf FORCE
59 touch .config
60 $< -D .config Config.in
61
62 oldconfig: ./scripts/config/conf FORCE
63 $< -o Config.in
64
65 menuconfig: ./scripts/config/mconf FORCE
66 $< Config.in
67
68 config-clean: FORCE
69 $(MAKE) -C scripts/config clean
70
71 package/%: .pkginfo FORCE
72 $(MAKE) -C package $(patsubst package/%,%,$@)
73
74 target/%: .pkginfo FORCE
75 $(MAKE) -C target $(patsubst target/%,%,$@)
76
77 toolchain/%: FORCE
78 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
79
80 .config: ./scripts/config/conf FORCE
81 @[ -f .config ] || $(NO_TRACE_MAKE) menuconfig
82 $< -D .config Config.in >/dev/null 2>/dev/null
83
84 download: .config FORCE
85 $(MAKE) toolchain/download
86 $(MAKE) package/download
87 $(MAKE) target/download
88
89 world: .config FORCE
90 $(MAKE) toolchain/install
91 $(MAKE) target/compile
92 $(MAKE) package/compile
93 $(MAKE) package/install
94 $(MAKE) target/install
95
96 clean: FORCE
97 rm -rf build_* bin
98
99 dirclean: clean
100 rm -rf staging_dir_* toolchain_build_*
101
102 distclean: dirclean config-clean
103 rm -rf dl .*config* .pkg*
104
105 .PHONY: FORCE
106 FORCE: