aa6ec562cb160b18f57fb8d37c4b443835184864
[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
4 HPLIB_INC_DIR = $(HPLIB_INSTALL_PATH)/ti/runtime/hplib
6 INCDIR := $(PDK_INSTALL_PATH);  $(QMSS_INC_DIR); $(CPPI_INC_DIR); $(HPLIB_INC_DIR)
8 export PDK_VER ?= v2
9 NETAPI_NAVIG_INIT_SRC=$(NETAPI_INC_DIR)/src/pdk$(PDK_VER)
11 export CPU ?= cortex-a15
13 ifeq ($(CPU), cortex-a8)
14         CFLAGS += -DCORTEX_A8
15 endif
16 ifeq ($(CPU), cortex-a15)
17         CFLAGS += -DCORTEX_A15
18 endif
20 export SOC ?= tci6634
21 ifeq ($(PDK_VER),v3)
22 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device/$(SOC)/src
23 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device/$(SOC)/src
24 endif
25 ifeq ($(PDK_VER),v2)
26 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device
27 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device
28 endif
30 # Output for prebuilt generated libraries
31 export ARMV7LIBDIR ?= ../lib
32 export ARMV7OBJDIR ?= ../obj
34 # Set NETAPI INSTALL PATH to Transport SDK for default
35 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
37 NETAPI_DOCS_DIR := $(NETAPI_INSTALL_PATH)/ti/runtime/netapi/docs
38  
39 #NETAPI dirs
40 OBJEXT = o
41 INTERNALLINKDEFS =
42 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
43 SRCDIR = $(NETAPI_INC_DIR)/src
45 VPATH=$(SRCDIR):$(NETAPI_NAVIG_INIT_SRC)
48 #Cross tools
49 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
50 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
52 CSL_DEVICE ?= -DDEVICE_K2H
54 #List the COMMONSRC Files
55 COMMONSRCC = \
56     netapi.c \
57     netapi_sec.c \
58     netapi_init.c \
59     netapi_sched.c \
60     netcp_cfg.c \
61     pktio.c \
62     netapi_navig.c\
64 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$(HPLIB_INC_DIR) -I$(QMSS_DEV_DIR) -I$(CPPI_DEV_DIR) -I$(NETAPI_NAVIG_INIT_SRC) -I$(SA_INSTALL_PATH) $(CSL_DEVICE)  -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -DNWAL_ENABLE_SA -pthread -D _GNU_SOURCE
65 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
66 all: lib
68 lib: $(ARMV7LIBDIR)/libnetapi.a
71 # Make Rule for the COMMONSRC Files
72 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
74 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
75         -@echo compiling $< ...
76         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
77         $(CC) $(CFLAGS) $(INCS)  $< -o $@
79 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
80         @mkdir -p $(ARMV7LIBDIR)
81         @echo archiving $? into $@ ...
82         @$(AR) $@ $?
84 clean:
85         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
86         rm -f $(ARMV7LIBDIR)/libnetapi.a
88 doxygen:
89         rm -rf $(NETAPI_DOCS_DIR)/html
90         rm -rf $(NETAPI_DOCS_DIR)/latex
91         doxygen netapi_doxygen.cfg
93 clean_doxygen:
94         rm -rf $(NETAPI_DOCS_DIR)/html
95         rm -rf $(NETAPI_DOCS_DIR)/latex