]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/blobdiff - ti/runtime/netapi/test/build/Makefile
Makefile cleanup: removed dependency on CORTEX_A15 compile file flag, updated sources...
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / build / Makefile
index b4550ceba91eecb37dab5357d38cfac1be3fc204..65cbaacd68e6db8ff7ca8589589fc56642f578bb 100755 (executable)
@@ -1,24 +1,53 @@
+#
+empty =
+space =$(empty) $(empty)
+
 export ARMV7OBJDIR ?= ./obj
 export ARMV7BINDIR ?= ./bin
 export ARMV7LIBDIR ?= ./lib
+export ARMV7SALIBDIR ?= ./lib
+export ARMV7LIBDIRLOCAL ?= ../../lib
+# INCLUDE Directories
+WORKDIR ?= $(TRANS_SDK_INSTALL_PATH)
+SA_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/sa
+QMSS_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/qmss
+CPPI_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/cppi
+HPLIB_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/runtime/hplib
+NETAPI_INC_DIR ?= $(WORKDIR)
+NWAL_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/nwal
+PKTLIB_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/runtime/pktlib
+
+
+#NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
+#HPLIB_INC_DIR = $()/ti/runtime/hplib
+
+#NETAPI LIB Build directory
+NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/ti/runtime/netapi/build
+#NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/build
+
 
 # Set NETAPI INSTALL PATH to Transport SDK for default
-export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
+#export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
+
+CSL_DEVICE ?= -DDEVICE_K2H
+
+ifeq ($(CPU),  cortex-a8)
+        CFLAGS += -DCORTEX_A8
+endif
 
 TRIE_OBJS=$(ARMV7OBJDIR)/netapi/test/trie.o
-NT_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
-NTB_OBJS= $(ARMV7OBJDIR)/netapi/test/nt_bridge.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
+NT_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test.o  $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
+#
+NT_ROUTER_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_router.o  $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
+#
+NT_MAX_PARAMS_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_max_params.o  $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
+#
+#IFDMA_OBJS= $(ARMV7OBJDIR)/netapi/test/ifdma_test.o  $(ARMV7OBJDIR)/netapi/test/stubs.o $(ARMV7OBJDIR)/netapi/test/net_test_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_sa_utils.o $(ARMV7OBJDIR)/netapi/test/net_test_thread_utils.o
 
-# INCLUDE Directories
-QMSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss
-CPPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi
+IFDMA_OBJS= $(ARMV7OBJDIR)/netapi/test/ifdma_test.o
 
-NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
-HPLIB_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/highperf-lib
-SA_INC_DIR = $(SA_INSTALL_PATH)
+NTB_OBJS= $(ARMV7OBJDIR)/netapi/test/nt_bridge.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
 
-#NETAPI LIB Build directory
-NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/build
 
 # Support Libraries used by NETAPI 
 QMSS_LIB = -lqmss
@@ -29,27 +58,36 @@ PA_LIB   = -lpa
 PKTLIB_LIB = -lpktlib
 NETAPI_LIB = -lnetapi
 HP_LIB = -lhplib
+SA_LIB = -lsa
 #
 #with security enabled..
 NWAL_LIB = -lnwalsa
-SA_LIB=$(SA_INSTALL_PATH)/ti/drv/sa/lib/salld_c.av7A
-AES_LIB=$(SA_INSTALL_PATH)/ti/mas/aes/gcarmv7a/aes_c.av7A
-SHA1_LIB=$(SA_INSTALL_PATH)/ti/mas/sha1/gcarmv7a/sha1_c.av7A
-PKTUTL_LIB=$(SA_INSTALL_PATH)/ti/mas/pktutl/gcarmv7a/pktutl_c.av7A
-
+#SA_LIB=$(SA_INSTALL_PATH)/ti/drv/sa/lib/salld_c.av7A
+#AES_LIB=$(SA_INSTALL_PATH)/ti/mas/aes/gcarmv7a/aes_c.av7A
+#SHA1_LIB=$(SA_INSTALL_PATH)/ti/mas/sha1/gcarmv7a/sha1_c.av7A
+#PKTUTL_LIB=$(SA_INSTALL_PATH)/ti/mas/pktutl/gcarmv7a/pktutl_c.av7A
+
+ifdef CROSS_TOOL_INSTALL_PATH
+## Support backwards compatibility with KeyStone1 approach
+ CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+ AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
+ AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
+ LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
+endif
 
 #Cross tools
-CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
-AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
+#CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
+#AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
 
-CFLAGS= $(DEBUG_FLAG) -I../ -I. -I$(NETAPI_INC_DIR) -I$(NETAPI_INC_DIR)/src -I$(HPLIB_INC_DIR) -I$(PDK_INSTALL_PATH)  -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(HPLIB_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR) -I$(SA_INC_DIR) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
+CFLAGS+= $(DEBUG_FLAG) -I../ -I. -I$(NETAPI_INC_DIR) -I$(NETAPI_INC_DIR)/src -I$(HPLIB_INC_DIR) -I$(PDK_INSTALL_PATH)  -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(SA_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR) -I$(SA_INC_DIR) $(CSL_DEVICE) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DNWAL_ENABLE_SA -DMAKEFILE_BUILD -D _GNU_SOURCE
 # Linker options
-INTERNALLINKDEFS = --start-group -L$(ARMV7LIBDIR) -L$(PDK_ARMV7LIBDIR) $(NETAPI_LIB) $(PKTLIB_LIB) $(HP_LIB) $(QMSS_LIB) $(CPPI_LIB) $(NWAL_LIB) $(PA_LIB) $(SA_LIB) $(AES_LIB) $(SHA1_LIB) $(PKTUTL_LIB) -lrt --end-group
+INTERNALLINKDEFS = -Wl,--start-group $(NETAPI_LIB) $(PKTLIB_LIB) $(HP_LIB) $(QMSS_LIB) $(CPPI_LIB) $(NWAL_LIB) $(PA_LIB) $(SA_LIB) -Wl,--end-group -lrt -pthread  -L$(ARMV7LIBDIR)  -L$(ARMV7LIBDIRLOCAL) -L$(ARMV7SALIBDIR)
 
 
 all: tests 
 
-tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test
+tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test $(ARMV7BINDIR)/netapi/test/net_test_router $(ARMV7BINDIR)/netapi/test/net_test_max_params $(ARMV7BINDIR)/netapi/test/ifdma_test
+
 
 api_clean:
        rm -f  $(ARMV7LIBDIR)/libnetapi.a
@@ -58,12 +96,17 @@ api_clean:
 clean: 
        rm -f $(ARMV7OBJDIR)/netapi/test/*.o
        rm -f $(ARMV7LIBDIR)/libnetapi.a
-       rm -f $(ARMV7BINDIR)/netapi/test/net_test $(ARMV7BINDIR)/netapi/test/synchtest $(ARMV7BINDIR)/netapi/test/synchtest2
+       rm -f $(ARMV7BINDIR)/netapi/test/net_test 
+       rm -f $(ARMV7BINDIR)/netapi/test/net_test_router 
+       rm -f $(ARMV7BINDIR)/netapi/test/net_test_max_params
+       rm -f $(ARMV7BINDIR)/netapi/test/ifdma_test
 
 
-$(ARMV7OBJDIR)/netapi/test/%.o:$(NETAPI_INC_DIR)/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
-       @echo compiling $< ...
-       $(CC)  -c  $(CFLAGS)  $<  -o $@
+$(ARMV7OBJDIR)/netapi/test/%.o: $(NETAPI_INC_DIR)/ti/runtime/netapi/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
+       @echo netapi inc dir = $(NETAPI_INC_DIR)
+       @echo compiling $< ..............
+       @echo workdir = $(WORKDIR)
+       $(CC) -c  $(CFLAGS)  $<  -o $@
 
 $(ARMV7OBJDIR)/netapi/test/.created:
        @mkdir -p $(ARMV7OBJDIR)/netapi/test/
@@ -71,13 +114,19 @@ $(ARMV7OBJDIR)/netapi/test/.created:
 $(ARMV7BINDIR)/netapi/test/.created:
        @mkdir -p $(ARMV7BINDIR)/netapi/test/
 
-$(ARMV7LIBDIR)/libnetapi.a:
-       make -C $(NETAPI_BUILD_DIR) 
 
-$(ARMV7BINDIR)/netapi/test/net_test:  $(NT_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
+
+$(ARMV7BINDIR)/netapi/test/net_test:  $(NT_OBJS) $(TRIE_OBJS)
        $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test
 
+$(ARMV7BINDIR)/netapi/test/net_test_max_params:  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
+       $(CC) $(LDFLAGS)  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_max_params
+$(ARMV7BINDIR)/netapi/test/net_test_router:  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
+       $(CC) $(LDFLAGS)  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_router
+
 $(ARMV7BINDIR)/netapi/test/nt_bridge:  $(NTB_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
        $(CC) $(LDFLAGS)  $(NTB_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/nt_bridge
 
+$(ARMV7BINDIR)/netapi/test/ifdma_test:  $(IFDMA_OBJS) $(ARMV7LIBDIR)/libnetapi.a
+       $(CC) $(LDFLAGS)  $(IFDMA_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/ifdma_test