1#
2# Copyright (C) 2013, Broadcom Corporation
3# All Rights Reserved.
4# 
5# This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6# the contents of this file may not be disclosed to third parties, copied
7# or duplicated in any form, in whole or in part, without the prior
8# written permission of Broadcom Corporation.
9#
10# $Id: wps_ap_lib.mk 383066 2013-02-05 10:22:22Z $
11# 
12# Linux makefile
13#
14
15WLAN_ComponentsInUse := bcmwifi
16-include $(SRCBASE)/makefiles/WLAN_Common.mk
17
18BLDTYPE = release
19#BLDTYPE = debug
20
21ifeq ("$(CROSS_COMPILE)","mipsel-uclibc-")
22CC_TYPE=uclibc
23else
24CC_TYPE=linux
25endif
26
27ifeq ($(BLDTYPE),debug)
28export CFLAGS = -Wall -Wnested-externs -g -D_TUDEBUGTRACE
29export CXXFLAGS = -Wall -Wnested-externs -g -D_TUDEBUGTRACE
30else
31export CFLAGS = -Os -Wall -Wnested-externs
32export CXXFLAGS = -Os -Wall -Wnested-externs
33endif
34
35
36export CC = mipsel-$(CC_TYPE)-gcc
37export LD = mipsel-$(CC_TYPE)-gcc
38export LDFLAGS = -r
39
40BRCMBASE = ../..
41UPNPBASE = $(SRCBASE)/router/bcmupnp
42
43export INCLUDE = -I$(TOOLCHAINS)/include -I$(SRCBASE)/include -I$(SRCBASE)/common/include\
44	-I$(SRCBASE)/router/shared -I$(BRCMBASE)/include -I./include \
45	-I$(UPNPBASE)/include -I$(UPNPBASE)/upnp/linux -I$(UPNPBASE)/device/InternetGatewayDevice -I$(UPNPBASE)/device -I$(UPNPBASE)/device/WFADevice \
46	-I$(SRCBASE)/router/libbcm -I$(SRCBASE)/router/eapd${BCMEX} $(WLAN_ComponentIncPathR)
47
48# Include external openssl path
49ifeq ($(EXTERNAL_OPENSSL),1)
50export INCLUDE += -DEXTERNAL_OPENSSL -I$(EXTERNAL_OPENSSL_INC) -I$(EXTERNAL_OPENSSL_INC)/openssl
51else
52export INCLUDE += -I$(SRCBASE)/include/bcmcrypto
53endif
54
55LIBDIR = .
56
57OBJS =  $(addprefix $(LIBDIR)/, ap/ap_api.o \
58	ap/ap_ssr.o \
59	ap/ap_eap_sm.o \
60	ap/ap_upnp_sm.o \
61	registrar/reg_sm.o )
62
63#Be aware share library may has "-m32" issue.
64ifeq ($(CC), gcc)
65default: $(LIBDIR)/libwpsap.a
66else
67default: $(LIBDIR)/libwpsap.a $(LIBDIR)/libwpsap.so
68endif
69
70$(LIBDIR)/libwpsap.a: $(OBJS)
71	$(AR) cr  $@ $^  
72
73$(LIBDIR)/libwpsap.so: $(OBJS)
74	$(LD) -shared -o $@ $^
75	
76$(LIBDIR)/shared/%.o :  shared/%.c
77	$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
78
79$(LIBDIR)/ap/%.o :  ap/%.c
80	$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
81
82$(LIBDIR)/enrollee/%.o :  enrollee/%.c
83	$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
84
85$(LIBDIR)/registrar/%.o :  registrar/%.c
86	$(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
87