2f8451bf78b47dbd7b3556fbe97d81e01cf1e5dd
[openwrt/openwrt.git] / target / sdk / files / Makefile
1 # Makefile for OpenWrt
2 #
3 # Copyright (C) 2006 by Felix Fietkau <openwrt@nbd.name>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #
19
20 RELEASE:=Kamikaze
21 #VERSION:=2.0 # uncomment for final release
22
23 #--------------------------------------------------------------
24 # Just run 'make menuconfig', configure stuff, then run 'make'.
25 # You shouldn't need to mess with anything beyond this point...
26 #--------------------------------------------------------------
27 TOPDIR=${shell pwd}
28 export TOPDIR
29
30 DEVELOPER=1
31 export DEVELOPER
32
33 SDK=1
34 export SDK
35
36 export IS_TTY=$(shell tty -s && echo 1 || echo 0)
37 include $(TOPDIR)/include/verbose.mk
38
39 all: world
40
41 define stamp
42 tmp/info/.stamp-$(1)-$(shell ls $(2)/*/Makefile $(5) | (md5sum || md5) 2>/dev/null | cut -d' ' -f1)
43 endef
44
45 STAMP=$(call stamp,packageinfo,package)
46
47 $(STAMP):
48 @mkdir -p tmp/info
49 @rm -f tmp/info/.stamp-packageinfo*
50 @touch $@
51
52 define filedep
53 $(foreach FILE,$(shell ls package/*/Makefile),
54 tmp/.packageinfo: $(FILE)
55 $(FILE):
56 @true
57 )
58 endef
59
60 $(eval $(filedep))
61
62 tmp/.packageinfo: $(STAMP)
63 @echo -n Collecting package info...
64 @$(NO_TRACE_MAKE) -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS=""
65
66 package/%: FORCE
67 @$(NO_TRACE_MAKE) -s tmp/.packageinfo
68 $(MAKE) -C package $(patsubst package/%,%,$@) SDK=1
69
70 download: FORCE
71 $(MAKE) package/download
72
73 world: FORCE
74 $(MAKE) package/compile
75 -( \
76 cd package; \
77 find . -maxdepth 2 -name Config.in | \
78 sed -e 's,/Config.in,,g' | \
79 xargs -r -n1 make compile -C; \
80 )
81
82 clean: FORCE
83 rm -rf build_* bin
84
85 distclean: clean
86 rm -rf dl .pkg*
87
88 .PHONY: FORCE
89 FORCE: