add openwrt sdk
[openwrt/svn-archive/archive.git] / openwrt / package / sdk / files / Makefile.sdk
1 # OpenWrt SDK Makefile
2 TOPDIR:=${shell pwd}
3 export TOPDIR
4
5 include $(TOPDIR)/rules.mk
6 include $(TOPDIR)/package/depend.mk
7
8 PACKAGES:=$(filter-out %.mk,$(shell ls $(TOPDIR)/package))
9 PACKAGES_PREPARE:=$(foreach package,$(PACKAGES),$(package)-prepare)
10 PACKAGES_COMPILE:=$(foreach package,$(PACKAGES),$(package)-compile)
11 PACKAGES_CLEAN:=$(foreach package,$(PACKAGES),$(package)-clean)
12
13 all: compile
14 compile: $(PACKAGES_COMPILE)
15 clean: $(PACKAGES_CLEAN)
16 rm -rf $(BUILD_DIR)
17 rm -rf bin
18
19 distclean: clean
20 rm -rf $(DL_DIR)
21
22 %-prepare: $(BUILD_DIR)
23 @$(MAKE) -C package/$(patsubst %-prepare,%,$@) prepare
24
25 %-compile: %-prepare
26 @$(MAKE) -C package/$(patsubst %-compile,%,$@) compile
27
28 %-clean:
29 @$(MAKE) -C package/$(patsubst %-clean,%,$@) clean
30
31
32 $(BUILD_DIR):
33 mkdir -p $@
34 mkdir -p $(DL_DIR)