65cbaacd68e6db8ff7ca8589589fc56642f578bb
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / build / Makefile
1 #
2 empty =
3 space =$(empty) $(empty)
5 export ARMV7OBJDIR ?= ./obj
6 export ARMV7BINDIR ?= ./bin
7 export ARMV7LIBDIR ?= ./lib
8 export ARMV7SALIBDIR ?= ./lib
9 export ARMV7LIBDIRLOCAL ?= ../../lib
10 # INCLUDE Directories
11 WORKDIR ?= $(TRANS_SDK_INSTALL_PATH)
12 SA_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/sa
13 QMSS_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/qmss
14 CPPI_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/cppi
15 HPLIB_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/runtime/hplib
16 NETAPI_INC_DIR ?= $(WORKDIR)
17 NWAL_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/nwal
18 PKTLIB_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/runtime/pktlib
21 #NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
22 #HPLIB_INC_DIR = $()/ti/runtime/hplib
24 #NETAPI LIB Build directory
25 NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/ti/runtime/netapi/build
26 #NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/build
29 # Set NETAPI INSTALL PATH to Transport SDK for default
30 #export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
32 CSL_DEVICE ?= -DDEVICE_K2H
34 ifeq ($(CPU),  cortex-a8)
35         CFLAGS += -DCORTEX_A8
36 endif
38 TRIE_OBJS=$(ARMV7OBJDIR)/netapi/test/trie.o
39 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
40 #
41 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
42 #
43 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
44 #
45 #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
47 IFDMA_OBJS= $(ARMV7OBJDIR)/netapi/test/ifdma_test.o
49 NTB_OBJS= $(ARMV7OBJDIR)/netapi/test/nt_bridge.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
52 # Support Libraries used by NETAPI 
53 QMSS_LIB = -lqmss
54 CPPI_LIB = -lcppi
55 PA_LIB   = -lpa
56 #without security enabled
57 #NWAL_LIB = -lnwal
58 PKTLIB_LIB = -lpktlib
59 NETAPI_LIB = -lnetapi
60 HP_LIB = -lhplib
61 SA_LIB = -lsa
62 #
63 #with security enabled..
64 NWAL_LIB = -lnwalsa
65 #SA_LIB=$(SA_INSTALL_PATH)/ti/drv/sa/lib/salld_c.av7A
66 #AES_LIB=$(SA_INSTALL_PATH)/ti/mas/aes/gcarmv7a/aes_c.av7A
67 #SHA1_LIB=$(SA_INSTALL_PATH)/ti/mas/sha1/gcarmv7a/sha1_c.av7A
68 #PKTUTL_LIB=$(SA_INSTALL_PATH)/ti/mas/pktutl/gcarmv7a/pktutl_c.av7A
70 ifdef CROSS_TOOL_INSTALL_PATH
71 ## Support backwards compatibility with KeyStone1 approach
72  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
73  AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
74  AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
75  LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
76 endif
78 #Cross tools
79 #CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
80 #AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
82 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
83 # Linker options
84 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)
87 all: tests 
89 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
92 api_clean:
93         rm -f  $(ARMV7LIBDIR)/libnetapi.a
94         rm -rf $(ARMV7OBJDIR)/netapi/lib/*.o
96 clean:  
97         rm -f $(ARMV7OBJDIR)/netapi/test/*.o
98         rm -f $(ARMV7LIBDIR)/libnetapi.a
99         rm -f $(ARMV7BINDIR)/netapi/test/net_test 
100         rm -f $(ARMV7BINDIR)/netapi/test/net_test_router 
101         rm -f $(ARMV7BINDIR)/netapi/test/net_test_max_params
102         rm -f $(ARMV7BINDIR)/netapi/test/ifdma_test
105 $(ARMV7OBJDIR)/netapi/test/%.o: $(NETAPI_INC_DIR)/ti/runtime/netapi/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
106         @echo netapi inc dir = $(NETAPI_INC_DIR)
107         @echo compiling $< ..............
108         @echo workdir = $(WORKDIR)
109         $(CC) -c  $(CFLAGS)  $<  -o $@
111 $(ARMV7OBJDIR)/netapi/test/.created:
112         @mkdir -p $(ARMV7OBJDIR)/netapi/test/
114 $(ARMV7BINDIR)/netapi/test/.created:
115         @mkdir -p $(ARMV7BINDIR)/netapi/test/
119 $(ARMV7BINDIR)/netapi/test/net_test:  $(NT_OBJS) $(TRIE_OBJS)
120         $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test
122 $(ARMV7BINDIR)/netapi/test/net_test_max_params:  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
123         $(CC) $(LDFLAGS)  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_max_params
124 $(ARMV7BINDIR)/netapi/test/net_test_router:  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
125         $(CC) $(LDFLAGS)  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_router
127 $(ARMV7BINDIR)/netapi/test/nt_bridge:  $(NTB_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
128         $(CC) $(LDFLAGS)  $(NTB_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/nt_bridge
130 $(ARMV7BINDIR)/netapi/test/ifdma_test:  $(IFDMA_OBJS) $(ARMV7LIBDIR)/libnetapi.a
131         $(CC) $(LDFLAGS)  $(IFDMA_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/ifdma_test