NETAPI makefile updates to sync with yocto recipes
authorTinku Mannan <tmannan@ti.com>
Tue, 29 Apr 2014 17:38:57 +0000 (13:38 -0400)
committerTinku Mannan <tmannan@ti.com>
Tue, 29 Apr 2014 18:00:37 +0000 (14:00 -0400)
ti/runtime/netapi/applications/ipsec_offload/config-app/build/Makefile
ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/build/Makefile
ti/runtime/netapi/build/Makefile
ti/runtime/netapi/makefile_armv7
ti/runtime/netapi/test/build/Makefile

index 6595543801fc6bd01635aea9c48bf7efc45fce83..486792962729e730205fbbdcac3feaa6c36b54f6 100755 (executable)
@@ -9,7 +9,7 @@ export ARMV7LIBDIR ?= ./lib
 
 NETAPI_SRC_DIR ?= $(TRANS_SDK_INSTALL_PATH)/ti/runtime/netapi
 
-CSL_DEVICE ?= -DDEVICE_K2H
+CSL_DEVICE ?= -DDEVICE_K2L
 
 
 ifdef CROSS_TOOL_INSTALL_PATH
@@ -21,7 +21,7 @@ ifdef CROSS_TOOL_INSTALL_PATH
 endif
 
 #QUIET_CMD=@
-EXE_NAME_PRFX=ipsecmgr_cmd_shell
+EXE_NAME_PRFX=ipsecmgr_cmd_shell_$(DEVICE)
 
 ###############################################################################
 # Set default options
@@ -91,11 +91,11 @@ $(BIN_DIR)/$(EXE_NAME): $(CONFIG_APP_OBJS) $(BIN_DIR)/.created
 
 install:
        install -d $(INSTALL_BIN_BASE_DIR)
-       install -c -m 755 $(BIN_DIR)/$(EXE_NAME) $(INSTALL_BIN_BASE_DIR)/$(EXE_NAME_PRFX)_$(DEVICE).out
+       install -c -m 755 $(BIN_DIR)/$(EXE_NAME) $(INSTALL_BIN_BASE_DIR)/$(EXE_NAME)
 
 clean:
        rm -rf $(OBJ_DIR)
-       rm -rf $(BIN_DIR)
+       rm -rf $(BIN_DIR)/$(EXE_NAME)
 
 
 
index d43d9c149592f2f97ea4bf09c9757d2ab185ee53..3dc7f108a07b5178848d6d1900652da4c3218eb8 100755 (executable)
@@ -7,6 +7,9 @@ export ARMV7BINDIR ?= ./bin
 export ARMV7LIBDIR ?= ./lib
 export ARMV7SALIBDIR ?= ./lib
 
+# DEVICE
+export DEVICE ?= k2l
+
 # INCLUDE Directories
 SA_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/sa
 QMSS_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/qmss
@@ -20,33 +23,34 @@ NETAPI_SRC_DIR ?= $(TRANS_SDK_INSTALL_PATH)/ti/runtime/netapi
 
 PDK_ARMV7LIBDIR ?= ARMV7LIBDIR
 
+QMSS_LIB=qmss
+CPPI_LIB=cppi
+HPLIB_LIB=hplib_$(DEVICE)
+NETAPI_LIB=netapi_$(DEVICE)
+NWAL_LIB ?= nwalsa_$(DEVICE)
+SA_LIB=sa
+PKTLIB_LIB=pktlib
+IPSECMGR_SNOOP_LIB=ipsecmgr_snoop
+IPSECMGR_IPC_LIB=ipsecmgr_ipc
+IPSECMGR_SYSLOG_LIB=ipsecmgr_syslog
 
 ifeq ($(DEVICE), k2h)
 CSL_DEVICE = -DDEVICE_K2H
-NWAL_LIB ?= nwalsa_$(DEVICE)
 PA_LIB   = pa
 endif
 ifeq  ($(DEVICE), k2k)
 CSL_DEVICE = -DDEVICE_K2K
-NWAL_LIB ?= nwalsa_$(DEVICE)
 PA_LIB   = pa
 endif
 ifeq ($(DEVICE), k2l)
 CSL_DEVICE = -DDEVICE_K2L -DNSS_GEN2
-NWAL_LIB ?= nwalsa_$(DEVICE)
 PA_LIB   = pa2
 endif
 ifeq ($(DEVICE), k2e)
 CSL_DEVICE = -DDEVICE_K2E -DNSS_GEN2
-NWAL_LIB ?= nwalsa_$(DEVICE)
 PA_LIB   = pa2
 endif
 
-#default if DEVICE not provided
-CSL_DEVICE ?= -DDEVICE_K2L
-NWAL_LIB ?= nwalsa_k2l)
-PA_LIB ?=-lpa2
-
 ifdef CROSS_TOOL_INSTALL_PATH
 ## Support backwards compatibility with KeyStone1 approach
  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
@@ -56,7 +60,7 @@ ifdef CROSS_TOOL_INSTALL_PATH
 endif
 
 #QUIET_CMD=@
-EXE_NAME_PRFX=ipsecmgr_daemon
+EXE_NAME_PRFX=ipsecmgr_daemon_$(DEVICE)
 
 ###############################################################################
 # Set default options
@@ -75,17 +79,6 @@ ROOT_DIR = ..
 IPSECMGR_UTIL_IFACE_DIR?= ../../../utils/iface
 IPSECMGR_IFACE_DIR?= ../
 
-
-QMSS_LIB=qmss
-CPPI_LIB=cppi
-HPLIB_LIB=hplib
-SA_LIB=sa
-PKTLIB_LIB=pktlib
-NETAPI_LIB=netapi
-IPSECMGR_SNOOP_LIB=ipsecmgr_snoop
-IPSECMGR_IPC_LIB=ipsecmgr_ipc
-IPSECMGR_SYSLOG_LIB=ipsecmgr_syslog
-
 LIBNL_LD_OPTS = -lnl-3 -lnl-xfrm -lnl-route-3
 
 LD_OPTS += -pthread -lrt
@@ -138,7 +131,7 @@ $(BIN_DIR)/$(EXE_NAME): $(DAEMON_OBJS) $(BIN_DIR)/.created
 
 install:
        install -d $(INSTALL_BIN_BASE_DIR)
-       install -c -m 755 $(BIN_DIR)/$(EXE_NAME) $(INSTALL_BIN_BASE_DIR)/$(EXE_NAME_PRFX)_$(DEVICE).out
+       install -c -m 755 $(BIN_DIR)/$(EXE_NAME) $(INSTALL_BIN_BASE_DIR)/$(EXE_NAME)
 clean:
        rm -rf $(OBJ_DIR)
-       rm -rf $(BIN_DIR)
+       rm -rf $(BIN_DIR)/$(EXE_NAME)
index 62f27ac3f6d23e6c397a4908005479cb5e23dd50..fe34011581fa458fd05400c39b3dbd659c84e2c3 100755 (executable)
@@ -76,7 +76,7 @@ CFLAGS+= $(DEBUG_FLAG) -I.  -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(NWAL_INSTALL_
 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
 all: lib
 
-lib: $(ARMV7LIBDIR)/libnetapi.a
+lib: $(ARMV7LIBDIR)/libnetapi_$(DEVICE).a
 
 
 # Make Rule for the COMMONSRC Files
@@ -94,13 +94,13 @@ $(COMMONSRCCOBJS_SO): $(ARMV7OBJDIR_SO)/%.$(OBJEXT): %.c
        @mkdir -p $(ARMV7OBJDIR_SO)
        $(CC) -c $(CFLAGS) -fPIC $(INCS)  $< -o $@
 
-$(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
+$(ARMV7LIBDIR)/libnetapi_$(DEVICE).a: $(COMMONSRCCOBJS)
        @mkdir -p $(ARMV7LIBDIR)
        @echo archiving $? into $@ ...
        @$(AR) -r $@ $?
 
 
-libnetapi.so: $(COMMONSRCCOBJS_SO)
+libnetapi_$(DEVICE).so: $(COMMONSRCCOBJS_SO)
        -@echo archiving $? into $(ARMV7LIBDIR)/$@.1 ...
        @$(CC) $(DEBUG_FLAG) -ggdb2 -Wl,-soname=$@.1 -shared -fPIC ${LDFLAGS} -o $@.1.0.0 $^
        @ln -s $@.1.0.0 $@.1
@@ -112,8 +112,8 @@ libnetapi.so: $(COMMONSRCCOBJS_SO)
 clean:
        rm -f $(ARMV7OBJDIR)/*.o
        rm -f $(ARMV7OBJDIR_SO)/*.o
-       rm -f $(ARMV7LIBDIR)/libnetapi.a
-       rm -f $(ARMV7LIBDIR)/libnetapi.so*
+       rm -f $(ARMV7LIBDIR)/libnetapi_$(DEVICE).a
+       rm -f $(ARMV7LIBDIR)/libnetapi_$(DEVICE).so*
 
 doxygen:
        rm -rf $(NETAPI_DOCS_DIR)/html
index 2d5e8fed9af7a02f63441388d706246d4f78940f..bb05dd3676b9d0c584a2f63af5097fe1f03ac196 100755 (executable)
@@ -64,14 +64,15 @@ all: .executables install installbin
 .executables: lib tests examples
 
 # Make rule to create $(ARMV7LIBDIR)/libnetapi.a library
-lib: $(ARMV7LIBDIR)/libnetapi.a libnetapi.so
-$(ARMV7LIBDIR)/libnetapi.a:
+lib: $(ARMV7LIBDIR)/libnetapi_$(DEVICE).a libnetapi_$(DEVICE).so
+
+$(ARMV7LIBDIR)/libnetapi_$(DEVICE).a:
        -@echo Building library...
        -@echo ARMV7OBJDIR = $(ARMV7OBJDIR)
        @$(MAKE) -f ./build/Makefile $@
 
 
-libnetapi.so:
+libnetapi_$(DEVICE).so:
        -@echo Building library...
        -@echo ARMV7OBJDIR = $(ARMV7OBJDIR_SO)
        @$(MAKE) -f ./build/Makefile $@
@@ -87,23 +88,23 @@ install:
        install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi
        install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/src
        install -d $(INSTALL_LIB_BASE_DIR)
-       $(CP) ./*.h                $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi
-       $(CP) -r ./device $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/
-       @$(CP) -r $(ARMV7LIBDIR)/libnetapi.a         $(INSTALL_LIB_BASE_DIR)
-       @$(CP) -rp $(ARMV7LIBDIR)/libnetapi.so*         $(INSTALL_LIB_BASE_DIR)
-       $(CP) src/*.h                $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/src
+       $(CP) ./*.h                                       $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi
+       $(CP) -r ./device                                 $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/
+       @$(CP) -r $(ARMV7LIBDIR)/libnetapi_$(DEVICE).a    $(INSTALL_LIB_BASE_DIR)
+       @$(CP) -rp $(ARMV7LIBDIR)/libnetapi_$(DEVICE).so* $(INSTALL_LIB_BASE_DIR)
+       $(CP) src/*.h                                     $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/src
 
 installbin:
        install -d $(INSTALL_BIN_BASE_DIR)
-       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_loopback $(INSTALL_BIN_BASE_DIR)/net_test_loopback_$(DEVICE)
-       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_router $(INSTALL_BIN_BASE_DIR)/net_test_router_$(DEVICE)
-       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_bench $(INSTALL_BIN_BASE_DIR)/net_test_bench_$(DEVICE)
+       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_loopback_$(DEVICE) $(INSTALL_BIN_BASE_DIR)/net_test_loopback_$(DEVICE)
+       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_router_$(DEVICE) $(INSTALL_BIN_BASE_DIR)/net_test_router_$(DEVICE)
+       install -c -m 755 $(ARMV7BINDIR)/netapi/test/net_test_bench_$(DEVICE) $(INSTALL_BIN_BASE_DIR)/net_test_bench_$(DEVICE)
        install -d $(SYSCONFDIR)/netapi
-       $(CP) test/net_test_config.txt                $(SYSCONFDIR)/netapi
+       $(CP) test/net_test_config.txt                        $(SYSCONFDIR)/netapi
        install -c -m 755 tools/net_test_loopback_setup.sh    $(SYSCONFDIR)/netapi
        install -c -m 755 tools/net_test_router_setup.sh      $(SYSCONFDIR)/netapi
-       install -c -m 755 tools/irqset.sh             $(SYSCONFDIR)/netapi
-       install -c -m 755 tools/dsp_core_setup.sh           $(SYSCONFDIR)/netapi
+       install -c -m 755 tools/irqset.sh                     $(SYSCONFDIR)/netapi
+       install -c -m 755 tools/dsp_core_setup.sh             $(SYSCONFDIR)/netapi
 # Make rule to create tests
 tests:
        -@echo compiling tests 
index 69b65c14af4f344806779ae2a01db98f5032a646..3b2d5e8bf571a83e47541e1d2416983b55c53e01 100755 (executable)
@@ -42,8 +42,9 @@ NT_BENCH_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_bench.o  $(ARMV7OBJDIR)/netap
 QMSS_LIB = -lqmss
 CPPI_LIB = -lcppi
 PKTLIB_LIB = -lpktlib
-NETAPI_LIB = -lnetapi
-HP_LIB = -lhplib
+HP_LIB = -lhplib_$(DEVICE)
+NETAPI_LIB = -lnetapi_$(DEVICE)
+NWAL_LIB = -lnwalsa_$(DEVICE)
 SA_LIB = -lsa
 #
 #with security enabled..
@@ -52,36 +53,34 @@ SA_LIB = -lsa
 ifeq ($(DEVICE), k2h)
 CSL_DEVICE = -DDEVICE_K2H
 PA_LIB   = -lpa
-NWAL_LIB = -lnwalsa_$(DEVICE)
 endif
 ifeq  ($(DEVICE), k2k)
 CSL_DEVICE = -DDEVICE_K2K
 PA_LIB   = -lpa
-NWAL_LIB = -lnwalsa_$(DEVICE)
 endif
 ifeq ($(DEVICE), k2l)
 CSL_DEVICE = -DDEVICE_K2L -DNSS_GEN2
 PA_LIB   = -lpa2
-NWAL_LIB = -lnwalsa_$(DEVICE)
 endif
 ifeq ($(DEVICE), k2e)
 CSL_DEVICE = -DDEVICE_K2E -DNSS_GEN2
 PA_LIB   = -lpa2
-NWAL_LIB = -lnwalsa_$(DEVICE)
 endif
 
 #default if DEVICE not provided
-CSL_DEVICE ?= -DDEVICE_K2L
-PA_LIB ?=-lpa2
+CSL_DEVICE ?= -DDEVICE_K2L -DNSS_GEN2
+PA_LIB ?= -lpa2
+NETAPI_LIB?=-lnetapi_k2l
 NWAL_LIB ?= -lnwalsa_k2l
+HP_LIB ?= -lhplib_k2l
 
 ifeq ($(USEDYNAMIC_LIB), yes)
 #presuming ARM executable would depend on dynamic library dependency
 EXE_EXTN = _so
-LIBS     = $(NETAPI_LIB) $(QMSS_LIB) $(CPPI_LIB) $(PA_LIB) $(PKTLIB_LIB) $(NETAPI_LIB) $(HP_LIB) $(SA_LIB) $(NWAL_LIB)
+LIBS     = $(QMSS_LIB) $(CPPI_LIB) $(PA_LIB) $(PKTLIB_LIB) $(NETAPI_LIB) $(HP_LIB) $(SA_LIB) $(NWAL_LIB)
 else
 #forcing ARM executable to depend on static LLD libraries
-LIBS = -static $(NETAPI_LIB) $(QMSS_LIB) $(CPPI_LIB) $(PA_LIB) $(PKTLIB_LIB) $(NETAPI_LIB) $(HP_LIB) $(SA_LIB) $(NWAL_LIB) -Wl,-Bdynamic
+LIBS = -static $(QMSS_LIB) $(CPPI_LIB) $(PA_LIB) $(PKTLIB_LIB) $(NETAPI_LIB) $(HP_LIB) $(SA_LIB) $(NWAL_LIB) -Wl,-Bdynamic
 EXE_EXTN =
 endif
 
@@ -101,16 +100,10 @@ INTERNALLINKDEFS = -Wl,--start-group $(LIBS) -Wl,--end-group -lrt -pthread  -L$(
 
 all: tests 
 
-tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test_loopback $(ARMV7BINDIR)/netapi/test/net_test_router $(ARMV7BINDIR)/netapi/test/net_test_bench
-
-
-api_clean:
-       rm -f  $(ARMV7LIBDIR)/libnetapi.a
-       rm -rf $(ARMV7OBJDIR)/netapi/lib/*.o
+tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test_loopback_$(DEVICE) $(ARMV7BINDIR)/netapi/test/net_test_router_$(DEVICE) $(ARMV7BINDIR)/netapi/test/net_test_bench_$(DEVICE)
 
 clean: 
        rm -f $(ARMV7OBJDIR)/netapi/test/*.o
-       rm -f $(ARMV7LIBDIR)/libnetapi.a
        rm -f $(ARMV7BINDIR)/netapi/test/*
 
 $(ARMV7OBJDIR)/netapi/test/%.o: $(NETAPI_SRC_DIR)/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
@@ -123,19 +116,19 @@ $(ARMV7OBJDIR)/netapi/test/.created:
 $(ARMV7BINDIR)/netapi/test/.created:
        @mkdir -p $(ARMV7BINDIR)/netapi/test/
 
-$(ARMV7BINDIR)/netapi/test/net_test_loopback:  $(NT_OBJS) $(TRIE_OBJS)
-       $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_loopback$(EXE_EXTN)
+$(ARMV7BINDIR)/netapi/test/net_test_loopback_$(DEVICE):  $(NT_OBJS) $(TRIE_OBJS)
+       $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_loopback_$(DEVICE)$(EXE_EXTN)
 
 $(ARMV7BINDIR)/netapi/test/net_test_max_params:  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS)
        $(CC) $(LDFLAGS)  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_max_params$(EXE_EXTN)
-$(ARMV7BINDIR)/netapi/test/net_test_router:  $(NT_ROUTER_OBJS) $(TRIE_OBJS)
-       $(CC) $(LDFLAGS)  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_router$(EXE_EXTN)
+$(ARMV7BINDIR)/netapi/test/net_test_router_$(DEVICE):  $(NT_ROUTER_OBJS) $(TRIE_OBJS)
+       $(CC) $(LDFLAGS)  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_router_$(DEVICE)$(EXE_EXTN)
 
-$(ARMV7BINDIR)/netapi/test/nt_bridge:  $(NTB_OBJS) $(TRIE_OBJS)
-       $(CC) $(LDFLAGS)  $(NTB_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/nt_bridge$(EXE_EXTN)
+$(ARMV7BINDIR)/netapi/test/nt_bridge_$(DEVICE):  $(NTB_OBJS) $(TRIE_OBJS)
+       $(CC) $(LDFLAGS)  $(NTB_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/nt_bridge_$(DEVICE)$(EXE_EXTN)
 
 $(ARMV7BINDIR)/netapi/test/ifdma_test:  $(IFDMA_OBJS)
        $(CC) $(LDFLAGS)  $(IFDMA_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/ifdma_test$(EXE_EXTN)
 
-$(ARMV7BINDIR)/netapi/test/net_test_bench:  $(NT_BENCH_OBJS)
-       $(CC) $(LDFLAGS)  $(NT_BENCH_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_bench$(EXE_EXTN)
+$(ARMV7BINDIR)/netapi/test/net_test_bench_$(DEVICE):  $(NT_BENCH_OBJS)
+       $(CC) $(LDFLAGS)  $(NT_BENCH_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_bench_$(DEVICE)$(EXE_EXTN)