1 #*******************************************************************************
2 #* FILE PURPOSE: Top level makefile for Creating Component Libraries for ARM
3 #* architectures
4 #*******************************************************************************
5 #* FILE NAME: makefile
6 #*
7 #* DESCRIPTION: Defines Compiler tools paths, libraries , Build Options
8 #*
9 #*
10 #*******************************************************************************
11 #*
12 # (Mandatory) Specify where various tools are installed.
14 # Output for prebuilt generated libraries
15 export ARMV7LIBDIR ?= ./lib
16 export ARMV7OBJDIR ?= ./obj
17 export ARMV7OBJDIR_SO := $(ARMV7OBJDIR)/netapi/lib_so
18 export ARMV7OBJDIR := $(ARMV7OBJDIR)/netapi/lib
20 export ARMV7BINDIR ?= ./bin
22 export DEVICE ?=k2h
24 #Enable the following to build for tci6614
25 #export CPU ?=cortex-a8
28 # ROOT Directory
29 export ROOTDIR := ../../..
32 # INCLUDE Directory
33 export INCDIR := ../;$(PDK_INSTALL_PATH);$(ROOTDIR)
35 # Common Macros used in make
37 ifndef RM
38 export RM = rm -f
39 endif
41 ifndef CP
42 export CP = cp -p
43 endif
45 export MKDIR = mkdir -p
47 ifndef RMDIR
48 export RMDIR = rm -rf
49 endif
51 ifndef SED
52 export SED = sed
53 endif
55 ifndef MAKE
56 export MAKE = make
57 endif
59 # PHONY Targets
60 .PHONY: all clean lib tests examples install installbin
62 # all rule
63 all: .executables install installbin
64 .executables: lib tests examples
66 # Make rule to create $(ARMV7LIBDIR)/libnetapi.a library
67 lib: $(ARMV7LIBDIR)/libnetapi.a libnetapi.so
69 $(ARMV7LIBDIR)/libnetapi.a:
70 -@echo Building library...
71 -@echo ARMV7OBJDIR = $(ARMV7OBJDIR)
72 @$(MAKE) -f ./build/Makefile $@
75 libnetapi.so:
76 -@echo Building library...
77 -@echo ARMV7OBJDIR = $(ARMV7OBJDIR_SO)
78 @$(MAKE) -f ./build/Makefile $@
81 # Rule to clean $(ARMV7LIBDIR)/libnetapi.a library
82 clean:
83 -@echo Cleaning netapi package... $@
84 @$(MAKE) -f ./build/Makefile $@
85 @$(MAKE) -f ./test/build/Makefile $@
87 install:
88 install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi
89 install -d $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/src
90 install -d $(INSTALL_LIB_BASE_DIR)
91 $(CP) ./*.h $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi
92 @$(CP) -r $(ARMV7LIBDIR)/libnetapi.a $(INSTALL_LIB_BASE_DIR)
93 @$(CP) -rp $(ARMV7LIBDIR)/libnetapi.so* $(INSTALL_LIB_BASE_DIR)
94 $(CP) src/*.h $(INSTALL_INC_BASE_DIR)/ti/runtime/netapi/src
96 installbin:
97 install -d $(INSTALL_BIN_BASE_DIR)
98 install -c -m 755 $(ARMV7BINDIR)/netapi/test/* $(INSTALL_BIN_BASE_DIR)
99 install -d $(SYSCONFDIR)/netapi
100 $(CP) test/net_test_config.txt $(SYSCONFDIR)/netapi
101 install -c -m 755 tools/net_test_loopback_setup.sh $(SYSCONFDIR)/netapi
102 install -c -m 755 tools/net_test_router_setup.sh $(SYSCONFDIR)/netapi
103 install -c -m 755 tools/irqset.sh $(SYSCONFDIR)/netapi
104 install -c -m 755 tools/dsp_core_setup.sh $(SYSCONFDIR)/netapi
105 # Make rule to create tests
106 tests:
107 -@echo compiling tests
108 @$(MAKE) -f ./test/build/Makefile $@
110 examples: