Additional changes to integrate with highperf-lib, moved osal.c to highperf-lib
[keystone-rtos/netapi.git] / ti / runtime / netapi / test / build / Makefile
1 export ARMV7OBJDIR ?= ./obj
2 export ARMV7BINDIR ?= ./bin
3 export ARMV7LIBDIR ?= ./lib
5 # Set NETAPI INSTALL PATH to Transport SDK for default
6 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
8 TRIE_OBJS=$(ARMV7OBJDIR)/netapi/test/trie.o
9 NT_OBJS= $(ARMV7OBJDIR)/netapi/test/net_test.o  $(ARMV7OBJDIR)/netapi/test/stubs.o  
11 # INCLUDE Directories
12 QMSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss
13 CPPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi
15 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
16 HPLIB_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/highperf-lib
17 SA_INC_DIR = $(SA_INSTALL_PATH)
19 #NETAPI LIB Build directory
20 NETAPI_BUILD_DIR = $(NETAPI_INC_DIR)/build
22 # Support Libraries used by NETAPI 
23 QMSS_LIB = -lqmss
24 CPPI_LIB = -lcppi
25 PA_LIB   = -lpa
26 #without security enabled
27 #NWAL_LIB = -lnwal
28 PKTLIB_LIB = -lpktlib
29 NETAPI_LIB = -lnetapi
30 HP_LIB = -lhplib
31 #
32 #with security enabled..
33 NWAL_LIB = -lnwalsa
34 SA_LIB=$(SA_INSTALL_PATH)/ti/drv/sa/lib/salld_c.av7A
35 AES_LIB=$(SA_INSTALL_PATH)/ti/mas/aes/gcarmv7a/aes_c.av7A
36 SHA1_LIB=$(SA_INSTALL_PATH)/ti/mas/sha1/gcarmv7a/sha1_c.av7A
37 PKTUTL_LIB=$(SA_INSTALL_PATH)/ti/mas/pktutl/gcarmv7a/pktutl_c.av7A
40 #Cross tools
41 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
42 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
44 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
45 # Linker options
46 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
49 all: tests 
51 tests: $(ARMV7BINDIR)/netapi/test/.created $(ARMV7BINDIR)/netapi/test/net_test
53 api_clean:
54         rm -f  $(ARMV7LIBDIR)/libnetapi.a
55         rm -rf $(ARMV7OBJDIR)/netapi/lib/*.o
57 clean:  
58         rm -f $(ARMV7OBJDIR)/netapi/test/*.o
59         rm -f $(ARMV7LIBDIR)/libnetapi.a
60         rm -f $(ARMV7BINDIR)/netapi/test/net_test $(ARMV7BINDIR)/netapi/test/synchtest $(ARMV7BINDIR)/netapi/test/synchtest2
63 $(ARMV7OBJDIR)/netapi/test/%.o:$(NETAPI_INC_DIR)/test/%.c $(ARMV7OBJDIR)/netapi/test/.created
64         @echo compiling $< ...
65         $(CC)  -c  $(CFLAGS)  $<  -o $@
67 $(ARMV7OBJDIR)/netapi/test/.created:
68         @mkdir -p $(ARMV7OBJDIR)/netapi/test/
70 $(ARMV7BINDIR)/netapi/test/.created:
71         @mkdir -p $(ARMV7BINDIR)/netapi/test/
73 $(ARMV7LIBDIR)/libnetapi.a:
74         make -C $(NETAPI_BUILD_DIR) 
76 $(ARMV7BINDIR)/netapi/test/net_test:  $(NT_OBJS) $(TRIE_OBJS) $(ARMV7LIBDIR)/libnetapi.a
77         $(CC) $(LDFLAGS)  $(NT_OBJS) $(TRIE_OBJS) $(INTERNALLINKDEFS)  -o $(ARMV7BINDIR)/netapi/test/net_test
80 $(ARMV7BINDIR)/netapi/test/synchtest: $(ARMV7OBJDIR)/netapi/test/synchtest.o
81         $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/netapi/test/synchtest.o -o $(ARMV7BINDIR)/netapi/test/synchtest
83 $(ARMV7BINDIR)/netapi/test/synchtest2: $(ARMV7OBJDIR)/netapi/test/synchtest2.o
84         $(CC) $(LDFLAGS) $(ARMV7OBJDIR)/netapi/test/synchtest2.o -o $(ARMV7BINDIR)/netapi/test/synchtest2 -lpthread