summaryrefslogtreecommitdiff
path: root/cleopatre/buildroot/package/p1905_managerd/p1905_managerd.mk
blob: 4a2d782cfff434fc80bac6feb43c217ac2e8e1e5 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#############################################################
#
# p1905_managerd (provides IEEE P1905.1 functionality)
# 
#
#############################################################
# Copyright (C) 2013 MStar Semiconductor, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
#

P1905_MANAGERD_DEV_SITE:=$(BASE_DIR)/../devkit/p1905_managerd
IS_P1905_MANAGERD_DEV:=$(wildcard $(P1905_MANAGERD_DEV_SITE))

P1905_MANAGERD_VERSION:=0.0.1
P1905_MANAGERD_NAME:=p1905_managerd-$(P1905_MANAGERD_VERSION)
P1905_MANAGERD_DIR:=$(BUILD_DIR)/p1905_managerd-$(P1905_MANAGERD_VERSION)

P1905_MANAGERD_LIBSPID_SITE:=$(BASE_DIR)/../application/libspid
P1905_MANAGERD_LIBMME_SITE:=$(BASE_DIR)/../application/libmme
P1905_MANAGERD_LIBALME_SITE:=$(BASE_DIR)/../application/libalme

ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_NO_WIFI)),y)
P1905_MANAGERD_CONFIG_TYPE:=
endif
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_AP_ENROLLEE)),y)
P1905_MANAGERD_CONFIG_TYPE:=-wifi_support -wifi_role=enrollee -wifi_chip=mt7601
endif
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_AP_REGISTRAR)),y)
P1905_MANAGERD_CONFIG_TYPE:=-wifi_support -wifi_role=registrar -wifi_chip=mt7601
endif

ifneq ($(IS_P1905_MANAGERD_DEV),)
    P1905_MANAGERD_SITE:=$(P1905_MANAGERD_DEV_SITE)
    P1905_MANAGERD_CONFIG:=cd $(P1905_MANAGERD_DIR);$(P1905_MANAGERD_DIR)/p1905-config $(P1905_MANAGERD_CONFIG_TYPE)
    P1905_MANAGERD_MAKE:=$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(P1905_MANAGERD_DIR) p1905_managerd
    P1905_MANAGERD_DEV_CLEAN:=p1905_managerd-dev-clean
    P1905_MANAGERD_BIN:=p1905_managerd
else
    P1905_MANAGERD_SITE:=$(BASE_DIR)/../p1905_managerd
    P1905_MANAGERD_CONFIG:=
    P1905_MANAGERD_MAKE:=
    P1905_MANAGERD_DEV_CLEAN:=
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_NO_WIFI)),y)
    P1905_MANAGERD_BIN:=p1905_managerd-no_wifi
endif
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_AP_ENROLLEE)),y)
    P1905_MANAGERD_BIN:=p1905_managerd-ap_enrollee
endif
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD_AP_REGISTRAR)),y)
    P1905_MANAGERD_BIN:=p1905_managerd-ap_registrar
endif
endif

p1905_managerd-dev-clean:
	-$(MAKE) -C $(P1905_MANAGERD_DIR) clean

p1905_managerd-source:

$(P1905_MANAGERD_DIR)/.unpacked:
	ln -s $(P1905_MANAGERD_SITE) $(P1905_MANAGERD_DIR)
	touch $(P1905_MANAGERD_DIR)/.unpacked

$(P1905_MANAGERD_DIR)/.configured: $(P1905_MANAGERD_DIR)/.unpacked
	touch $(P1905_MANAGERD_DIR)/.configured

$(P1905_MANAGERD_DIR)/$(P1905_MANAGERD_BIN): $(P1905_MANAGERD_LIBSPID_SITE)/libspid.so \
  $(P1905_MANAGERD_LIBMME_SITE)/libmme.so \
  $(P1905_MANAGERD_LIBALME_SITE)/libalme.so \
  $(P1905_MANAGERD_DIR)/.configured \
	FORCE_P1905_MANAGERD_MAKE
	$(P1905_MANAGERD_CONFIG)
	$(P1905_MANAGERD_MAKE)

$(TARGET_DIR)/usr/sbin/p1905_managerd: $(P1905_MANAGERD_DIR)/$(P1905_MANAGERD_BIN)
	cp $< $@
	cp $(P1905_MANAGERD_DIR)/S98p1905 $(TARGET_DIR)/etc/init.d/S98p1905

p1905_managerd: uclibc $(TARGET_DIR)/usr/sbin/p1905_managerd

p1905_managerd-clean: $(P1905_MANAGERD_DEV_CLEAN)
	rm -f $(TARGET_DIR)/usr/sbin/p1905_managerd

p1905_managerd-dirclean:
	rm -f $(P1905_MANAGERD_DIR)

.PHONY: FORCE_P1905_MANAGERD_MAKE

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_P1905_MANAGERD)),y)
TARGETS+=p1905_managerd
endif