PASDK-605:Add PASDK root dir variable to Windows environment setup batch file
[processor-sdk/performance-audio-sr.git] / scripts / build_paf_libs.bat
1 @echo off
2 :: *************************************************************************
3 ::  FILE           : build_paf_libs.bat
4 ::  DESCRIPTION    :
5 ::
6 ::     Builds ARM/DSP PAF libraries.
7 ::     Assumes setup_env.bat has been called.
8 ::
9 :: *************************************************************************
11 :: %1:
12 ::  <none>: Build PAF libraries for ARM & DSP
13 ::    DSP : Build PAF libraries for DSP
14 ::    ARM : Build PAF libraries for ARM
15 @echo Executing:  %~fn0 %1
17 if "%PASDK_ROOT_DIR%" == "" set PASDK_ROOT_DIR=%~dp0..
18 if "%PASDK_ROOT%" == "" set PASDK_ROOT=%PASDK_ROOT_DIR%
20 :: Set PASDK local root directory
21 set PASDK_LROOT_DIR=%PASDK_ROOT_DIR%\pasdk
22 :: Set PAF root directory
23 set PAF_ROOT_DIR=%PASDK_LROOT_DIR%\paf
25 rem
26 rem Temporary "hack" until PAF library make files can detect OS.
27 rem Copy Windows based make files to "working" make files.
28 rem
29 pushd %PAF_ROOT_DIR%\pa\build
30 copy /y rules_a15_windows.mk rules_a15.mk 
31 copy /y rules_windows.mk rules.mk 
32 copy /y target_windows.mk target.mk 
33 copy /y tools_windows.mk tools.mk 
34 popd
36 if "%1"=="ARM" goto arm_libs
38 rem
39 rem DSP libraries
40 rem
42 :dsp_libs
43 set ARCH=c66x
45 pushd %PAF_ROOT_DIR%\pa\asp\com
46 gmake clean ARCH=%ARCH%
47 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
48 popd
50 pushd %PAF_ROOT_DIR%\pa\dec\pcm1
51 gmake clean ARCH=%ARCH%
52 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
53 popd
55 pushd %PAF_ROOT_DIR%\pa\dec\com
56 gmake clean ARCH=%ARCH%
57 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
58 popd
60 pushd %PAF_ROOT_DIR%\pa\asp\std
61 gmake clean ARCH=%ARCH%
62 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
63 popd
65 pushd %PAF_ROOT_DIR%\pa\sio\acp1
66 gmake clean ARCH=%ARCH%
67 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
68 popd
70 pushd %PAF_ROOT_DIR%\pa\enc\pce2
71 gmake clean ARCH=%ARCH%
72 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
73 popd
75 pushd %PAF_ROOT_DIR%\pa\sio\paf
76 gmake clean ARCH=%ARCH%
77 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
78 popd
80 pushd %PAF_ROOT_DIR%\pa\sio\dcs7
81 gmake clean ARCH=%ARCH%
82 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
83 popd
85 pushd %PAF_ROOT_DIR%\pa\util\statusop_common
86 gmake clean ARCH=%ARCH%
87 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
88 popd
90 pushd %PAF_ROOT_DIR%\pa\asp\ae0
91 gmake clean ARCH=%ARCH%
92 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
93 popd
95 pushd %PAF_ROOT_DIR%\pa\asp\ml0
96 gmake clean ARCH=%ARCH%
97 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
98 popd
100 pushd %PAF_ROOT_DIR%\pa\asp\fil
101 gmake clean ARCH=%ARCH%
102 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
103 popd
105 pushd %PAF_ROOT_DIR%\pa\asp\src4
106 gmake clean ARCH=%ARCH%
107 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
108 popd
110 pushd %PAF_ROOT_DIR%\pa\asp\del3
111 gmake clean ARCH=%ARCH%
112 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%C6X_CGT_INSTALL_DIR%
113 popd
115 if "%1"=="DSP" goto end
118 rem
119 rem ARM libraries
120 rem
122 :arm_libs
123 set ARCH=a15
125 pushd %PAF_ROOT_DIR%\pa\asp\com
126 gmake clean ARCH=%ARCH%
127 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
128 popd
130 pushd %PAF_ROOT_DIR%\pa\dec\pcm1
131 gmake clean ARCH=%ARCH%
132 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
133 popd
135 pushd %PAF_ROOT_DIR%\pa\dec\com
136 gmake clean ARCH=%ARCH%
137 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
138 popd
140 pushd %PAF_ROOT_DIR%\pa\asp\std
141 gmake clean ARCH=%ARCH%
142 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
143 popd
145 pushd %PAF_ROOT_DIR%\pa\sio\acp1
146 gmake clean ARCH=%ARCH%
147 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
148 popd
150 pushd %PAF_ROOT_DIR%\pa\util\c67x_cintrins
151 gmake clean ARCH=%ARCH%
152 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
153 popd
155 pushd %PAF_ROOT_DIR%\pa\util\simulate_dma
156 gmake clean ARCH=%ARCH%
157 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
158 popd
160 pushd %PAF_ROOT_DIR%\pa\util\statusop_common
161 gmake clean ARCH=%ARCH%
162 gmake install ROOTDIR=%PAF_ROOT_DIR% ARCH=%ARCH% CG_TOOLS=%ARM_CGT_INSTALL_DIR%
163 popd
166 :cleanupenv
167 set PASDK_ROOT=
168 set PASDK_LROOT_DIR=
169 set PAF_ROOT_DIR=
170 set ARCH=
172 :end