large build system cleanup. added some stuff to control the verbosity level, but...
[openwrt.git] / target / linux / package / Makefile
1 # Main makefile for the packages
2 include $(TOPDIR)/rules.mk
3
4 ifneq ($(BOARD),ar7)
5 package-$(BR2_PACKAGE_KMOD_ALSA) += alsa
6 endif
7 package-$(BR2_PACKAGE_KMOD_FUSE) += fuse
8 package-$(BR2_PACKAGE_KMOD_MINI_FO) += mini_fo
9 package-$(BR2_PACKAGE_KMOD_SHFS) += shfs
10 package-$(BR2_PACKAGE_KMOD_OPENSWAN) += openswan
11 package-$(BR2_PACKAGE_KMOD_MADWIFI) += madwifi
12 package-y += openwrt
13
14 ifeq ($(BOARD)-$(KERNEL),brcm-2.4)
15 package-$(BR2_PACKAGE_KMOD_WLCOMPAT) += wlcompat
16 package-$(BR2_PACKAGE_KMOD_DIAG) += diag
17 wlcompat-compile: openwrt-compile
18 endif
19
20 all: compile install
21 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
22 prepare: $(patsubst %,%-prepare,$(package-y) $(package-m))
23 compile: $(patsubst %,%-compile,$(package-y) $(package-m))
24 install: $(patsubst %,%-install,$(package-y))
25
26 MAKEOPTS:=      BOARD="$(BOARD)" \
27                 KERNEL="$(KERNEL)" \
28                 IPKG="$(IPKG)" \
29                 TARGET_DIR="$(TARGET_DIR)" \
30                 BUILD_DIR="$(BUILD_DIR)" \
31                 KERNEL_DIR="$(KERNEL_DIR)" \
32                 LINUX_VERSION="$(LINUX_VERSION)" \
33                 KERNEL_RELEASE="$(KERNEL_RELEASE)"
34
35
36 %-prepare:
37         @$(TRACE) target/linux/package/$(patsubst %-prepare,%,$@)-prepare
38         $(MAKE) -C $(patsubst %-prepare,%,$@) \
39                 $(MAKEOPTS) \
40                 prepare
41
42 %-compile: %-prepare 
43         @$(TRACE) target/linux/package/$(patsubst %-compile,%,$@)-compile
44         $(MAKE) -C $(patsubst %-compile,%,$@) \
45                 $(MAKEOPTS) \
46                 compile
47
48 %-install: %-compile
49         @$(TRACE) target/linux/package/$(patsubst %-install,%,$@)-install
50         $(MAKE) -C $(patsubst %-install,%,$@) \
51                 $(MAKEOPTS) \
52                 install
53
54 %-clean:
55         @$(TRACE) target/linux/package/$(patsubst %-clean,%,$@)-clean
56         @$(MAKE) -C $(patsubst %-clean,%,$@) clean
57