home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / ARTLSRC.RAR / SYS / MAKESYS.CMD < prev    next >
OS/2 REXX Batch file  |  2000-08-15  |  4KB  |  139 lines

  1. @echo off
  2. echo.
  3. echo   System Unit Build Script                         (C) 1998 fPrint (UK) Ltd
  4. echo.
  5.  
  6. rem Run with ASM as parameter to re-assemble .asm files. This requires
  7. rem that TASM.EXE is available in PATH.
  8.  
  9. rem Make environment space available in Windows NT:
  10. set processor_identifier=
  11.  
  12. rem *** Change this line according to where VP is installed
  13. set VPBase={BASEDIR}
  14. if not exist "%vpbase%\bin.os2\vpc.exe" goto help
  15.  
  16. if "%1"=="D32" goto DPMI32Target
  17. if "%1"=="d32" goto DPMI32Target
  18. if "%1"=="OS2" goto Os2Target
  19. if "%1"=="os2" goto Os2Target
  20. if "%1"=="W32" goto Win32Target
  21. if "%1"=="w32" goto Win32Target
  22. if "%1"=="LNX" goto LinuxTarget
  23. if "%1"=="lnx" goto LinuxTarget
  24.  
  25. echo ! Cannot execute, required parameter missing.
  26. echo     MakeSys OS2,W32,D32 or LNX [ASM ▌ Options]
  27. echo   where
  28. echo     OS2: build the OS/2 System unit
  29. echo     W32: build the Win32 System unit
  30. echo     D32: build the DPMI32 System unit
  31. echo     LNX: build the Linux System unit
  32. echo     ASM: If specified, .asm files will be recompiled.  Required TASM in path.
  33. echo     Options: Extra options passed to the compiler
  34. echo.
  35. goto end
  36.  
  37. :help
  38. echo Cannot execute; VPBase setting is probably incorrect.  Please modify this
  39. echo script to contain the correct location of your VP installation.
  40. echo.
  41. goto end
  42.  
  43. :LinuxTarget
  44.   set Target=lnx
  45.   set option=-CW:LNX:LINUX
  46. goto CheckOS
  47.  
  48. :DPMI32Target
  49.   set TARGET=d32
  50.   set option=-CW:D32:DPMI32
  51. goto CheckOS
  52.  
  53. :Os2Target
  54.   set TARGET=os2
  55.   set option=-CO
  56. goto CheckOS
  57.  
  58. :Win32Target
  59.   set TARGET=w32
  60.   set option=-CW
  61.  
  62. :CheckOS
  63. echo - Determining under which OS we are running
  64.   %vpbase%\bin.os2\vpc.exe >nul
  65.   if errorlevel 255 goto IsWin32
  66.   if errorlevel 254 goto IsOs2
  67.   goto IsWin32
  68. :IsOs2
  69.   set OS=os2
  70.   goto GetOptions
  71. :IsWin32
  72.   set OS=w32
  73.  
  74. :GetOptions
  75. if "%2" == "ASM" goto MakeSystem
  76.   set option=%option% %2
  77.   echo Options are %option%
  78.  
  79. :MakeSystem
  80. echo   Current OS is %OS%
  81. echo - Building System unit
  82. "%vpbase%\bin.%os%\vpc" %option% system "/O%vpbase%\out.%target%\units"
  83. if errorlevel 1 goto error
  84.  
  85. if not "%2"=="ASM" goto DoneAsm
  86. Echo - Assembling .asm files
  87. tasm io.asm /q /oi /m /ml
  88. tasm thunk.asm /q /oi /m /ml
  89. tasm iodos.asm /q /oi /m /ml
  90. :DoneAsm
  91.  
  92. cd ..
  93. echo - Linking VpSysLow to new System unit
  94. "%vpbase%\bin.%os%\vpc" %option% vpsyslow /$SmartLink+ "/O%vpbase%\out.%target%\units" "/U%vpbase%\source\%target%" /m >nul
  95. if errorlevel 1 goto error
  96. if .%target% == .w32 goto LibW32
  97. if .%target% == .d32 goto LibD32
  98. if .%target% == .lnx goto LibLnx
  99.  
  100. echo - Linking OS/2-specific .obj files to new System unit
  101. "%vpbase%\bin.%os%\lib" "%vpbase%\out.%target%\units\system.lib" +sys\io +sys\thunk "+%vpbase%\out.%target%\units\vpsyslow.lib" >nul
  102. if errorlevel 1 goto error
  103. goto ok
  104.  
  105. :LibW32
  106. echo - Linking Win32-specific .obj files to new System unit
  107. "%vpbase%\bin.%os%\lib" "%vpbase%\out.%target%\units\system.lib" +sys\iodos "+%vpbase%\out.%target%\units\vpsyslow.lib" >nul
  108. if errorlevel 1 goto error
  109. goto ok
  110.  
  111. :LibD32
  112. echo - Linking DPMI32-specific .obj files to new System unit
  113. "%vpbase%\bin.%os%\lib" "%vpbase%\out.%target%\units\system.lib" "+%vpbase%\out.%target%\units\vpsyslow.lib" "+%vpbase%\out.%target%\units\dpmi32.lib" "+%vpbase%\out.%target%\units\dpmi32df.lib" >nul
  114. if errorlevel 1 goto error
  115. goto ok
  116.  
  117. :LibLnx
  118. echo - Linking Linux-specific .obj files to new System unit
  119. "%vpbase%\bin.%os%\lib" "%vpbase%\out.%target%\units\system.lib" "+%vpbase%\out.%target%\units\vpsyslow.lib" "+%vpbase%\out.%target%\units\linux.lib" "+%vpbase%\out.%target%\units\strings.lib" "+%vpbase%\out.%target%\units\lnxres.lib"
  120. if errorlevel 1 goto error
  121. goto ok
  122.  
  123. :error
  124. echo.
  125. echo   An error occurred in the build script.  Please check any messages
  126. echo   above for the cause of the problem.
  127. goto end
  128.  
  129. :ok
  130. cd sys
  131. echo - Copying new System unit to units.%target%
  132. copy "%vpbase%\out.%target%\units\system.lib" "%vpbase%\units.%target%"
  133. copy "%vpbase%\out.%target%\units\system.vpi" "%vpbase%\units.%target%"
  134. echo.
  135. echo Finished.
  136.  
  137. :end
  138.  
  139.