fix BR2_ and CONFIG_ issues
[openwrt.git] / target / linux / package / Makefile
1 # Main makefile for the packages
2 include $(TOPDIR)/rules.mk
3 include ../rules.mk
4
5 package-y += base-files
6 package-$(CONFIG_PACKAGE_KMOD_ALSA) += alsa
7 package-$(CONFIG_PACKAGE_KMOD_FUSE) += fuse
8 package-$(CONFIG_PACKAGE_KMOD_HOSTAP) += hostap
9 package-$(CONFIG_PACKAGE_KMOD_BCM43XX_STANDALONE) += bcm43xx-standalone
10 package-$(CONFIG_PACKAGE_KMOD_IEEE80211_DSCAPE) += ieee80211-dscape
11 package-$(CONFIG_PACKAGE_KMOD_MADWIFI) += madwifi
12 package-$(CONFIG_PACKAGE_KMOD_MADWIFI_OLD) += madwifi-old
13 package-$(CONFIG_PACKAGE_KMOD_MINI_FO) += mini_fo
14 package-$(CONFIG_PACKAGE_KMOD_OPENSWAN) += openswan
15 package-$(CONFIG_PACKAGE_KMOD_SHFS) += shfs
16 package-$(CONFIG_PACKAGE_KMOD_SPCA5XX) += spca5xx
17 package-$(CONFIG_PACKAGE_KMOD_SWITCH) += switch
18 package-$(CONFIG_PACKAGE_KMOD_UEAGLE_ATM) += ueagle-atm
19 package-$(CONFIG_PACKAGE_KMOD_DIAG) += diag
20 package-$(CONFIG_PACKAGE_KMOD_WLCOMPAT) += wlcompat
21 package-$(CONFIG_PACKAGE_KMOD_ZD1211) += zd1211
22
23 bcm43xx-standalone-compile: ieee80211-dscape-compile
24 wlcompat-compile: base-files-compile
25
26 all: compile install
27 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
28 prepare: $(patsubst %,%-prepare,$(package-y) $(package-m))
29 compile: $(patsubst %,%-compile,$(package-y) $(package-m))
30 install: $(patsubst %,%-install,$(package-y))
31
32 KPKG_MAKEOPTS += BUILD_DIR="$(LINUX_BUILD_DIR)"
33
34 %-prepare:
35         $(MAKE) -C $(patsubst %-prepare,%,$@) \
36                 $(KPKG_MAKEOPTS) \
37                 prepare
38
39 %-compile:
40         $(MAKE) -C $(patsubst %-compile,%,$@) \
41                 $(KPKG_MAKEOPTS) \
42                 compile
43
44 %-install:
45         $(MAKE) -C $(patsubst %-install,%,$@) \
46                 $(KPKG_MAKEOPTS) \
47                 install
48
49 %-clean:
50         @$(MAKE) -C $(patsubst %-clean,%,$@) \
51                 $(KPKG_MAKEOPTS) \
52                 clean
53