Update for crash and compilation fix for latest in the branch
[keystone-rtos/netapi.git] / ti / runtime / netapi / build / Makefile
1 # INCLUDE Directories
2 QMSS_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss
3 CPPI_INC_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi
5 INCDIR := $(PDK_INSTALL_PATH);  $(QMSS_INC_DIR); $(CPPI_INC_DIR)
7 export PDK_VER ?= v2
8 NETAPI_NAVIG_INIT_SRC=$(NETAPI_INC_DIR)/src/pdk/$(PDK_VER)
10 export SOC ?= tci6634
11 ifeq ($(PDK_VER),v3)
12 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device/$(SOC)/src
13 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device/$(SOC)/src
14 endif
15 ifeq ($(PDK_VER),v2)
16 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device
17 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device
18 endif
20 # Output for prebuilt generated libraries
21 export ARMV7LIBDIR ?= ../lib
22 export ARMV7OBJDIR ?= ../obj
24 # Set NETAPI INSTALL PATH to Transport SDK for default
25 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
27 NETAPI_DOCS_DIR := $(NETAPI_INSTALL_PATH)/ti/runtime/netapi/docs
28  
29 #NETAPI dirs
30 OBJEXT = o
31 INTERNALLINKDEFS =
32 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
33 SRCDIR = $(NETAPI_INC_DIR)/src
35 VPATH=$(SRCDIR):$(NETAPI_NAVIG_INIT_SRC)
38 #Cross tools
39 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
40 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
43 #List the COMMONSRC Files
44 COMMONSRCC = \
45     netapi.c \
46     netapi_sec.c \
47     netapi_init.c \
48     netapi_sched.c \
49     netapi_timer.c \
50     netapi_vm.c \
51     netcp_cfg.c \
52     osal.c \
53     pktio.c \
54     tim64.c\
55     netapi_navig.c\
56     timlist.c
58 CFLAGS= $(DEBUG_FLAG) -I$(NETAPI_INC_DIR) -I.  -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(NWAL_INSTALL_PATH) -I$(PKTLIB_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR) -I$(QMSS_DEV_DIR) -I$(CPPI_DEV_DIR) -I$(NETAPI_NAVIG_INIT_SRC) -I$(SA_INSTALL_PATH) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
59 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
60 all: lib
62 lib: $(ARMV7LIBDIR)/libnetapi.a
65 # Make Rule for the COMMONSRC Files
66 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
68 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
69         -@echo compiling $< ...
70         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
71         $(CC) $(CFLAGS) $(INCS)  $< -o $@
73 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
74         @mkdir -p $(ARMV7LIBDIR)
75         @echo archiving $? into $@ ...
76         @$(AR) $@ $?
78 clean:
79         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
80         rm -f $(ARMV7LIBDIR)/libnetapi.a
82 doxygen:
83         rm -rf $(NETAPI_DOCS_DIR)/html
84         rm -rf $(NETAPI_DOCS_DIR)/latex
85         doxygen netapi_doxygen.cfg
87 doxygen_clean:
88         rm -rf $(NETAPI_DOCS_DIR)/html
89         rm -rf $(NETAPI_DOCS_DIR)/latex