if alignment
[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
18 export ARMV7BINDIR ?= ./bin
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 rmserver
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/armv7/linux/build/makefile all
65 rmserver:
66         $(MAKE) -f ./test/armv7/linux/build/makefile $@
68 # examples Stub to add Examples
69 #examples: 
70 #       @$(MAKE) -f ./example/InfraDmaSC/$(DEVICE)/armv7/linux/build/makefile all
72 # Make rule to create $(ARMV7LIBDIR)/librm.a library
73 .libraries: $(ARMV7LIBDIR)/librm.a librm.so
75 $(ARMV7LIBDIR)/librm.a::
76         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
78 librm.so:
79         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
80         
81 # Rule to clean $(ARMV7LIBDIR)/librm.a library
82 clean:
83         @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
84         @$(MAKE) -f ./test/armv7/linux/build/makefile $@
85         @$(RMDIR) $(ARMV7OBJDIR)/rm
86         @$(RMDIR) $(ARMV7BINDIR)/rm
87         @$(RM) $(ARMV7LIBDIR)/librm.a
88         @$(RM) $(ARMV7LIBDIR)/librm.so
89         @$(RM) $(ARMV7LIBDIR)/librm.so.*
90         
91 installbin:
92         install -d $(INSTALL_BIN_BASE_DIR)
93         install -d $(INSTALL_BIN_BASE_DIR)/device/k2k/
94         install -d $(INSTALL_BIN_BASE_DIR)/device/k2h/
95         install -d $(INSTALL_BIN_BASE_DIR)/device/k2e/
96         install -d $(INSTALL_BIN_BASE_DIR)/device/k2l/
97         $(CP) ./device/k2h/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2h
98         $(CP) ./device/k2k/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2k
99         $(CP) ./device/k2e/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2e
100         $(CP) ./device/k2l/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2l
101         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer.out    $(INSTALL_BIN_BASE_DIR)/rmServer.out   
102         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer_so.out $(INSTALL_BIN_BASE_DIR)/rmServer_so.out        
103         
104 installbin_test:
105         install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test
106         install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files             
107         $(CP) ./test/dts_files/*.dtb $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files
108         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest.out      $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest.out
109         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest_so.out   $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest_so.out
110         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxMtClientTest.out    $(INSTALL_BIN_BASE_DIR)/rmLinuxMtClientTest.out
111         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxMtClientTest_so.out $(INSTALL_BIN_BASE_DIR)/rmLinuxMtClientTest_so.out  
112         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest.out        $(INSTALL_BIN_BASE_DIR)/rmDspClientTest.out
113         install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest_so.out     $(INSTALL_BIN_BASE_DIR)/rmDspClientTest_so.out
115 install:
116         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
117         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt
118         install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/
119         install -d $(INSTALL_LIB_BASE_DIR)
120         $(CP) ./*.h              $(INSTALL_INC_BASE_DIR)/ti/drv/rm
121         $(CP) ./util/*.h         $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
122         $(CP) ./util/*.sh        $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util 
123         $(CP) ./util/libfdt/*.h  $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util/libfdt  
124         $(CP) -r ./device/       $(INSTALL_INC_BASE_DIR)/ti/drv/rm/
125         $(RM) -r $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/Module.xs                     
126         @$(CP) -r $(ARMV7LIBDIR)/*.a         $(INSTALL_LIB_BASE_DIR)
127         @$(CP) -r $(ARMV7LIBDIR)/*.so        $(INSTALL_LIB_BASE_DIR)
128         @$(CP) -r $(ARMV7LIBDIR)/*.so.*      $(INSTALL_LIB_BASE_DIR)    
129 # Make rule to create examples Stub
130 examples: