1#
2# Broadcom Linux Router WPS generic Makefile
3# 
4# Copyright (C) 2013, Broadcom Corporation
5# All Rights Reserved.
6# 
7# This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
8# the contents of this file may not be disclosed to third parties, copied
9# or duplicated in any form, in whole or in part, without the prior
10# written permission of Broadcom Corporation.
11# $Id: $
12#
13
14# Include wps common make file
15include	$(WPSSRC)/common/config/$(WPS_CONF_FILE)
16ifneq ($(CONFIG_WFI),y)
17WPS_WFI = 0
18endif
19ifneq ($(CONFIG_LIBUPNP),y)
20WPS_UPNP_DEVICE = 0
21endif
22include $(WPSSRC)/common/config/wps.mk
23EXTRA_CFLAGS = ${WPS_INCS} ${WPS_FLAGS} ${WLAN_ComponentIncPath}
24
25
26WPS_SOURCE := $(WPS_FILES)
27
28vpath %.c $(SRCBASE)/../
29
30WPS_OBJS := $(foreach file, $(WPS_SOURCE), \
31	  $(patsubst src/%.c, obj/%.o,$(file)))
32
33WPS_DIRS   := $(foreach file, $(WPS_OBJS), \
34	$(dir $(file)))
35
36WPS_DIRLIST = $(sort $(WPS_DIRS)) 
37
38
39all: dirs $(LIB)
40
41dirs:
42	mkdir -p $(WPS_DIRLIST)
43	@echo "==> $(WPS_CONF_FILE)"
44
45libobjs: dirs
46	+$(MAKE) parallel=true $(WPS_OBJS)
47
48# library rules
49$(LIB) : libobjs
50	$(AR) cr $@ $(WPS_OBJS)
51
52$(WPS_OBJS) : obj%.o: $(addprefix $(SRCBASE)/../,src%.c)
53	$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
54
55clean:
56	rm -rf obj
57