[qca-nss-clients] Only compile selected packages

The original Makefile builds all packages even if they are not selected. This
makes package dependency hard to maintain. For example some profile does not
select qca-nss-crypto that causes dtls and ipsec package to fail compilation.

With this change, only selected package will be compiled.

Change-Id: Ie7d04d284e4c948e8d1d61497e2f9949ed3be613
Signed-off-by: Stephen Wang <wstephen@codeaurora.org>
diff --git a/Makefile b/Makefile
index fcbea2b..8bb54b1 100644
--- a/Makefile
+++ b/Makefile
@@ -5,76 +5,32 @@
 export BUILD_ID = \"Build Id: $(shell date +'%m/%d/%y, %H:%M:%S')\"
 ccflags-y += -DNSS_CLIENT_BUILD_ID="$(BUILD_ID)"
 
-obj-y+= profiler/
-obj-y+= nss_qdisc/
-
-ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
-obj-y+= nss_ppe_qdisc/
-endif
-
-# DTLS manager
-ifneq ($(SoC), ipq807x)
-obj-y+=dtls/
-endif
-
-# CAPWAP Manager
-ifneq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
-obj-y+= capwapmgr/
-endif
-
-# Port interface Manager
-ifneq ($(findstring 3.4, $(KERNELVERSION)),)
-obj-y+= portifmgr/
-endif
-
-#IPv6
-
-#Tun6RD
-ifeq "$(CONFIG_IPV6_SIT_6RD)" "y"
-obj-m += qca-nss-tun6rd.o
-qca-nss-tun6rd-objs := nss_connmgr_tun6rd.o
-ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
-endif
-
-obj-m += qca-nss-tunipip6.o
 qca-nss-tunipip6-objs := nss_connmgr_tunipip6.o
+qca-nss-tun6rd-objs := nss_connmgr_tun6rd.o
+
+ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
 ccflags-y += -DNSS_TUNIPIP6_DEBUG_LEVEL=0
 
+obj-$(bridge-mgr)+= bridge/
+obj-$(capwapmgr)+= capwapmgr/
+obj-$(dtlsmgr)+= dtls/
+obj-$(gre)+= gre/
+obj-$(ipsecmgr)+= ipsecmgr/
+obj-$(l2tpv2)+= l2tp/l2tpv2/
+obj-$(lag-mgr)+= lag/
+obj-$(map-t)+= map/map-t/
+obj-$(portifmgr)+= portifmgr/
+obj-$(ppe_qdisc)+= nss_ppe_qdisc/
+obj-$(pptp)+= pptp/
+obj-$(profile)+= profiler/
+obj-$(tunipip6)+= qca-nss-tunipip6.o
+obj-$(tun6rd)+= qca-nss-tun6rd.o
+obj-$(qdisc)+= nss_qdisc/
+obj-$(vlan-mgr)+= vlan/
+
 #NSS NETLINK
 ifneq ($(findstring 3.4, $(KERNELVERSION)),)
 obj-y+= netlink/
 endif
 
-# L2TPv2 manager
-obj-y+=l2tp/l2tpv2/
-
-#NSS PPTP
-obj-y+= pptp/
-
-#IPsecmgr
-ifneq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
-obj-y+= ipsecmgr/
-endif
-
-#LAG Manager
-obj-y+= lag/
-
-# MAP-T manager
-ifeq ($(findstring 3.4, $(KERNELVERSION)),)
-obj-y+=map/map-t/
-endif
-
-# GRE manager
-ifeq ($(findstring 3.14, $(KERNELVERSION)), 3.14)
-obj-y+=gre/
-endif
-
-# Bridge manager
-ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
-obj-y += bridge/
-endif
-
-# Vlan manager
-obj-y += vlan/
-
 obj ?= .