aboutsummaryrefslogtreecommitdiffstats
path: root/dist/mcode/windows
diff options
context:
space:
mode:
Diffstat (limited to 'dist/mcode/windows')
-rw-r--r--dist/mcode/windows/compile-ghdl.ps19
-rw-r--r--dist/mcode/windows/compile-libraries.ps12
-rw-r--r--dist/mcode/windows/targets.psm162
3 files changed, 15 insertions, 58 deletions
diff --git a/dist/mcode/windows/compile-ghdl.ps1 b/dist/mcode/windows/compile-ghdl.ps1
index 51fd0a1d5..2938683db 100644
--- a/dist/mcode/windows/compile-ghdl.ps1
+++ b/dist/mcode/windows/compile-ghdl.ps1
@@ -228,15 +228,6 @@ if ($Compile_GHDL)
{ Write-Host " [FAILED]" -ForegroundColor Red
Exit-CompileScript -1
}
-
- # restore the version file if it was patched
- if (-not $Release -and $Git_IsGitRepo)
- { $error = Restore-PatchedVersionFile $GHDLRootDir
- if ($error -eq $true)
- { Write-Host " [FAILED]" -ForegroundColor Red
- Exit-CompileScript -1
- }
- }
}
diff --git a/dist/mcode/windows/compile-libraries.ps1 b/dist/mcode/windows/compile-libraries.ps1
index 8a7ce2d4a..597c7f237 100644
--- a/dist/mcode/windows/compile-libraries.ps1
+++ b/dist/mcode/windows/compile-libraries.ps1
@@ -187,7 +187,7 @@ if (-not $Hosted)
}
if ($Clean)
-{ Write-Host "Removing all created files and directories..."
+{ Write-Host "Removing all created files and directories..." -ForegroundColor Yellow
if (Test-Path -Path $VHDLDestinationLibraryDirectory)
{ $EnableVerbose -and (Write-Host " rmdir $VHDLDestinationLibraryDirectory") | Out-Null
Remove-Item $VHDLDestinationLibraryDirectory -Force -Recurse -ErrorAction SilentlyContinue
diff --git a/dist/mcode/windows/targets.psm1 b/dist/mcode/windows/targets.psm1
index 5dfd12b0b..813873482 100644
--- a/dist/mcode/windows/targets.psm1
+++ b/dist/mcode/windows/targets.psm1
@@ -49,7 +49,8 @@ $WinMcodeSourceDirName = "dist\mcode\windows"
# $WinLLVMSourceDirName = "dist\llvm\windows"
# construct file paths
-$VersionFileName = "version.ads"
+$VersionFileName_In = "version.in"
+$VersionFileName_Ads = "version.ads"
function Invoke-Clean
@@ -126,7 +127,7 @@ function Get-GHDLVersion
)
# construct DirectoryPaths
$SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
- $VersionFilePath = $SourceDirectory + "\" + $VersionFileName
+ $VersionFilePath = $SourceDirectory + "\" + $VersionFileName_In
if (-not (Test-Path -Path $VersionFilePath -PathType Leaf))
{ Write-Host "[ERROR]: Version file '$VersionFilePath' does not exists." -ForegroundColor Red
@@ -165,68 +166,33 @@ function Invoke-PatchVersionFile
[switch] $Quiet = $false
)
# construct DirectoryPaths
- $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
- $CurrentVersionFilePath = $SourceDirectory + "\" + $VersionFileName
- $OriginalVersionFilePath = $SourceDirectory + "\" + $VersionFileName + ".bak"
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+ $VersionInputFilePath = $SourceDirectory + "\" + $VersionFileName_In
+ $VersionFilePath = $SourceDirectory + "\" + $VersionFileName_Ads
Write-Host "Executing build target 'PatchVersionFile' ..." -ForegroundColor Yellow
- if (-not (Test-Path -Path $CurrentVersionFilePath -PathType Leaf))
- { Write-Host "[ERROR]: Version file '$CurrentVersionFilePath' does not exists." -ForegroundColor Red
+ if (-not (Test-Path -Path $VersionInputFilePath -PathType Leaf))
+ { Write-Host "[ERROR]: Version file '$VersionInputFilePath' does not exists." -ForegroundColor Red
return $true
}
- -not $Quiet -and (Write-Host " Patching '$CurrentVersionFilePath'.") | Out-Null
- $FileContent = Get-Content -Path $CurrentVersionFilePath -Encoding Ascii
+ -not $Quiet -and (Write-Host " Patching '$VersionInputFilePath'.") | Out-Null
+ $FileContent = Get-Content -Path $VersionInputFilePath -Encoding Ascii
if ($? -eq $false)
- { Write-Host "[ERROR]: While opening '$CurrentVersionFilePath'." -ForegroundColor Red
+ { Write-Host "[ERROR]: While opening '$VersionInputFilePath'." -ForegroundColor Red
return $true
}
- $FileContent = $FileContent -Replace "\s\(\d+\)\s", " (commit: $GitCommitDataString; git branch: $GitBranchName'; hash: $GitCommitHash) "
+ $FileContent = $FileContent -Replace "\s\(tarball\)\s", " (commit: $GitCommitDataString; git branch: $GitBranchName'; hash: $GitCommitHash) "
- Move-Item $CurrentVersionFilePath $OriginalVersionFilePath -Force
- $FileContent | Out-File $CurrentVersionFilePath -Encoding Ascii
+ $FileContent | Out-File $VersionFilePath -Encoding Ascii
if ($? -eq $false)
- { Write-Host "[ERROR]: While writing to '$CurrentVersionFilePath'." -ForegroundColor Red
+ { Write-Host "[ERROR]: While writing to '$VersionFilePath'." -ForegroundColor Red
return $true
}
return $false
} # Invoke-PatchVersionFile
-function Restore-PatchedVersionFile
-{ <#
- .SYNOPSIS
- This CommandLet restores the original version file.
- .PARAMETER GHDLRootDir
- The repository root directory.
- .PARAMETER Quiet
- Disable outputs to the host console.
- #>
- [CmdletBinding()]
- param(
- [string] $GHDLRootDir,
- [switch] $Quiet = $false
- )
- # construct DirectoryPaths
- $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
- $CurrentVersionFilePath = $SourceDirectory + "\" + $VersionFileName
- $OriginalVersionFilePath = $SourceDirectory + "\" + $VersionFileName + ".bak"
-
- Write-Host "Executing build target 'PatchedVersionFile' ..." -ForegroundColor Yellow
-
- if (-not (Test-Path -Path "$OriginalVersionFilePath" -PathType Leaf))
- { Write-Host "[ERROR]: Original version file '$OriginalVersionFilePath' does not exists." -ForegroundColor Red
- return $true
- }
- -not $Quiet -and (Write-Host " Restoring '$CurrentVersionFilePath'.") | Out-Null
- Move-Item $OriginalVersionFilePath $CurrentVersionFilePath -Force
- if ($? -eq $false)
- { Write-Host "[ERROR]: While moving '$OriginalVersionFilePath' to '$CurrentVersionFilePath'." -ForegroundColor Red
- return $true
- }
-
- return $false
-} # Restore-PatchedVersionFile
function Get-CFlags
{ <#