another batch of V= stuff
[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         @$(START_TRACE) "target/linux/package/$(patsubst %-prepare,%,$@)/prepare: "
38         $(MAKE) -C $(patsubst %-prepare,%,$@) \
39                 $(MAKEOPTS) \
40                 prepare
41         @$(CMD_TRACE) " done"
42         @$(END_TRACE)
43
44 %-compile:
45         @$(START_TRACE) "target/linux/package/$(patsubst %-compile,%,$@)-compile: "
46         $(MAKE) -C $(patsubst %-compile,%,$@) \
47                 $(MAKEOPTS) \
48                 compile
49         @$(CMD_TRACE) " done"
50         @$(END_TRACE)
51
52 %-install:
53         @$(START_TRACE) "target/linux/package/$(patsubst %-install,%,$@)-install: "
54         $(MAKE) -C $(patsubst %-install,%,$@) \
55                 $(MAKEOPTS) \
56                 install
57         @$(CMD_TRACE) " done"
58         @$(END_TRACE)
59
60 %-clean:
61         @$(START_TRACE) "target/linux/package/$(patsubst %-clean,%,$@)-clean: "
62         @$(MAKE) -C $(patsubst %-clean,%,$@) clean
63         @$(CMD_TRACE) " done"
64         @$(END_TRACE)
65