Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jun 23, 2021
0 parents commit 1e9e7b5
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on: workflow_dispatch

jobs:
build:
name: Build
runs-on: windows-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
# install: git mingw-w64-x86_64-toolchain

- name: Build x86
shell: cmd
run: call build.bat x86

- name: Build x64
shell: cmd
run: call build.bat

- uses: actions/upload-artifact@v2
with:
name: gnumake
path: |
./dist
if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
make-*
/dist
42 changes: 42 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@echo off

set arch=
set vcvars=

:next-arg
if "%1"=="" goto args-done
if /i "%1"=="x86" set arch=x86&set vcvars=vcvars32.bat&goto arg-ok
if /i "%1"=="x64" set arch=x64&set vcvars=vcvars64.bat&goto arg-ok

:arg-ok
shift
goto next-arg

:args-done
if "%arch%" == "" set arch=x64& set vcvars=vcvars64.bat

if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%"
) else (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\%vcvars%"
)

set Path=%Path%;C:\msys64\usr\bin

set tag=4.3
set name=make-%tag%
set zipname=%name%.zip

echo tag: %tag%

if not exist %zipname% powershell.exe -nologo -noprofile -command "& { (new-object System.Net.WebClient).DownloadFile('https://github.com/mirror/make/archive/refs/tags/%tag%.zip', '%zipname%'); exit !$?; }"
if exist %name% rd /s /q %name%
powershell.exe -nologo -noprofile -command "& { param([String]$sourceArchiveFileName, [String]$destinationDirectoryName); Add-Type -A 'System.IO.Compression.FileSystem'; Add-Type -A 'System.Text.Encoding'; [IO.Compression.ZipFile]::ExtractToDirectory($sourceArchiveFileName, $destinationDirectoryName, [System.Text.Encoding]::UTF8); exit !$?; }" -sourceArchiveFileName "%zipname%" -destinationDirectoryName "."

cd "%name%"

call bootstrap.bat
call build_w32.bat
cd ..
if not exist .\dist mkdir .\dist
copy /Y "%name%\WinRel\gnumake.exe" "dist\gnumake-msvc-%arch%.exe"

0 comments on commit 1e9e7b5

Please sign in to comment.