Adding net_test_bench application, scripts to set irq smp affinity, setup scripts...
[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
22 #NETAPI LIB Build directory
23 NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/ti/runtime/netapi/build
26 # Set NETAPI INSTALL PATH to Transport SDK for default
28 CSL_DEVICE ?= -DDEVICE_K2H
30 ifeq ($(CPU),  cortex-a8)
31         CFLAGS += -DCORTEX_A8
32 endif
34 TRIE_OBJS=$(ARMV7OBJDIR)/netapi/test/trie.o
35 NT_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_loopback.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
36 #
37 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
38 #
39 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
40 #
42 IFDMA_OBJS= $(ARMV7OBJDIR)/netapi/test/ifdma_test.o
44 NTB_OBJS= $(ARMV7OBJDIR)/netapi/test/nt_bridge.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
46 NT_BENCH_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test_bench.o  $(ARMV7OBJDIR)/netapi/test/stubs.o
48 # Support Libraries used by NETAPI 
49 QMSS_LIB = -lqmss
50 CPPI_LIB = -lcppi
51 PA_LIB   = -lpa
52 #without security enabled
53 #NWAL_LIB = -lnwal
54 PKTLIB_LIB = -lpktlib
55 NETAPI_LIB = -lnetapi
56 HP_LIB = -lhplib
57 SA_LIB = -lsa
58 #
59 #with security enabled..
60 NWAL_LIB = -lnwalsa
62 ifdef CROSS_TOOL_INSTALL_PATH
63 ## Support backwards compatibility with KeyStone1 approach
64  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
65  AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
66  AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
67  LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
68 endif
70 #Cross tools
71 #CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
72 #AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
74 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
75 # Linker options
76 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)
79 all: tests 
81 tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test_loopback $(ARMV7BINDIR)/netapi/test/net_test_router $(ARMV7BINDIR)/netapi/test/net_test_max_params $(ARMV7BINDIR)/netapi/test/ifdma_test  $(ARMV7BINDIR)/netapi/test/net_test_bench
84 api_clean:
85         rm -f  $(ARMV7LIBDIR)/libnetapi.a
86         rm -rf $(ARMV7OBJDIR)/netapi/lib/*.o
88 clean:  
89         rm -f $(ARMV7OBJDIR)/netapi/test/*.o
90         rm -f $(ARMV7LIBDIR)/libnetapi.a
91         rm -f $(ARMV7BINDIR)/netapi/test/net_test_loopback
92         rm -f $(ARMV7BINDIR)/netapi/test/net_test_router 
93         rm -f $(ARMV7BINDIR)/netapi/test/net_test_max_params
94         rm -f $(ARMV7BINDIR)/netapi/test/ifdma_test
95         rm -f $(ARMV7BINDIR)/netapi/test/net_test_bench
98 $(ARMV7OBJDIR)/netapi/test/%.o: $(NETAPI_INC_DIR)/ti/runtime/netapi/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
99         @echo compiling $<
100         @echo workdir = $(WORKDIR)
101         $(CC) -c  $(CFLAGS)  $<  -o $@
103 $(ARMV7OBJDIR)/netapi/test/.created:
104         @mkdir -p $(ARMV7OBJDIR)/netapi/test/
106 $(ARMV7BINDIR)/netapi/test/.created:
107         @mkdir -p $(ARMV7BINDIR)/netapi/test/
111 $(ARMV7BINDIR)/netapi/test/net_test_loopback:  $(NT_OBJS) $(TRIE_OBJS)
112         $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_loopback
114 $(ARMV7BINDIR)/netapi/test/net_test_max_params:  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS)
115         $(CC) $(LDFLAGS)  $(NT_MAX_PARAMS_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_max_params
116 $(ARMV7BINDIR)/netapi/test/net_test_router:  $(NT_ROUTER_OBJS) $(TRIE_OBJS)
117         $(CC) $(LDFLAGS)  $(NT_ROUTER_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_router
119 $(ARMV7BINDIR)/netapi/test/nt_bridge:  $(NTB_OBJS) $(TRIE_OBJS)
120         $(CC) $(LDFLAGS)  $(NTB_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/nt_bridge
122 $(ARMV7BINDIR)/netapi/test/ifdma_test:  $(IFDMA_OBJS)
123         $(CC) $(LDFLAGS)  $(IFDMA_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/ifdma_test
125 $(ARMV7BINDIR)/netapi/test/net_test_bench:  $(NT_BENCH_OBJS)
126         $(CC) $(LDFLAGS)  $(NT_BENCH_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test_bench