Additional changes to integrate with highperf-lib, moved osal.c to highperf-lib
[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     pktio.c \
52     netapi_navig.c\
54 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
55 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
56 all: lib
58 lib: $(ARMV7LIBDIR)/libnetapi.a
61 # Make Rule for the COMMONSRC Files
62 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
64 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
65         -@echo compiling $< ...
66         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
67         $(CC) $(CFLAGS) $(INCS)  $< -o $@
69 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
70         @mkdir -p $(ARMV7LIBDIR)
71         @echo archiving $? into $@ ...
72         @$(AR) $@ $?
74 clean:
75         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
76         rm -f $(ARMV7LIBDIR)/libnetapi.a
78 doxygen:
79         rm -rf $(NETAPI_DOCS_DIR)/html
80         rm -rf $(NETAPI_DOCS_DIR)/latex
81         doxygen netapi_doxygen.cfg
83 doxygen_clean:
84         rm -rf $(NETAPI_DOCS_DIR)/html
85         rm -rf $(NETAPI_DOCS_DIR)/latex