Makefile cleanup: removed dependency on CORTEX_A15 compile file flag, updated sources...
[keystone-rtos/netapi.git] / ti / runtime / netapi / build / Makefile
1 # Macro definitions referenced below
2 #
3 empty =
4 space =$(empty) $(empty)
6 # INCLUDE Directories
7 QMSS_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/qmss
8 SA_INSTALL_PATH ?= $(PDK_INSTALL_PATH)/ti/drv/sa
9 CPPI_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/drv/cppi
10 #HPLIB_INC_DIR = $(HPLIB_INSTALL_PATH)/ti/runtime/hplib
12 HPLIB_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/runtime/hplib
13 INCDIR := $(PDK_INSTALL_PATH);  $(QMSS_INC_DIR); $(CPPI_INC_DIR); $(HPLIB_INC_DIR)
15 WORKDIR ?= $(TRANS_SDK_INSTALL_PATH)
16 #NETAPI_INC_DIR ?= $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
17 #NETAPI_INC_DIR ?= $(PDK_INSTALL_PATH)/ti/runtime/netapi
18 NETAPI_INC_DIR ?= $(WORKDIR)
19 export PDK_VER ?= v3
20 NETAPI_NAVIG_INIT_SRC=$(NETAPI_INC_DIR)/src/pdk$(PDK_VER)
22 ifeq ($(CPU), cortex-a8)
23         CFLAGS += -DCORTEX_A8
24 endif
26 export DEVICE?= k2h
27 ifeq ($(PDK_VER),v3)
28 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device/$(DEVICE)/src
29 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device/$(DEVICE)/src
30 endif
31 ifeq ($(PDK_VER),v2)
32 QMSS_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/qmss/device
33 CPPI_DEV_DIR = $(PDK_INSTALL_PATH)/ti/drv/cppi/device
34 endif
36 # Output for prebuilt generated libraries
37 export ARMV7LIBDIR ?= ./lib
38 export ARMV7OBJDIR ?= ./obj
39 ARMV7OBJDIR := $(ARMV7OBJDIR)/netapi/lib
40 ARMV7BINDIR ?= ./bin
42 # Set NETAPI INSTALL PATH to Transport SDK for default
43 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
45 NETAPI_DOCS_DIR := $(NETAPI_INSTALL_PATH)/ti/runtime/netapi/docs
46  
47 #NETAPI dirs
48 OBJEXT = o
49 INTERNALLINKDEFS =
50 #SRCDIR = ./src;$(NETAPI_INC_DIR)/src
51 SRCDIR = ./src
52 #VPATH=$(SRCDIR):$(NETAPI_NAVIG_INIT_SRC)
53 VPATH=$(SRCDIR):./src/pdk$(PDK_VER)
55 ifdef CROSS_TOOL_INSTALL_PATH
56 ## Support backwards compatibility with KeyStone1 approach
57  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
58  AC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)as
59  AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar
60  LD = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
61 endif
62 #Cross tools
63 #CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
64 #AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
66 CSL_DEVICE ?= -DDEVICE_K2H
68 #List the COMMONSRC Files
69 COMMONSRCC = \
70     netapi.c \
71     netapi_sec.c \
72     netapi_init.c \
73     netapi_sched.c \
74     netcp_cfg.c \
75     pktio.c \
76     netapi_navig.c\
78 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
79 #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) $(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
83 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
84 all: lib
86 lib: $(ARMV7LIBDIR)/libnetapi.a
89 # Make Rule for the COMMONSRC Files
90 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
92 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
93         -@echo compiling $< ........
94         -@echo vpath = $(VPATH)
95         -@echo workdir = $(WORKDIR)
96         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
97         $(CC) -c $(CFLAGS) $(INCS)  $< -o $@
99 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
100         @mkdir -p $(ARMV7LIBDIR)
101         @echo archiving $? into $@ ...
102         @$(AR) -r $@ $?
104 clean:
105         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
106         rm -f $(ARMV7LIBDIR)/libnetapi.a
108 doxygen:
109         rm -rf $(NETAPI_DOCS_DIR)/html
110         rm -rf $(NETAPI_DOCS_DIR)/latex
111         doxygen netapi_doxygen.cfg
113 clean_doxygen:
114         rm -rf $(NETAPI_DOCS_DIR)/html
115         rm -rf $(NETAPI_DOCS_DIR)/latex