summaryrefslogtreecommitdiffstats
path: root/package/hostap/hostap.mk
blob: 64259a76641018b1fca9109176e944635e76e215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#############################################################
#
# hostap
#
#############################################################
HOSTAP_VERSION=0.5.8
HOSTAP_SOURCE=hostapd-$(HOSTAP_VERSION).tar.gz
HOSTAP_SITE=http://hostap.epitest.fi/releases
HOSTAP_DIR=$(BUILD_DIR)/hostapd-$(HOSTAP_VERSION)

$(DL_DIR)/$(HOSTAP_SOURCE):
	$(WGET) -P $(DL_DIR) $(HOSTAP_SITE)/$(HOSTAP_SOURCE)

hostap-source: $(DL_DIR)/$(HOSTAP_SOURCE)

$(HOSTAP_DIR)/.unpacked: $(DL_DIR)/$(HOSTAP_SOURCE)
	$(ZCAT) $(DL_DIR)/$(HOSTAP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	mv -f $(BUILD_DIR)/hostap $(HOSTAP_DIR)
	touch $(HOSTAP_DIR)/.unpacked

$(HOSTAP_DIR)/.configured: $(HOSTAP_DIR)/.unpacked
	#$(SED) "s,/.*#define PRISM2_DOWNLOAD_SUPPORT.*/,#define PRISM2_DOWNLOAD_SUPPORT,g" \
	# $(HOSTAP_DIR)/driver/modules/hostap_config.h
	touch $(HOSTAP_DIR)/.configured

$(HOSTAP_DIR)/utils/hostap_crypt_conf: $(HOSTAP_DIR)/.configured
	$(MAKE) -C $(HOSTAP_DIR)/utils CC=$(TARGET_CC) CFLAGS="-Os -Wall $(TARGET_CFLAGS) -I../driver/modules"
	$(MAKE) -C $(HOSTAP_DIR)/hostapd CC=$(TARGET_CC) CFLAGS="-Os -Wall $(TARGET_CFLAGS) -I../driver/modules -I../utils"
	touch -c $(HOSTAP_DIR)/driver/modules/hostap.o

$(TARGET_DIR)//usr/bin/hostap_crypt_conf: $(HOSTAP_DIR)/utils/hostap_crypt_conf
	# Make the dir
	-rm -rf $(HOSTAP_TARGET_MODULE_DIR)
	mkdir -p $(HOSTAP_TARGET_MODULE_DIR)
	# Copy the pcmcia-cs conf file
	mkdir -p $(TARGET_DIR)/etc/pcmcia
	cp -af $(HOSTAP_DIR)/driver/etc/hostap_cs.conf $(TARGET_DIR)/etc/pcmcia/
	# Copy The Utils
	cp -af $(HOSTAP_DIR)/utils/hostap_crypt_conf $(TARGET_DIR)/usr/bin/
	cp -af $(HOSTAP_DIR)/utils/hostap_diag $(TARGET_DIR)/usr/bin/
	cp -af $(HOSTAP_DIR)/utils/prism2_param $(TARGET_DIR)/usr/bin/
	cp -af $(HOSTAP_DIR)/utils/prism2_srec $(TARGET_DIR)/usr/bin/
	# Copy hostapd
	cp -af $(HOSTAP_DIR)/hostapd/hostapd $(TARGET_DIR)/usr/sbin/

hostap: pcmcia $(TARGET_DIR)//usr/bin/hostap_crypt_conf

hostap-clean:
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(HOSTAP_DIR) uninstall
	-$(MAKE) -C $(HOSTAP_DIR) clean

hostap-dirclean:
	rm -rf $(HOSTAP_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_HOSTAP)),y)
TARGETS+=hostap
endif