4
# Licensed to the Apache Software Foundation (ASF) under one
5
# or more contributor license agreements. See the NOTICE file
6
# distributed with this work for additional information
7
# regarding copyright ownership. The ASF licenses this file
8
# to you under the Apache License, Version 2.0 (the
9
# "License"); you may not use this file except in compliance
10
# with the License. You may obtain a copy of the License at
12
# http://www.apache.org/licenses/LICENSE-2.0
14
# Unless required by applicable law or agreed to in writing,
15
# software distributed under the License is distributed on an
16
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
# KIND, either express or implied. See the License for the
18
# specific language governing permissions and limitations
23
@rem **************************************************************************
24
@rem * --== WARNING ==-- This is a generated file. Do not edit!
26
@rem * From this directory, run this batch file like so:
28
@rem * .\build_zlib debug|release Win32|X64 [rebuild|clean]
30
@rem **************************************************************************
32
@rem **************************************************************************
35
set zlib_version=[zlib_version]
37
if /i "%1" == "release" goto release
38
if /i "%1" == "debug" goto debug
42
if /i "%2" == "Win32" goto PWin32
43
if /i "%2" == "x64" goto PX64
49
@rem **************************************************************************
50
@rem Compile ASM sources with ML
51
set ASFLAGS=-nologo -Zi -coff
52
set LOC=-DASMV -DASMINF
53
[is zlib_version "1.2.4"]
54
set OBJA=contrib\masmx86\gvmat32c.obj contrib\masmx86\gvmat32.obj contrib\masmx86\inffas32.obj
55
set ASM_OPTS=ASFLAGS="%ASFLAGS%" LOC="%LOC%" OBJA="%OBJA%"
57
if /i "%2" == "Win32" (
58
set ASM_OPTS=LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj" "AS=ml -safeseh"
59
) else if /i "%2" == "x64" (
60
set ASM_OPTS=LOC="-DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" AS=ml64
66
if /i "%3" == "rebuild" goto rebuild
67
if /i "%3" == "clean" goto clean
68
if not "%3" == "" goto pIIIerr
69
set target= %STATICLIB%
73
set target=clean %STATICLIB%
80
@rem **************************************************************************
82
set STATICLIB=zlibstat.lib
83
set CC_OPTS=/MD /O2 /Zi
86
@rem **************************************************************************
88
set STATICLIB=zlibstatD.lib
89
set CC_OPTS=/MDd /Gm /ZI /Od /GZ /D_DEBUG
92
@rem **************************************************************************
96
@rem **************************************************************************
100
@rem **************************************************************************
102
set COMMON_CC_OPTS=/nologo /W3 /DWIN32 /D_WINDOWS
103
[is zlib_version "1.2.4"]
104
set CFLAGS=%COMMON_CC_OPTS% %CC_OPTS% %LOC%
105
set BUILD_OPTS=%ASM_OPTS% CFLAGS="%COMMON_CC_OPTS% %CC_OPTS% %LOC%"
107
set BUILD_OPTS=%ASM_OPTS%
109
@echo nmake /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target%
110
nmake /nologo /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target%
111
if errorlevel 1 goto err
114
@rem **************************************************************************
116
echo error: First parameter should be "release" or "debug"
119
@rem **************************************************************************
121
echo error: Second parameter should be "Win32" or "X64"
125
@rem **************************************************************************
127
echo error: Third parameter should be "rebuild" or empty
130
@rem **************************************************************************