diff --git a/RosBE-Windows/Powershell/Clean.ps1 b/RosBE-Windows/Powershell/Clean.ps1 index 01e8e2c..92cd90b 100644 --- a/RosBE-Windows/Powershell/Clean.ps1 +++ b/RosBE-Windows/Powershell/Clean.ps1 @@ -24,34 +24,34 @@ function rembin { # Check if the user set any custom filenames or pathes, otherwise locally set the appropriate variables. - if ("$ENV:ROS_AUTOMAKE" -eq "") { - $ROS_AUTOMAKE = "makefile-$ENV:ROS_ARCH.auto" + if (!(Test-Path "CMakeLists.txt")) { + if ("$ENV:ROS_AUTOMAKE" -eq "") { + $ENV:ROS_AUTOMAKE = "makefile-$ENV:ROS_ARCH.auto" + } + if ("$ENV:ROS_INTERMEDIATE" -eq "") { + $ENV:ROS_INTERMEDIATE = "obj-$ENV:ROS_ARCH" + } + if ("$ENV:ROS_OUTPUT" -eq "") { + $ENV:ROS_OUTPUT = "output-$ENV:ROS_ARCH" + } + if ("$ENV:ROS_CDOUTPUT" -eq "") { + $ENV:ROS_CDOUTPUT = "reactos" + } } else { - $ROS_AUTOMAKE = $ENV:ROS_AUTOMAKE - } - if ("$ENV:ROS_INTERMEDIATE" -eq "") { - $ROS_INTERMEDIATE = "obj-$ENV:ROS_ARCH" - } else { - $ROS_INTERMEDIATE = $ENV:ROS_INTERMEDIATE - } - if ("$ENV:ROS_OUTPUT" -eq "") { - $ROS_OUTPUT = "output-$ENV:ROS_ARCH" - } else { - $ROS_OUTPUT = $ENV:ROS_OUTPUT - } - if ("$ENV:ROS_CDOUTPUT" -eq "") { - $ROS_CDOUTPUT = "reactos" - } else { - $ROS_CDOUTPUT = $ENV:ROS_CDOUTPUT + $ENV:ROS_INTERMEDIATE = "host-tools" + $ENV:ROS_OUTPUT = "reactos" } + - if (Test-Path "$ROS_INTERMEDIATE\.") { + if (Test-Path "$ENV:ROS_INTERMEDIATE\.") { "Cleaning ReactOS $ENV:ROS_ARCH source directory..." - $null = (Remove-Item "$ROS_AUTOMAKE" -force) - $null = (Remove-Item "$ROS_INTERMEDIATE" -recurse -force) - $null = (Remove-Item "$ROS_OUTPUT" -recurse -force) - $null = (Remove-Item "$ROS_CDOUTPUT" -recurse -force) + if (!(Test-Path "CMakeLists.txt")) { + $null = (Remove-Item "$ENV:ROS_AUTOMAKE" -force) + $null = (Remove-Item "$ENV:ROS_CDOUTPUT" -recurse -force) + } + $null = (Remove-Item "$ENV:ROS_INTERMEDIATE" -recurse -force) + $null = (Remove-Item "$ENV:ROS_OUTPUT" -recurse -force) "Done cleaning ReactOS $ENV:ROS_ARCH source directory." } else { diff --git a/RosBE-Windows/Powershell/Config.ps1 b/RosBE-Windows/Powershell/Config.ps1 deleted file mode 100644 index b83a3d0..0000000 --- a/RosBE-Windows/Powershell/Config.ps1 +++ /dev/null @@ -1,430 +0,0 @@ -# -# PROJECT: RosBE - ReactOS Build Environment for Windows -# LICENSE: GNU General Public License v2. (see LICENSE.txt) -# FILE: Root/Config.ps1 -# PURPOSE: A Basic Config.rbuild Creator for ReactOS. -# COPYRIGHT: Copyright 2010 Daniel Reimer -# - -$host.ui.RawUI.WindowTitle = "ReactOS Build Configurator" - -if (!(Test-Path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG")) { - "-da" > "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -} - -function settitle { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - exit -} - -function rbuild { - "Be verbose." - "Default is: no" - "" - $VERBOSE_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-v") - if ("$VERBOSE_B" -eq "") { - $VERBOSE_B = "no" - } else { - $VERBOSE_B = "yes" - } - "Right now: $VERBOSE_B" - $VERBOSE = Read-Host "(yes), (no)" - if ("$VERBOSE" -eq "") { - $VERBOSE = "$VERBOSE_B" - } - if (("$VERBOSE" -eq "yes") -or ("$VERBOSE" -eq "y")) { - $RBUILDFLAGS = "-v" - } - clear-host - - "Delete generated files as soon as they are not needed anymore." - "Default is: no" - "" - $CLEAN_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-c") - if ("$CLEAN_B" -eq "") { - $CLEAN_B = "no" - } else { - $CLEAN_B = "yes" - } - "Right now: $CLEAN_B" - $CLEAN = Read-Host "(yes), (no)" - if ("$CLEAN" -eq "") { - $CLEAN = "$CLEAN_B" - } - if (("$CLEAN" -eq "yes") -or ("$CLEAN" -eq "y")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -c" - } - clear-host - - "Disable/Enable automatic dependencies." - "Default is: yes" - "" - $DEPENDS_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-df") - $DEPENDS_B2 = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-dd") - if (!("$DEPENDS_B" -eq "")) { - $DEPENDS_B = "full" - } elseif (!("$DEPENDS_B2" -eq "")) { - $DEPENDS_B = "no" - } else { - $DEPENDS_B = "yes" - } - "Right now: $DEPENDS_B" - $DEPENDS = Read-Host "(full), (yes), (no)" - if ("$DEPENDS" -eq "") { - $DEPENDS = "$DEPENDS_B" - } - if (("$DEPENDS" -eq "full") -or ("$DEPENDS" -eq "f")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -df" - } elseif (("$DEPENDS" -eq "no") -or ("$DEPENDS" -eq "n")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -dd" - } else { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -da" - } - clear-host - - "Use precompiled headers." - "Default is: yes" - "" - $PRECHEADER_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-hd") - if ("$PRECHEADER_B" -eq "") { - $PRECHEADER_B = "yes" - } else { - $PRECHEADER_B = "no" - } - "Right now: $PRECHEADER_B" - $PRECHEADER = Read-Host "(yes), (no)" - if ("$PRECHEADER" -eq "") { - $PRECHEADER = "$PRECHEADER_B" - } - if (("$PRECHEADER" -eq "no") -or ("$PRECHEADER" -eq "n")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -hd" - } - clear-host - - "Let make handle creation of install directories. Rbuild will not generate" - "the directories." - "Default is: no" - "" - $MAKEDIR_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-mi") - if ("$MAKEDIR_B" -eq "") { - $MAKEDIR_B = "no" - } else { - $MAKEDIR_B = "yes" - } - "Right now: $MAKEDIR_B" - $MAKEDIR = Read-Host "(yes), (no)" - if ("$MAKEDIR" -eq "") { - $MAKEDIR = "$MAKEDIR_B" - } - if (("$MAKEDIR" -eq "yes") -or ("$MAKEDIR" -eq "y")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -mi" - } - clear-host - - "Generate proxy makefiles in source tree instead of the output tree." - "Default is: no" - "" - $PROXYMAKE_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-ps") - if ("$PROXYMAKE_B" -eq "") { - $PROXYMAKE_B = "no" - } else { - $PROXYMAKE_B = "yes" - } - "Right now: $PROXYMAKE_B" - $PROXYMAKE = Read-Host "(yes), (no)" - if ("$PROXYMAKE" -eq "") { - $PROXYMAKE = "$PROXYMAKE_B" - } - if (("$PROXYMAKE" -eq "yes") -or ("$PROXYMAKE" -eq "y")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -ps" - } - clear-host - - "Use compilation units." - "Default is: yes" - "" - $COMPUNITS_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-ud") - if ("$COMPUNITS_B" -eq "") { - $COMPUNITS_B = "yes" - } else { - $COMPUNITS_B = "no" - } - "Right now: $COMPUNITS_B" - $COMPUNITS = Read-Host "(yes), (no)" - if ("$COMPUNITS" -eq "") { - $COMPUNITS = "$COMPUNITS_B" - } - if (("$COMPUNITS" -eq "no") -or ("$COMPUNITS" -eq "n")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -ud" - } - clear-host - - "Input XML." - "Default is: no" - "" - $XML_B = (select-string -path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" -pattern "-r") - if ("$XML_B" -eq "") { - $XML_B = "no" - } else { - $XML_B = "yes" - } - "Right now: $XML_B" - $XML = Read-Host "(yes), (no)" - if ("$XML" -eq "") { - $XML = "$XML_B" - } - if (("$XML" -eq "yes") -or ("$XML" -eq "y")) { - $RBUILDFLAGS = "$RBUILDFLAGS" + " -r" - } - clear-host - "$RBUILDFLAGS" > "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" - $ENV:ROS_RBUILDFLAGS = $RBUILDFLAGS -} - -# Receive the first Parameter and decide what to do. -if ("$args" -eq "delete") { - "config.rbuild will be permanently deleted. All your settings will be gone." - "Continue?" - $YESNO = Read-Host "(yes), (no)" - if (("$YESNO" -eq "yes") -or ("$YESNO" -eq "y")) { - if (Test-Path ".\config.rbuild") { - remove-item ".\config.rbuild" - "Main Configuration File was found and deleted." - } else { - "Main Configuration File was not found in ReactOS Source Tree." - } - if (Test-Path "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild") { - remove-item "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" - "Working Configuration File was found and deleted." - } else { - "Working Configuration File was not found in ReactOS Source Tree." - } - if (Test-Path "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG") { - remove-item "$ENV:APPDATA\RosBE\RBUILDFLAGS-$_ROSBE_VERSION.FLG" - $ENV:ROS_RBUILDFLAGS = "" - "RBuild Flags File was found and deleted." - } else { - "RBuild Flags File was not found in ReactOS Source Tree." - } - } - settitle -} -elseif ("$args" -eq "update") { - "old config.rbuild will be deleted and will be updated with a recent," - "default one. You will need to reconfigure it to your wishes later." - "Continue?" - $YESNO = Read-Host "(yes), (no)" - if (("$YESNO" -eq "yes") -or ("$YESNO" -eq "y")) { - remove-item "$_ROSBE_BASEDIR\*.rbuild" - remove-item ".\config.rbuild" - copy-item ".\config.template.rbuild" "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" - "Successfully Updated." - } - settitle -} -elseif ("$args" -eq "rbuild") { - rbuild - settitle -} -elseif ("$args" -ne "") { - "Unknown parameter specified. Try 'help config'." - settitle -} - -# Check if config.rbuild already exists. If not, get a working copy. -if (!(Test-Path "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild")) { - copy-item ".\config.template.rbuild" "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" -} - -# Help prevent non-useful bug reports/questions. -"" -"*** Configurations other than release/debug are not useful for ***" -"*** posting bug reports, and generally not very useful for ***" -"*** IRC/Forum discussion. Please refrain from doing so unless ***" -"*** you are sure about what you are doing. ***" -"" - -$YESNO = Read-Host "(yes), (no)" -if (("$YESNO" -ne "yes") -and ("$YESNO" -ne "y")) {settitle} - -# Check if config.template.rbuild is newer than config.rbuild, if it is then -# inform the user and offer an update. -if (Test-Path ".\config.rbuild") { - if ((gi .\config.template.rbuild).LastWriteTime -gt (gi .\config.rbuild).LastWriteTime) { - "" - "*** config.template.rbuild is newer than working config.rbuild ***" - "*** The Editor cannot continue with this file. Do you wanna ***" - "*** update to the most recent one? You need to reset all your ***" - "*** previously made settings. ***" - "" - $YESNO = Read-Host "(yes), (no)" - if (("$YESNO" -eq "yes") -or ("$YESNO" -eq "y")) {remove-item "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" | remove-item ".\config.rbuild" | copy-item ".\config.template.rbuild" "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild"} - else {settitle} - } -} - -# Prepare XML Parser. -[xml]$xml = get-content "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" - -# Start with reading settings from config.rbuild and let the user edit them. -"Sub-Architecture to build for." -"Default is: none" -"" -$SARCH = $xml.group.property | ? { $_.Name -eq "SARCH" } | % { $_.Value} -"Right now: $SARCH" -$SARCH_CH = Read-Host "(), (xbox)" -clear-host - -"Generate instructions for this CPU type. Specify one of:" -"" -"Intel: i386, i486, i586, pentium, pentium-mmx, i686, pentiumpro, pentium2" -" pentium3, pentium3m, pentium-m, pentium4, pentium4m, prescott, nocona" -" core2" -"AMD: k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp, athlon-mp, k8" -" opteron, athlon64, athlon-fx, opteron-sse3, barcelona, geode" -"IDT: winchip-c6, winchip2" -"VIA: c3, c3-2" -"Default is: pentium" -"" -$OARCH = $xml.group.property | ? { $_.Name -eq "OARCH" } | % { $_.Value} -"Right now: $OARCH" -$OARCH_CH = Read-Host -if ("$OARCH_CH" -eq "") { - $OARCH_CH = $OARCH -} -clear-host - -"Which CPU ReactOS should be optimized for. Specify one of the above CPUs or" -"generic. When this option is not used, GCC will optimize for the processor" -"specified by OARCH." -"Default is: i686" -"" -$TUNE = $xml.group.property | ? { $_.Name -eq "TUNE" } | % { $_.Value} -"Right now: $TUNE" -$TUNE_CH = Read-Host -if ("$TUNE_CH" -eq "") { - $TUNE_CH = $TUNE -} -clear-host - -"What level do you want ReactOS to be optimized at." -"This setting does not work if GDB is set." -"0 = off" -"1 = Normal compiling. Recommended. It is the default setting in" -"official release builds and debug builds." -"warning : 2,3,4,5 is not tested on ReactOS. Change at own risk." -"" -$OPTIMIZE = $xml.group.property | ? { $_.Name -eq "OPTIMIZE" } | % { $_.Value} -"Right now: $OPTIMIZE" -$OPTIMIZE_CH = Read-Host "(0), (1), (2), (3), (4), (5)" -if ("$OPTIMIZE_CH" -eq "") { - $OPTIMIZE_CH = $OPTIMIZE -} -clear-host - -"Whether to compile in the integrated kernel debugger." -"Default is: 1" -"" -$KDBG = $xml.group.property | ? { $_.Name -eq "KDBG" } | % { $_.Value} -"Right now: $KDBG" -$KDBG_CH = Read-Host "(0), (1)" -if ("$KDBG_CH" -eq "") { - $KDBG_CH = $KDBG -} -clear-host - -"Whether to compile for debugging. No compiler optimizations will be" -"performed." -"Default is: 1" -"" -$DBG = $xml.group.property | ? { $_.Name -eq "DBG" } | % { $_.Value} -"Right now: $DBG" -$DBG_CH = Read-Host "(0), (1)" -if ("$KDBG_CH" -eq "") { - $DBG_CH = $DBG -} -clear-host - -"Whether to compile for debugging with GDB. If you don't use GDB," -"don't enable this." -"Default is: 0" -"" -$GDB = $xml.group.property | ? { $_.Name -eq "GDB" } | % { $_.Value} -"Right now: $GDB" -$GDB_CH = Read-Host "(0), (1)" -if ("$GDB_CH" -eq "") { - $GDB_CH = $GDB -} -clear-host - -"Whether to compile apps/libs with features covered software patents" -"or not. If you live in a country where software patents are" -"valid/apply, don't enable this (except they/you purchased a license" -"from the patent owner)." -"Default is: 0" -"" -$NSWPAT = $xml.group.property | ? { $_.Name -eq "NSWPAT" } | % { $_.Value} -"Right now: $NSWPAT" -$NSWPAT_CH = Read-Host "(0), (1)" -if ("$NSWPAT_CH" -eq "") { - $NSWPAT_CH = $NSWPAT -} -clear-host - -"Whether to compile with the KD protocol. This will disable support for" -"KDBG as well as rossym and symbol lookups, and allow WinDBG to connect" -"to ReactOS. This is currently not fully working, and requires kdcom" -"from Windows 2003 or TinyKRNL. Booting into debug mode with this flag" -"enabled will result in a failure to enter GUI mode. Do not enable" -"unless you know what you're doing." -"Default is: 0" -"" -$WINKD = $xml.group.property | ? { $_.Name -eq "_WINKD_" } | % { $_.Value} -"Right now: $WINKD" -$WINKD_CH = Read-Host "(0), (1)" -if ("$WINKD_CH" -eq "") { - $WINKD_CH = $WINKD -} -clear-host - -"Whether to compile support for ELF files. Do not enable unless you know what" -"you're doing." -"Default is: 0" -"" -$ELF = $xml.group.property | ? { $_.Name -eq "_ELF_" } | % { $_.Value} -"Right now: $ELF" -$ELF_CH = Read-Host "(0), (1)" -if ("$ELF_CH" -eq "") { - $ELF_CH = $ELF -} -clear-host - -"Whether to compile the multi processor versions for ntoskrnl and hal." -"Default is: 1" -"" -$BUILD_MP = $xml.group.property | ? { $_.Name -eq "BUILD_MP" } | % { $_.Value} -"Right now: $BUILD_MP" -$BUILD_MP_CH = Read-Host "(0), (1)" -if ("$BUILD_MP_CH" -eq "") { - $BUILD_MP_CH = $BUILD_MP -} -clear-host - -# Generate a config.rbuild, copy it to the Source Tree and delete temp files. -$xml.group.property | ? { $_.Name -eq "SARCH" } | % { $_.Value = "$SARCH_CH"} -$xml.group.property | ? { $_.Name -eq "OARCH" } | % { $_.Value = "$OARCH_CH"} -$xml.group.property | ? { $_.Name -eq "TUNE" } | % { $_.Value = "$TUNE_CH"} -$xml.group.property | ? { $_.Name -eq "OPTIMIZE" } | % { $_.Value = "$OPTIMIZE_CH"} -$xml.group.property | ? { $_.Name -eq "KDBG" } | % { $_.Value = "$KDBG_CH"} -$xml.group.property | ? { $_.Name -eq "DBG" } | % { $_.Value = "$DBG_CH"} -$xml.group.property | ? { $_.Name -eq "GDB" } | % { $_.Value = "$GDB_CH"} -$xml.group.property | ? { $_.Name -eq "NSWPAT" } | % { $_.Value = "$NSWPAT_CH"} -$xml.group.property | ? { $_.Name -eq "_WINKD_" } | % { $_.Value = "$WINKD_CH"} -$xml.group.property | ? { $_.Name -eq "_ELF_" } | % { $_.Value = "$ELF_CH"} -$xml.group.property | ? { $_.Name -eq "BUILD_MP" } | % { $_.Value = "$BUILD_MP_CH"} -$xml.save("$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild") -copy-item "$ENV:APPDATA\RosBE\config-$_ROSBE_VERSION.rbuild" ".\config.rbuild" - -$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - -settitle diff --git a/RosBE-Windows/Powershell/Help.ps1 b/RosBE-Windows/Powershell/Help.ps1 index afd5b06..d905369 100644 --- a/RosBE-Windows/Powershell/Help.ps1 +++ b/RosBE-Windows/Powershell/Help.ps1 @@ -37,10 +37,6 @@ if ("$args" -eq "") { " clean [OPTIONS] - Fully clean the ReactOS source directory and/or the" " RosBE build logs." - if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { - " config [OPTIONS] - Configures the way, ReactOS will be built." - } - " help [COMMAND] - Display the available commands or give help on a" " specific command." @@ -167,17 +163,6 @@ if ("$args" -eq "") { " logs - Removes all build logs in the RosBE-Logs directory." " All other commands will be parsed as ""make ""module""_clean"" and cleans the" " specific module." -} elseif ("$args" -eq "config") { - if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { - " Usage: config [OPTIONS]" - " Creates a configuration file, which tells RosBE how to build the tree." - "" - " delete - Deletes the created configuration file and so sets back to the" - " default settings." - " rbuild - Switches to RBuild Flag setting mode." - " update - Deletes the old created configuration file and updates it with a" - " new, default one." - } } elseif ("$args" -eq "help") { " Usage: help [COMMAND]" " Shows help for the specified command or lists all available commands." diff --git a/RosBE-Windows/Root/Clean.cmd b/RosBE-Windows/Root/Clean.cmd index 5b40912..32e78df 100644 --- a/RosBE-Windows/Root/Clean.cmd +++ b/RosBE-Windows/Root/Clean.cmd @@ -52,10 +52,15 @@ goto :EOF :BIN :: Check if the user set any custom filenames or pathes, otherwise locally set the appropriate variables. -if "%ROS_AUTOMAKE%" == "" (set ROS_AUTOMAKE=makefile-%ROS_ARCH%.auto) -if "%ROS_INTERMEDIATE%" == "" (set ROS_INTERMEDIATE=obj-%ROS_ARCH%) -if "%ROS_OUTPUT%" == "" (set ROS_OUTPUT=output-%ROS_ARCH%) -if "%ROS_CDOUTPUT%" == "" (set ROS_CDOUTPUT=reactos) +if not exist "CMakeLists.txt" ( + if "%ROS_AUTOMAKE%" == "" (set ROS_AUTOMAKE=makefile-%ROS_ARCH%.auto) + if "%ROS_INTERMEDIATE%" == "" (set ROS_INTERMEDIATE=obj-%ROS_ARCH%) + if "%ROS_OUTPUT%" == "" (set ROS_OUTPUT=output-%ROS_ARCH%) + if "%ROS_CDOUTPUT%" == "" (set ROS_CDOUTPUT=reactos) +) else ( + set ROS_INTERMEDIATE=host-tools + set ROS_OUTPUT=reactos +) :: Do some basic sanity checks to verify that we are working in a ReactOS source tree. :: Consider that we also want to clean half-complete builds, so don't depend on too many existing files. @@ -63,10 +68,12 @@ if "%ROS_CDOUTPUT%" == "" (set ROS_CDOUTPUT=reactos) if exist "%ROS_INTERMEDIATE%" ( echo Cleaning ReactOS %ROS_ARCH% source directory... - del "%ROS_AUTOMAKE%" 1>NUL 2>NUL + if not exist "CMakeLists.txt" ( + del "%ROS_AUTOMAKE%" 1>NUL 2>NUL + rd /s /q "%ROS_CDOUTPUT%" 1>NUL 2>NUL + ) rd /s /q "%ROS_INTERMEDIATE%" 1>NUL 2>NUL rd /s /q "%ROS_OUTPUT%" 1>NUL 2>NUL - rd /s /q "%ROS_CDOUTPUT%" 1>NUL 2>NUL echo Done cleaning ReactOS %ROS_ARCH% source directory. ) else ( diff --git a/RosBE-Windows/Root/Config.cmd b/RosBE-Windows/Root/Config.cmd deleted file mode 100644 index ffdf117..0000000 --- a/RosBE-Windows/Root/Config.cmd +++ /dev/null @@ -1,462 +0,0 @@ -:: -:: PROJECT: RosBE - ReactOS Build Environment for Windows -:: LICENSE: GNU General Public License v2. (see LICENSE.txt) -:: FILE: Root/Config.cmd -:: PURPOSE: A Basic Config.rbuild Creator for ReactOS. -:: COPYRIGHT: Copyright 2010 Daniel Reimer -:: - -@echo off -if not defined _ROSBE_DEBUG set _ROSBE_DEBUG=0 -if %_ROSBE_DEBUG% == 1 ( - @echo on -) - -setlocal enabledelayedexpansion -title ReactOS Build Configurator - -if not exist "%APPDATA%\RosBE\RBUILDFLAGS-%_ROSBE_VERSION%.FLG" ( - echo -da> "%APPDATA%\RosBE\RBUILDFLAGS-%_ROSBE_VERSION%.FLG" -) - -:: Receive the first Parameter and decide what to do. -if /i "%1" == "delete" ( - echo config.rbuild will be permanently deleted. All your settings will be gone. - echo Continue? - set /p YESNO="(yes), (no)" - if /i "!YESNO!"=="yes" goto :CONT - if /i "!YESNO!"=="y" goto :CONT - goto :NOK - - :CONT - if exist "config.rbuild" ( - del "config.rbuild" - echo Main Configuration File was found and deleted. - ) else ( - echo Main Configuration File was not found in ReactOS Source Tree. - ) - - if exist "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" ( - del "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" - echo Working Configuration File was found and deleted. - ) else ( - echo Working Configuration File was not found in ReactOS Source Tree. - ) - - if exist "%APPDATA%\RosBE\RBUILDFLAGS-%_ROSBE_VERSION%.FLG" ( - del "%APPDATA%\RosBE\RBUILDFLAGS-%_ROSBE_VERSION%.FLG" - echo RBuild Flags File was found and deleted. - ) else ( - echo RBuild Flags File was not found in ReactOS Source Tree. - ) - - goto :NOK -) - -if /i "%1" == "update" ( - echo old config.rbuild will be deleted and will be updated with a recent, - echo default one. You will need to reconfigure it to your wishes later. - echo Continue? - set /p YESNO="(yes), (no)" - if /i "!YESNO!"=="yes" goto :CONT2 - if /i "!YESNO!"=="y" goto :CONT2 - goto :NOK - - :CONT2 - del "%_ROSBE_BASEDIR%\*.rbuild" - del "config.rbuild" - copy "config.template.rbuild" "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" - echo Successfully Updated. - goto :NOK -) - -if /i "%1" == "rbuild" ( - echo Be verbose. - echo Default is: no - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-v""`) do set VERBOSE_B=%%i - if "!VERBOSE_B!" == "" ( - set VERBOSE_B=no - ) else ( - set VERBOSE_B=yes - ) - echo Right now: !VERBOSE_B! - set /p VERBOSE="(yes), (no)" - if "!VERBOSE!" == "" ( - set VERBOSE=!VERBOSE_B! - ) - if "!VERBOSE!" == "yes" ( - set RBUILDFLAGS=-v - ) - cls - - echo Delete generated files as soon as they are not needed anymore. - echo Default is: no - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-c""`) do set CLEAN_B=%%i - if "!CLEAN_B!" == "" ( - set CLEAN_B=no - ) else ( - set CLEAN_B=yes - ) - echo Right now: !CLEAN_B! - set /p CLEAN="(yes), (no)" - if "!CLEAN!" == "" ( - set CLEAN=!CLEAN_B! - ) - if "!CLEAN!" == "yes" ( - set RBUILDFLAGS=!RBUILDFLAGS! -c - ) - cls - - echo Disable/Enable automatic dependencies. - echo Default is: yes - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-df""`) do set DEPENDS_B=%%i - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-dd""`) do set DEPENDS_B2=%%i - if not "!DEPENDS_B!" == "" ( - set DEPENDS_B=full - ) else if not "!DEPENDS_B2!" == "" ( - set DEPENDS_B=no - ) else ( - set DEPENDS_B=yes - ) - echo Right now: !DEPENDS_B! - set /p DEPENDS="(full), (yes), (no)" - if "!DEPENDS!" == "" ( - set DEPENDS=!DEPENDS_B! - ) - if "!DEPENDS!" == "full" ( - set RBUILDFLAGS=!RBUILDFLAGS! -df - ) else if "!DEPENDS!" == "no" ( - set RBUILDFLAGS=!RBUILDFLAGS! -dd - ) - cls - - echo Use precompiled headers. - echo Default is: yes - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-hd""`) do set PRECHEADER_B=%%i - if "!PRECHEADER_B!" == "" ( - set PRECHEADER_B=yes - ) else ( - set PRECHEADER_B=no - ) - echo Right now: !PRECHEADER_B! - set /p PRECHEADER="(yes), (no)" - if "!PRECHEADER!" == "" ( - set PRECHEADER=!PRECHEADER_B! - ) - if "!PRECHEADER!" == "no" ( - set RBUILDFLAGS=!RBUILDFLAGS! -hd - ) - cls - - echo Let make handle creation of install directories. Rbuild will not generate - echo the directories. - echo Default is: no - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-mi""`) do set MAKEDIR_B=%%i - if "!MAKEDIR_B!" == "" ( - set MAKEDIR_B=no - ) else ( - set MAKEDIR_B=yes - ) - echo Right now: !MAKEDIR_B! - set /p MAKEDIR="(yes), (no)" - if "!MAKEDIR!" == "" ( - set MAKEDIR=!MAKEDIR_B! - ) - if "!MAKEDIR!" == "yes" ( - set RBUILDFLAGS=!RBUILDFLAGS! -mi - ) - cls - - echo Generate proxy makefiles in source tree instead of the output tree. - echo Default is: no - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-ps""`) do set PROXYMAKE_B=%%i - if "!PROXYMAKE_B!" == "" ( - set PROXYMAKE_B=no - ) else ( - set PROXYMAKE_B=yes - ) - echo Right now: !PROXYMAKE_B! - set /p PROXYMAKE="(yes), (no)" - if "!PROXYMAKE!" == "" ( - set PROXYMAKE=!PROXYMAKE_B! - ) - if "!PROXYMAKE!" == "yes" ( - set RBUILDFLAGS=!RBUILDFLAGS! -ps - ) - cls - - echo Use compilation units. - echo Default is: yes - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-ud""`) do set COMPUNITS_B=%%i - if "!COMPUNITS_B!" == "" ( - set COMPUNITS_B=yes - ) else ( - set COMPUNITS_B=no - ) - echo Right now: !COMPUNITS_B! - set /p COMPUNITS="(yes), (no)" - if "!COMPUNITS!" == "" ( - set COMPUNITS=!COMPUNITS_B! - ) - if "!COMPUNITS!" == "no" ( - set RBUILDFLAGS=!RBUILDFLAGS! -ud - ) - cls - - echo Input XML. - echo Default is: no - echo. - for /f "usebackq tokens=* delims= " %%i in (`"echo %ROS_RBUILDFLAGS% | find "-r""`) do set XML_B=%%i - if "!XML_B!" == "" ( - set XML_B=no - ) else ( - set XML_B=yes - ) - echo Right now: !XML_B! - set /p XML="(yes), (no)" - if "!XML!" == "" ( - set XML=!XML_B! - ) - if "!XML!" == "yes" ( - set RBUILDFLAGS=!RBUILDFLAGS! -r - ) - cls - echo !RBUILDFLAGS! > "%APPDATA%\RosBE\RBUILDFLAGS-%_ROSBE_VERSION%.FLG" - set ROS_RBUILDFLAGS=!RBUILDFLAGS! - goto :NOK -) - -if not "%1" == "" ( - echo Unknown parameter specified. Try 'help config'. - goto :NOK -) - -:: Check if config.rbuild already exists. If not, get a working copy. -if not exist "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" ( - copy "config.template.rbuild" "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" -) - -:: Help prevent non-useful bug reports/questions. -echo. -echo *** Configurations other than release/debug are not useful for *** -echo *** posting bug reports, and generally not very useful for *** -echo *** IRC/Forum discussion. Please refrain from doing so unless *** -echo *** you are sure about what you are doing. *** -echo. - -set /p YESNO="(yes), (no)" -if /i "%YESNO%"=="yes" goto :OK -if /i "%YESNO%"=="y" goto :OK -goto :NOK - -:OK -:: Check if config.template.rbuild is newer than config.rbuild, if it is then -:: inform the user and offer an update. -if exist ".\config.rbuild" ( - chknewer.exe config.template.rbuild config.rbuild - if !errorlevel! == 1 ( - echo. - echo *** config.template.rbuild is newer than working config.rbuild *** - echo *** The Editor cannot continue with this file. Do you wanna *** - echo *** update to the most recent one? You need to reset all your *** - echo *** previously made settings. *** - echo. - set /p YESNO="(yes), (no)" - if /i "!YESNO!"=="yes" goto :YES - if /i "!YESNO!"=="y" goto :YES - goto :NOK - :YES - del "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" - del "config.rbuild" - copy "config.template.rbuild" "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" - goto :OK - ) -) - - -:: Start with reading settings from config.rbuild and let the user edit them. -echo Sub-Architecture to build for. -echo Default is: none -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "SARCH" | find "property name""`) do set SARCH=%%i -set SARCH=%SARCH:~7,-1% -echo Right now: %SARCH% -set /p SARCH_CH="(), (xbox)" -cls - -echo Generate instructions for this CPU type. Specify one of: -echo. -echo Intel: i386, i486, i586, pentium, pentium-mmx, i686, pentiumpro, pentium2 -echo pentium3, pentium3m, pentium-m, pentium4, pentium4m, prescott, nocona -echo core2 -echo AMD: k6, k6-2, k6-3, athlon, athlon-tbird, athlon-4, athlon-xp, athlon-mp, k8 -echo opteron, athlon64, athlon-fx, opteron-sse3, barcelona, geode -echo IDT: winchip-c6, winchip2 -echo VIA: c3, c3-2 -echo Default is: pentium -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "OARCH" | find "property name""`) do set OARCH=%%i -set OARCH=%OARCH:~7,-1% -echo Right now: %OARCH% -set /p OARCH_CH= -if "%OARCH_CH%" == "" ( - set OARCH_CH=%OARCH% -) -cls - -echo Which CPU ReactOS should be optimized for. Specify one of the above CPUs or -echo generic. When this option is not used, GCC will optimize for the processor -echo specified by OARCH. -echo Default is: i686 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "TUNE" | find "property name""`) do set TUNE=%%i -set TUNE=%TUNE:~7,-1% -echo Right now: %TUNE% -set /p TUNE_CH= -if "%TUNE_CH%" == "" ( - set TUNE_CH=%TUNE% -) -cls - -echo What level do you want ReactOS to be optimized at. -echo This setting does not work if GDB is set. -echo 0 = off -echo 1 = Normal compiling. Recommended. It is the default setting in -echo official release builds and debug builds. -echo warning : 2,3,4,5 is not tested on ReactOS. Change at own risk. -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "OPTIMIZE" | find "property name""`) do set OPTIMIZE=%%i -set OPTIMIZE=%OPTIMIZE:~7,-1% -echo Right now: %OPTIMIZE% -set /p OPTIMIZE_CH="(0), (1), (2), (3), (4), (5)" -if "%OPTIMIZE_CH%" == "" ( - set OPTIMIZE_CH=%OPTIMIZE% -) -cls - -echo Whether to compile in the integrated kernel debugger. -echo Default is: 1 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "KDBG" | find "property name""`) do set KDBG=%%i -set KDBG=%KDBG:~7,-1% -echo Right now: %KDBG% -set /p KDBG_CH="(0), (1)" -if "%KDBG_CH%" == "" ( - set KDBG_CH=%KDBG% -) -cls - -echo Whether to compile for debugging. No compiler optimizations will be -echo performed. -echo Default is: 1 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "DBG" | find "property name" | find /V "KDBG""`) do set DBG=%%i -set DBG=%DBG:~7,-1% -echo Right now: %DBG% -set /p DBG_CH="(0), (1)" -if "%DBG_CH%" == "" ( - set DBG_CH=%DBG% -) -cls - -echo Whether to compile for debugging with GDB. If you don't use GDB, -echo don't enable this. -echo Default is: 0 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "GDB" | find "property name""`) do set GDB=%%i -set GDB=%GDB:~7,-1% -echo Right now: %GDB% -set /p GDB_CH="(0), (1)" -if "%GDB_CH%" == "" ( - set GDB_CH=%GDB% -) -cls - -echo Whether to compile apps/libs with features covered software patents -echo or not. If you live in a country where software patents are -echo valid/apply, don't enable this (except they/you purchased a license -echo from the patent owner). -echo Default is: 0 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "NSWPAT" | find "property name""`) do set NSWPAT=%%i -set NSWPAT=%NSWPAT:~7,-1% -echo Right now: %NSWPAT% -set /p NSWPAT_CH="(0), (1)" -if "%NSWPAT_CH%" == "" ( - set NSWPAT_CH=%NSWPAT% -) -cls - -echo Whether to compile with the KD protocol. This will disable support for -echo KDBG as well as rossym and symbol lookups, and allow WinDBG to connect -echo to ReactOS. This is currently not fully working, and requires kdcom -echo from Windows 2003 or TinyKRNL. Booting into debug mode with this flag -echo enabled will result in a failure to enter GUI mode. Do not enable -echo unless you know what you're doing. -echo Default is: 0 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "_WINKD_" | find "property name""`) do set WINKD=%%i -set WINKD=%WINKD:~7,-1% -echo Right now: %WINKD% -set /p WINKD_CH="(0), (1)" -if "%WINKD_CH%" == "" ( - set WINKD_CH=%WINKD% -) -cls - -echo Whether to compile support for ELF files. Do not enable unless you know what -echo you're doing. -echo Default is: 0 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "_ELF_" | find "property name""`) do set ELF=%%i -set ELF=%ELF:~7,-1% -echo Right now: %ELF% -set /p ELF_CH="(0), (1)" -if "%ELF_CH%" == "" ( - set ELF_CH=%ELF% -) -cls - -echo Whether to compile the multi processor versions for ntoskrnl and hal. -echo Default is: 1 -echo. -for /f "usebackq tokens=3" %%i in (`"type "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" | find "BUILD_MP" | find "property name""`) do set BUILD_MP=%%i -set BUILD_MP=%BUILD_MP:~7,-1% -echo Right now: %BUILD_MP% -set /p BUILD_MP_CH="(0), (1)" -if "%BUILD_MP_CH%" == "" ( - set BUILD_MP_CH=%BUILD_MP% -) -cls - -:: Generate a config.rbuild, copy it to the Source Tree and delete temp files. -echo ^>%TEMP%\config.tmp -echo ^>%TEMP%\config.tmp -echo ^>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp -echo ^>>%TEMP%\config.tmp - -copy "%TEMP%\config.tmp" "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" >NUL -del %TEMP%\config.tmp -copy "%APPDATA%\RosBE\config-%_ROSBE_VERSION%.rbuild" "config.rbuild" >NUL - -:NOK -title ReactOS Build Environment %_ROSBE_VERSION% -endlocal & set ROS_RBUILDFLAGS=%RBUILDFLAGS% diff --git a/RosBE-Windows/Root/Help.cmd b/RosBE-Windows/Root/Help.cmd index c125594..3a069d9 100644 --- a/RosBE-Windows/Root/Help.cmd +++ b/RosBE-Windows/Root/Help.cmd @@ -45,10 +45,6 @@ if "%1" == "" ( echo clean [OPTIONS] - Fully clean the ReactOS source directory and/or the echo RosBE build logs. - if exist "%_ROSBE_BASEDIR%\Config.cmd" ( - echo config [OPTIONS] - Configures the way, ReactOS will be built. - ) - echo help [COMMAND] - Display the available commands or give help on a echo specific command. @@ -174,17 +170,6 @@ if "%1" == "" ( echo logs - Removes all build logs in the RosBE-Logs directory. echo All other commands will be parsed as "make module_clean" and cleans the echo specific module. -) else if /i "%1" == "config" ( - if exist "%_ROSBE_BASEDIR%\Config.cmd" ( - echo Usage: config [OPTIONS] - echo Creates a configuration file, which tells RosBE how to build the tree. - echo. - echo delete - Deletes the created configuration file and so sets back to default - echo settings. - echo rbuild - Switches to RBuild Flag setting mode. - echo update - Deletes the old created configuration file and updates it with a - echo new, default one. - ) ) else if /i "%1" == "help" ( echo Usage: help [COMMAND] echo Shows help for the specified command or lists all available commands.