Merge branch 'master' of git://gtgit01/git/projects/netapi
[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 # Output for prebuilt generated libraries
8 export ARMV7LIBDIR ?= ../lib
9 export ARMV7OBJDIR ?= ../obj
11 # Set NETAPI INSTALL PATH to Transport SDK for default
12 export NETAPI_INSTALL_PATH ?= $(TRANS_SDK_INSTALL_PATH)
14 #NETAPI dirs
15 OBJEXT = o 
16 INTERNALLINKDEFS =
17 NETAPI_INC_DIR = $(NETAPI_INSTALL_PATH)/ti/runtime/netapi
18 SRCDIR = $(NETAPI_INC_DIR)/src
20 VPATH=$(SRCDIR)
23 #Cross tools
24 CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc -c
25 AR = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)ar -r
28 #List the COMMONSRC Files
29 COMMONSRCC = \
30     netapi.c \
31     netapi_init.c \
32     netapi_sched.c \
33     netapi_timer.c \
34     netapi_vm.c \
35     netcp_cfg.c \
36     osal.c \
37     pktio.c \
38     tim64.c\
39     timlist.c
41 CFLAGS= $(DEBUG_FLAG) -I$(NETAPI_INC_DIR) -I.  -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR)  -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
42 INCS = -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
43 all: lib 
45 lib: $(ARMV7LIBDIR)/libnetapi.a
48 # Make Rule for the COMMONSRC Files
49 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT), $(COMMONSRCC))
51 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/netapi/lib/%.$(OBJEXT): %.c
52         -@echo compiling $< ...
53         @mkdir -p $(ARMV7OBJDIR)/netapi/lib/
54         $(CC) $(CFLAGS) $(INCS)  $< -o $@
56 $(ARMV7LIBDIR)/libnetapi.a: $(COMMONSRCCOBJS)
57         @echo archiving $? into $@ ...
58         @$(AR) $@ $?
60 clean:  
61         rm -f $(ARMV7OBJDIR)/netapi/lib/*.o
62         rm -f $(ARMV7LIBDIR)/libnetapi.a