/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/Bin/make.bat
Defence Force logotype

Diff of /public/pc/tools/osdk/main/Osdk/_final_/Bin/make.bat

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1001 by dbug, Sun May 24 19:53:20 2009 UTC revision 1002 by dbug, Sun Dec 8 10:50:26 2013 UTC
# Line 1  Line 1 
1  @ECHO OFF  @ECHO OFF
2  ::@ECHO ON  ::ECHO ON
3    
4  ::  ::
5  :: Initial checks to verify that everything is fine.  :: Initial checks to verify that everything is fine.
# Line 15  IF NOT "%OSDKNAME%"=="" GOTO Name Line 15  IF NOT "%OSDKNAME%"=="" GOTO Name
15  SET OSDKNAME=OSDK  SET OSDKNAME=OSDK
16  :Name  :Name
17    
18    ::
19    :: Set the default tape name for the final executable
20    :: if no name has been specified
21    ::
22    IF NOT "%OSDKTAPNAME%"=="" GOTO TapName
23    SET OSDKTAPNAME=OSDK
24    :TapName
25    
26  ::  ::
27  :: Set the default assembly adress  :: Set the default assembly adress
# Line 54  IF EXIST BUILD\NUL GOTO NoBuild Line 60  IF EXIST BUILD\NUL GOTO NoBuild
60  MD BUILD  MD BUILD
61  :NoBuild  :NoBuild
62    
63  IF EXIST %OSDKT% GOTO NoTmp  
64  MD %OSDKT%  ::
65    :: Make sure that temp folder is entirelly empty before attempting a new build
66    :: Will guarantee we do not have side effects between builds
67    ::
68    ::ECHO ON
69    RMDIR /s /q %OSDKT%\ >NUL
70    MD %OSDKT% >NUL
71    ::IF EXIST %OSDKT%\NUL GOTO NoTmp
72    ::MD %OSDKT%
73  :NoTmp  :NoTmp
74    ::ECHO OFF
75    
76    
77  ::  ::
78  :: Display a compilation message  :: Display a compilation message
# Line 90  IF NOT EXIST %OSDKT%\%OSDKNAME%.bas GOTO Line 106  IF NOT EXIST %OSDKT%\%OSDKNAME%.bas GOTO
106  DEL %OSDKT%\%OSDKNAME%.bas >NUL  DEL %OSDKT%\%OSDKNAME%.bas >NUL
107  :NoBas  :NoBas
108    
109    :: Delete eventual compressed files
110    IF NOT EXIST BUILD\*.pak GOTO NoPak
111    DEL BUILD\*.pak >NUL
112    :NoPak
113    
114    IF NOT EXIST BUILD\%OSDKPACK%.* GOTO NoPakFiles
115    DEL BUILD\%OSDKPACK%.* >NUL
116    :NoPakFiles
117    
118    
119  ::  ::
120  :: Create a BATCH file that will be used  :: Create a BATCH file that will be used
# Line 97  DEL %OSDKT%\%OSDKNAME%.bas >NUL Line 122  DEL %OSDKT%\%OSDKNAME%.bas >NUL
122  ::  ::
123  ::ECHO *=%OSDKADDR% >%OSDKT%\adress.tmp  ::ECHO *=%OSDKADDR% >%OSDKT%\adress.tmp
124  ::ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.s -s %OSDKT%\ -f -q %1 %2 %3 %4 %5 %6 %7 %8 %9 >%OSDKT%\link.bat  ::ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.s -s %OSDKT%\ -f -q %1 %2 %3 %4 %5 %6 %7 %8 %9 >%OSDKT%\link.bat
125  ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.ss -s %OSDKT%\ -f -q %OSDKFILE% >%OSDKT%\link.bat  ::ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.ss -s %OSDKT%\ -f -q %OSDKFILE% >%OSDKT%\link.bat
126  ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.s -s %OSDKT%\ -f -q %OSDKFILE% >%OSDKT%\link.bat  ECHO %OSDKB%\link65.exe %OSDKLINK% -d %OSDK%\lib/ -o %OSDKT%\linked.s -s %OSDKT%\ -f -q %OSDKFILE% >%OSDKT%\link.bat
127    
128    
   
129  ::  ::
130  :: Compile/Assemble files  :: Compile/Assemble files
131  :: depending of their type  :: depending of their type
# Line 163  GOTO FileLoop Line 187  GOTO FileLoop
187  IF "%OSDKBRIEF%"=="" ECHO Assembling %1.S  IF "%OSDKBRIEF%"=="" ECHO Assembling %1.S
188    
189  :: Create the directory structure  :: Create the directory structure
190  XCOPY /Y /T %1.S %OSDKT%  XCOPY /Y /T %1.S %OSDKT%\
191    
192  :: Copy the file  :: Copy the file
193  COPY %1.S %OSDKT%\%1 /Y >NUL  COPY %1.S %OSDKT%\%1 /Y >NUL
# Line 190  GOTO FileLoop Line 214  GOTO FileLoop
214  :: Do we have a BASIC program ?  :: Do we have a BASIC program ?
215  IF NOT EXIST %OSDKT%\%OSDKNAME%.bas GOTO Link  IF NOT EXIST %OSDKT%\%OSDKNAME%.bas GOTO Link
216    
217  ECHO Generating line numbers  ::ECHO Generating line numbers
218  %OSDKB%\Labels2Num %OSDKT%\%OSDKNAME%.bas %OSDKT%\%OSDKNAME%.bas2 1 1  ::%OSDKB%\Labels2Num %OSDKT%\%OSDKNAME%.bas %OSDKT%\%OSDKNAME%.bas2 1 1
219    
220  ECHO Generating TAPE file  ECHO Generating TAPE file
221  %OSDKB%\Bas2Tap -b2t1 -color1 %OSDKT%\%OSDKNAME%.bas2 build\%OSDKNAME%.tap  %OSDKB%\Bas2Tap -b2t1 -color1 %OSDKT%\%OSDKNAME%.bas build\%OSDKNAME%.tap
222    
223  IF ERRORLEVEL 1 GOTO ErFailure  IF ERRORLEVEL 1 GOTO ErFailure
224  GOTO End  GOTO End
225    
# Line 203  ECHO Linking Line 228  ECHO Linking
228  CALL %OSDKT%\link.bat  CALL %OSDKT%\link.bat
229  IF ERRORLEVEL 1 GOTO ErFailure  IF ERRORLEVEL 1 GOTO ErFailure
230  ::ECHO Optimising size  ::ECHO Optimising size
231  %OSDKB%\opt65.exe %OSDKT%\linked.s > %OSDKT%\linked_optimised.s  ::%OSDKB%\opt65.exe %OSDKT%\linked.s > %OSDKT%\linked_optimised.s
232    
233    
234  ::  ::
# Line 214  ECHO Assembling Line 239  ECHO Assembling
239  %OSDKB%\xa.exe %OSDKT%\linked.s -o build\final.out -e build\xaerr.txt -l build\symbols -bt %OSDKADDR%  %OSDKB%\xa.exe %OSDKT%\linked.s -o build\final.out -e build\xaerr.txt -l build\symbols -bt %OSDKADDR%
240  IF NOT EXIST "build\final.out" GOTO ErFailure  IF NOT EXIST "build\final.out" GOTO ErFailure
241    
242    
243    ::
244    :: Executable compression test
245    ::
246    IF "%OSDKPACKADDR%"=="" GOTO EndPack
247    
248    IF "%OSDKBRIEF%"=="" ECHO Compressing
249    %OSDK%\bin\FilePack -p0 build\final.out  %OSDKT%\final.pak
250    
251    IF "%OSDKBRIEF%"=="" ECHO   - Converting binary to text format
252    %OSDK%\bin\bin2txt -s1 -f2  %OSDKT%\final.pak  %OSDKT%\final_pak.s _PackedStart >NUL
253    
254    IF "%OSDKBRIEF%"=="" ECHO   - Appending depacking code
255    COPY %OSDKT%\final_fp.s+%OSDKB%\unpack.s+%OSDKT%\final_pak.s %OSDKT%\pak_linked.s >NUL
256    
257    IF "%OSDKBRIEF%"=="" ECHO   - Assembling
258    %OSDKB%\xa.exe  %OSDKT%\pak_linked.s -o build\final.out -e %OSDKT%\xaerr.txt -l %OSDKT%\symbols -bt %OSDKPACKADDR%
259    IF NOT EXIST "build\final.out" GOTO ErFailure
260    
261    :: The new start address is the packed executable load address
262    set OSDKADDR=%OSDKPACKADDR%
263    
264    :EndPack
265    
266    
267  ::  ::
268  :: Append the tape header  :: Append the tape header
269  ::  ::
270  ECHO Creating final program %OSDKNAME%.TAP  ECHO Creating final program %OSDKNAME%.TAP
271  %OSDKB%\header.exe %OSDKHEAD% build\final.out build\%OSDKNAME%.tap %OSDKADDR%  %OSDKB%\header.exe %OSDKHEAD% build\final.out build\%OSDKNAME%.tap %OSDKADDR%
272    %OSDKB%\taptap.exe ren build\%OSDKNAME%.tap %OSDKTAPNAME% 0
273    
274  :BuildOk  :BuildOk
275  ECHO Build of %OSDKNAME%.tap finished  ECHO Build of %OSDKNAME%.tap finished
276    
277    
278  ::  ::
279  :: Generate the DSK file  :: Generate the DSK file. If OSDKFILE is empty we assume (hm hmmm) that the caller is packaging itself with floppybuilder. (WIP)
280  ::  ::
281  IF "%OSDKDISK%"=="" GOTO EndBuildDisk  IF "%OSDKDISK%"=="" GOTO EndBuildDisk
282  %OSDK%\bin\tap2dsk.exe %OSDKDISK% build\%OSDKNAME%.tap build\%OSDKNAME%.dsk  IF "%OSDKFILE%"=="" GOTO EndBuildDisk
283    
284    %OSDK%\bin\DskTool.exe -n%OSDKDNAME% -i%OSDKINIST% %OSDKDISK% build\%OSDKNAME%.tap build\%OSDKNAME%.dsk
285    ::%OSDK%\bin\tap2dsk.exe %OSDKDISK% build\%OSDKNAME%.tap build\%OSDKNAME%.dsk
286  %OSDK%\bin\old2mfm.exe build\%OSDKNAME%.DSK  %OSDK%\bin\old2mfm.exe build\%OSDKNAME%.DSK
287    
288  :EndBuildDisk  :EndBuildDisk
289    
290  ::  ::

Legend:
Removed from v.1001  
changed lines
  Added in v.1002

  ViewVC Help
Powered by ViewVC 1.1.26