Employ make/gcc on Appveyor + push artifacts (#596)

diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml
index c342001..62e593b 100644
--- a/scripts/appveyor.yml
+++ b/scripts/appveyor.yml
@@ -1,65 +1,59 @@
 environment:

   matrix:

-    - BUILD_SYSTEM: CMake

-      GENERATOR: Visual Studio 14 2015 Win64

+  - BUILD_SYSTEM: CMake

+    GENERATOR: Visual Studio 14 2015 Win64

 

-    - BUILD_SYSTEM: CMake

-      GENERATOR: Visual Studio 14 2015

+  - BUILD_SYSTEM: CMake

+    GENERATOR: Visual Studio 14 2015

 

-    - BUILD_SYSTEM: CMake

-      GENERATOR: Visual Studio 12 2013 Win64

+  - BUILD_SYSTEM: Python

+    PYTHON: "C:\\Python27"

+    PYTHON_VERSION: "2.7.x"

+    PYTHON_ARCH: "32"

 

-    - BUILD_SYSTEM: CMake

-      GENERATOR: Visual Studio 12 2013

+  - BUILD_SYSTEM: Python

+    PYTHON: "C:\\Python36-x64"

+    PYTHON_VERSION: "3.6.x"

+    PYTHON_ARCH: "64"

 

-    - BUILD_SYSTEM: Python

-      PYTHON: "C:\\Python27"

-      PYTHON_VERSION: "2.7.x"

-      PYTHON_ARCH: "32"

+  - BUILD_SYSTEM: make

+    ARCH: "i686"

 

-    - BUILD_SYSTEM: Python

-      PYTHON: "C:\\Python36"

-      PYTHON_VERSION: "3.6.x"

-      PYTHON_ARCH: "32"

-

-    - BUILD_SYSTEM: Python

-      PYTHON: "C:\\Python27-x64"

-      PYTHON_VERSION: "2.7.x"

-      PYTHON_ARCH: "64"

-

-    - BUILD_SYSTEM: Python

-      PYTHON: "C:\\Python36-x64"

-      PYTHON_VERSION: "3.6.x"

-      PYTHON_ARCH: "64"

+  - BUILD_SYSTEM: make

+    ARCH: "x86_64"

 

 install:

-  - ps: |

-      if ($env:BUILD_SYSTEM -eq "Python") {

-        # prepend Python to the PATH

-        $env:Path = $env:PYTHON + ';' + $env:PYTHON + '\\Scripts;' + $env:PATH

-

-        # upgrade pip to avoid out-of-date warnings

-        pip install --disable-pip-version-check --user --upgrade pip

-

-        # install/upgrade setuptools to build packages

-        pip install --upgrade setuptools

-      }

+- IF "%BUILD_SYSTEM%"=="Python" (

+    SET "PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" &&

+    pip install --disable-pip-version-check --user --upgrade pip &&

+    pip install --upgrade setuptools

+  )

+- IF "%BUILD_SYSTEM%"=="make" (

+    IF "%ARCH%"=="i686" (

+      SET "TOOLCHAIN=i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32"

+    ) ELSE (

+      SET "TOOLCHAIN=x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64"

+    )

+  )

 

 before_build:

-  - ps: |

-      if ($env:BUILD_SYSTEM -eq "CMake") {

-        mkdir builddir

-        cd builddir

-

-        cmake -G "$env:GENERATOR" ..

-      }

+- IF "%BUILD_SYSTEM%"=="CMake" ( mkdir builddir && cd builddir && cmake -G "%GENERATOR%" .. )

+- IF "%BUILD_SYSTEM%"=="make" (

+    SET "CC=gcc" &&

+    SET "PATH=C:\mingw-w64\%TOOLCHAIN%\bin;%PATH%" &&

+    COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\%TOOLCHAIN%\bin\make.exe

+  )

 

 build_script:

-  - ps: |

-      if ($env:BUILD_SYSTEM -eq "CMake") {

-        cmake --build . --config Debug

-      }

+- IF "%BUILD_SYSTEM%"=="CMake" ( cmake --build . --config Debug )

+- IF "%BUILD_SYSTEM%"=="Python" ( python setup.py build_ext )

+- IF "%BUILD_SYSTEM%"=="make" (

+    sh -c "make brotli" &&

+    cd bin && 7z a -tzip -mx9 brotli-win-%ARCH%.zip brotli.exe &&

+    appveyor PushArtifact brotli-win-%ARCH%.zip && cd ..

+  )

 

 test_script:

-  - if "%BUILD_SYSTEM%" == "CMake" ( ctest --output-on-failure --interactive-debug-mode 0 -C Debug )

-  - if "%BUILD_SYSTEM%" == "Python" ( python setup.py test )

+- IF "%BUILD_SYSTEM%"=="CMake" ( ctest --output-on-failure --interactive-debug-mode 0 -C Debug )

+- IF "%BUILD_SYSTEM%"=="Python" ( python setup.py test )

+- IF "%BUILD_SYSTEM%"=="make" ( sh -c "make test" )