.gitignore left out k2e/k2l makefile
[keystone-rtos/rm-lld.git] / makefile_armv7
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)
19 export USEDYNAMIC_LIB ?= "no"
21 # ROOT Directory
22 export ROOTDIR := ../../..
24 # INCLUDE Directory
25 export INCDIR := ../../..;$(PDK_INSTALL_PATH);$(ROOTDIR)
27 # Common Macros used in make
29 ifndef RM
30 export RM = rm -f
31 endif
33 ifndef CP
34 export CP = cp -p
35 endif
37 export MKDIR = mkdir -p
39 ifndef RMDIR
40 export RMDIR = rm -rf
41 endif
43 ifndef SED
44 export SED = sed
45 endif
47 ifndef MAKE
48 export MAKE = make
49 endif
51 # PHONY Targets
52 .PHONY: all examples clean lib tests install installbin
54 # all rule
55 all: .executables 
56 .executables: lib tests
58 # Libraries
59 lib: .libraries
61 # tests Stub to add tests
62 tests: 
63         @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile all
65 # examples Stub to add Examples
66 #examples: 
67 #       @$(MAKE) -f ./example/InfraDmaSC/$(DEVICE)/armv7/linux/build/makefile all
69 # Make rule to create $(ARMV7LIBDIR)/librm.a library
70 .libraries: $(ARMV7LIBDIR)/librm.a librm.so
72 $(ARMV7LIBDIR)/librm.a::
73         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
75 librm.so:
76         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
77         
78 # Rule to clean $(ARMV7LIBDIR)/librm.a library
79 clean:
80         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
81         @$(MAKE) -f ./test/$(DEVICE)/armv7/linux/build/makefile $@
82         @$(RMDIR) $(ARMV7OBJDIR)/rm
83         @$(RMDIR) $(ARMV7BINDIR)/rm
84         @$(RM) $(ARMV7LIBDIR)/librm.a
85         @$(RM) $(ARMV7LIBDIR)/librm.so
86         @$(RM) $(ARMV7LIBDIR)/librm.so.*
87         
88 installbin:
89         install -d $(INSTALL_BIN_BASE_DIR)
90         install -d $(INSTALL_BIN_BASE_DIR)/device/k2k/
91         install -d $(INSTALL_BIN_BASE_DIR)/device/k2h/
92         $(CP) ./device/k2h/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2h
93         $(CP) ./device/k2k/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2k
94         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer.out    $(INSTALL_BIN_BASE_DIR)/rmServer_$(DEVICE).out 
95         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer_so.out $(INSTALL_BIN_BASE_DIR)/rmServer_so_$(DEVICE).out      
96         
97 installbin_test:
98         install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test
99         install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files             
100         $(CP) ./test/dts_files/*.dtb $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files
101         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest.out $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest_$(DEVICE).out
102         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest.out   $(INSTALL_BIN_BASE_DIR)/rmDspClientTest_$(DEVICE).out
103         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest_so.out $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest_so_$(DEVICE).out
104         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest_so.out   $(INSTALL_BIN_BASE_DIR)/rmDspClientTest_so_$(DEVICE).out
106 install:
107         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
108         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt
109         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k/
110         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h/
111         install -d $(INSTALL_LIB_BASE_DIR)
112         $(CP) ./*.h              $(INSTALL_INC_BASE_DIR)/ti/drv/rm
113         $(CP) ./util/*.h         $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
114         $(CP) ./util/*.sh        $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util 
115         $(CP) ./util/libfdt/*.h  $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt  
116         $(CP) ./device/k2h/*.c   $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
117         $(CP) ./device/k2h/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h
118         $(CP) ./device/k2h/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2h           
119         $(CP) ./device/k2k/*.c   $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k   
120         $(CP) ./device/k2k/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k   
121         $(CP) ./device/k2k/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k                   
122         @$(CP) -r $(ARMV7LIBDIR)/*.a         $(INSTALL_LIB_BASE_DIR)
123         @$(CP) -r $(ARMV7LIBDIR)/*.so        $(INSTALL_LIB_BASE_DIR)
124         @$(CP) -r $(ARMV7LIBDIR)/*.so.*      $(INSTALL_LIB_BASE_DIR)    
125 # Make rule to create examples Stub
126 examples: