9baf64f98119fae6a02da197a6ca59f7dd65b7c6
[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/highperf-lib
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 SOC ?= tci6634
12 ifeq ($(PDK_VER),v3)
13 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device/$(SOC)/src
14 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device/$(SOC)/src
15 endif
16 ifeq ($(PDK_VER),v2)
17 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device
18 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device
19 endif
21 # Output for prebuilt generated libraries
22 export ARMV7LIBDIR ?= ../lib
23 export ARMV7OBJDIR ?= ../obj
25 # Set NETAPI INSTALL PATH to Transport SDK for default
26 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
28 NETAPI_DOCS_DIR := $(NETAPI_INSTALL_PATH)/ti/runtime/netapi/docs
29  
30 #NETAPI dirs
31 OBJEXT = o
32 INTERNALLINKDEFS =
33 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
34 SRCDIR = $(NETAPI_INC_DIR)/src
36 VPATH=$(SRCDIR):$(NETAPI_NAVIG_INIT_SRC)
39 #Cross tools
40 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
41 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
44 #List the COMMONSRC Files
45 COMMONSRCC = \
46     netapi.c \
47     netapi_sec.c \
48     netapi_init.c \
49     netapi_sched.c \
50     netcp_cfg.c \
51     osal.c \
52     pktio.c \
53     netapi_navig.c\
55 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) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
56 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
57 all: lib
59 lib: $(ARMV7LIBDIR)/libnetapi.a
62 # Make Rule for the COMMONSRC Files
63 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
65 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
66         -@echo compiling $< ...
67         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
68         $(CC) $(CFLAGS) $(INCS)  $< -o $@
70 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
71         @mkdir -p $(ARMV7LIBDIR)
72         @echo archiving $? into $@ ...
73         @$(AR) $@ $?
75 clean:
76         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
77         rm -f $(ARMV7LIBDIR)/libnetapi.a
79 doxygen:
80         rm -rf $(NETAPI_DOCS_DIR)/html
81         rm -rf $(NETAPI_DOCS_DIR)/latex
82         doxygen netapi_doxygen.cfg
84 doxygen_clean:
85         rm -rf $(NETAPI_DOCS_DIR)/html
86         rm -rf $(NETAPI_DOCS_DIR)/latex