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 DEVICE ?=k2h
17 export ARMV7OBJDIR ?= ./obj/$(DEVICE)
18 export ARMV7BINDIR ?= ./bin/$(DEVICE)
20 # ROOT Directory
21 export ROOTDIR := ../../..
23 # INCLUDE Directory
24 export INCDIR := ../../..;$(PDK_INSTALL_PATH);$(ROOTDIR)
26 # Common Macros used in make
28 ifndef RM
29 export RM = rm -f
30 endif
32 ifndef CP
33 export CP = cp -p
34 endif
36 export MKDIR = mkdir -p
38 ifndef RMDIR
39 export RMDIR = rm -rf
40 endif
42 ifndef SED
43 export SED = sed
44 endif
46 ifndef MAKE
47 export MAKE = make
48 endif
50 # PHONY Targets
51 .PHONY: all examples clean lib tests install installbin
53 # all rule
54 all: .executables
55 .executables: lib tests
57 # Libraries
58 lib: .libraries
60 # tests Stub to add tests
61 tests:
62 @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile all
64 # examples Stub to add Examples
65 #examples:
66 # @$(MAKE) -f ./example/InfraDmaSC/$(DEVICE)/armv7/linux/build/makefile all
68 # Make rule to create $(ARMV7LIBDIR)/librm.a library
69 .libraries: $(ARMV7LIBDIR)/librm.a
71 $(ARMV7LIBDIR)/librm.a:
72 @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
74 # Rule to clean $(ARMV7LIBDIR)/librm.a library
75 clean:
76 @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
77 @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile $@
78 @$(RMDIR) $(ARMV7OBJDIR)/rm
79 @$(RMDIR) $(ARMV7BINDIR)/rm
80 @$(RM) $(ARMV7LIBDIR)/librm.a
82 installbin:
83 install -d $(INSTALL_BIN_BASE_DIR)
84 install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer.out $(INSTALL_BIN_BASE_DIR)/rmServer_$(DEVICE).out
85 install -c -m 755 $(ARMV7BINDIR)/rm/test/rmClientTest.out $(INSTALL_BIN_BASE_DIR)/rmClientTest_$(DEVICE).out
87 install:
88 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/include
89 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
90 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt
91 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k/
92 install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h/
93 install -d $(INSTALL_LIB_BASE_DIR)
94 $(CP) ./*.h $(INSTALL_INC_BASE_DIR)/ti/drv/rm
95 $(CP) ./include/*.h $(INSTALL_INC_BASE_DIR)/ti/drv/rm/include
96 $(CP) ./util/*.h $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
97 $(CP) ./util/libfdt/*.h $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt
98 $(CP) ./device/k2h/*.c $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
99 $(CP) ./device/k2h/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
100 $(CP) ./device/k2h/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
101 $(CP) ./device/k2k/*.c $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k
102 $(CP) ./device/k2k/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k
103 $(CP) ./device/k2k/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k
104 @$(CP) -r $(ARMV7LIBDIR)/*.a $(INSTALL_LIB_BASE_DIR)
105 # Make rule to create examples Stub
106 examples: