| [define COPYRIGHT] |
| # |
| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| # |
| # |
| [end]@echo off |
| @rem ************************************************************************** |
| @rem * --== WARNING ==-- This is a generated file. Do not edit! |
| @rem * |
| @rem * From this directory, run this batch file like so: |
| @rem * |
| @rem * .\build_zlib debug|release (rebuild) |
| @rem * |
| @rem ************************************************************************** |
| |
| @rem ************************************************************************** |
| cd /D [zlib_path] |
| set exitcode=0 |
| [if-any use_ml] |
| @rem ************************************************************************** |
| @rem Compile ASM sources with ML |
| set ASFLAGS=-nologo -Zi -coff |
| set LOC=-DASMV -DASMINF |
| set OBJA=gvmat32c.obj gvmat32.obj inffas32.obj |
| set ASM_OPTS=ASFLAGS="%ASFLAGS%" LOC="%LOC%" OBJA="%OBJA%" |
| if not exist gvmat32c.c copy contrib\masmx86\gvmat32c.c . |
| if not exist gvmat32.asm copy contrib\masmx86\gvmat32.asm . |
| if not exist inffas32.asm copy contrib\masmx86\inffas32.asm .[end] |
| |
| if /i "%1" == "release" goto release |
| if /i "%1" == "debug" goto debug |
| goto pIerr |
| |
| :checkrebuild |
| if /i "%2" == "rebuild" goto rebuild |
| if /i "%2" == "clean" goto clean |
| if not "%2" == "" goto pIIerr |
| set target= %STATICLIB% |
| goto build |
| |
| :rebuild |
| set target=clean %STATICLIB% |
| goto build |
| |
| :clean |
| set target=clean |
| goto build |
| |
| @rem ************************************************************************** |
| :release |
| set STATICLIB=zlibstat.lib |
| set CC_OPTS=/MD /O2 /Zi |
| goto checkrebuild |
| |
| @rem ************************************************************************** |
| :debug |
| set STATICLIB=zlibstatD.lib |
| set CC_OPTS=/MDd /Gm /Gi /ZI /Od /GZ /D_DEBUG |
| goto checkrebuild |
| |
| @rem ************************************************************************** |
| :build |
| set COMMON_CC_OPTS=/nologo /W3 /FD /GX /DWIN32 /D_WINDOWS |
| set CFLAGS=%COMMON_CC_OPTS% %CC_OPTS% $(LOC) |
| set BUILD_OPTS=%ASM_OPTS% CFLAGS="%COMMON_CC_OPTS% %CC_OPTS% $(LOC)" |
| @echo nmake /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target% |
| nmake /nologo /f win32\Makefile.msc %BUILD_OPTS% STATICLIB=%STATICLIB% %target% |
| if not errorlevel 0 goto err |
| goto end |
| |
| @rem ************************************************************************** |
| :pIerr |
| echo error: First parameter should be "release" or "debug" |
| goto err |
| |
| @rem ************************************************************************** |
| :pIIerr |
| echo error: Second parameter should be "rebuild" or empty |
| goto err |
| |
| @rem ************************************************************************** |
| :err |
| set exitcode=1 |
| :end |
| exit %exitcode% |