zlib/win32/Makefile.msc

160 lines
4.5 KiB
Makefile
Raw Normal View History

2011-09-10 02:25:27 -04:00
# Makefile for zlib using Microsoft (Visual) C
2017-01-15 11:54:04 -05:00
# zlib is copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
2011-09-10 02:22:37 -04:00
#
# Usage:
2011-09-10 02:34:30 -04:00
# nmake -f win32/Makefile.msc (standard build)
# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
2011-09-10 02:22:37 -04:00
# The toplevel directory of the source tree.
#
TOP = .
2011-09-10 02:22:37 -04:00
# optional build flags
LOC =
# variables
STATICLIB = zlib.lib
SHAREDLIB = zlib1.dll
IMPLIB = zdll.lib
CC = cl
AS = ml
LD = link
AR = lib
RC = rc
2011-09-10 02:32:36 -04:00
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
2011-09-10 02:25:27 -04:00
WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
2011-09-10 02:34:30 -04:00
ASFLAGS = -coff -Zi $(LOC)
2011-09-10 02:32:36 -04:00
LDFLAGS = -nologo -debug -incremental:no -opt:ref
2011-09-10 02:22:37 -04:00
ARFLAGS = -nologo
RCFLAGS = /dWIN32 /r
2011-09-10 02:27:26 -04:00
OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj \
2011-09-11 14:04:49 -04:00
gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj
2011-09-10 02:22:37 -04:00
OBJA =
# targets
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
2013-04-13 20:54:57 -04:00
example.exe minigzip.exe example_d.exe minigzip_d.exe
2011-09-10 02:22:37 -04:00
$(STATICLIB): $(OBJS) $(OBJA)
$(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA)
$(IMPLIB): $(SHAREDLIB)
$(SHAREDLIB): $(TOP)/win32/zlib.def $(OBJS) $(OBJA) zlib1.res
$(LD) $(LDFLAGS) -def:$(TOP)/win32/zlib.def -dll -implib:$(IMPLIB) \
2011-09-10 02:32:36 -04:00
-out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res
2011-09-10 02:25:27 -04:00
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;2
2011-09-10 02:22:37 -04:00
example.exe: example.obj $(STATICLIB)
$(LD) $(LDFLAGS) example.obj $(STATICLIB)
2011-09-10 02:25:27 -04:00
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;1
2011-09-10 02:22:37 -04:00
minigzip.exe: minigzip.obj $(STATICLIB)
$(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
2011-09-10 02:25:27 -04:00
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;1
2011-09-10 02:22:37 -04:00
example_d.exe: example.obj $(IMPLIB)
$(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
2011-09-10 02:25:27 -04:00
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;1
2011-09-10 02:22:37 -04:00
minigzip_d.exe: minigzip.obj $(IMPLIB)
$(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
2011-09-10 02:25:27 -04:00
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;1
2011-09-10 02:22:37 -04:00
{$(TOP)}.c.obj:
2011-09-10 02:25:27 -04:00
$(CC) -c $(WFLAGS) $(CFLAGS) $<
2011-09-10 02:22:37 -04:00
{$(TOP)/test}.c.obj:
$(CC) -c -I$(TOP) $(WFLAGS) $(CFLAGS) $<
{$(TOP)/contrib/masmx64}.c.obj:
2011-09-10 02:34:30 -04:00
$(CC) -c $(WFLAGS) $(CFLAGS) $<
{$(TOP)/contrib/masmx64}.asm.obj:
2011-09-10 02:34:30 -04:00
$(AS) -c $(ASFLAGS) $<
{$(TOP)/contrib/masmx86}.asm.obj:
2011-09-10 02:22:37 -04:00
$(AS) -c $(ASFLAGS) $<
adler32.obj: $(TOP)/adler32.c $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:22:37 -04:00
compress.obj: $(TOP)/compress.c $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:22:37 -04:00
crc32.obj: $(TOP)/crc32.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/crc32.h
2011-09-10 02:22:37 -04:00
deflate.obj: $(TOP)/deflate.c $(TOP)/deflate.h $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:26:49 -04:00
gzclose.obj: $(TOP)/gzclose.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
2011-09-10 02:26:49 -04:00
gzlib.obj: $(TOP)/gzlib.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
2011-09-10 02:26:49 -04:00
gzread.obj: $(TOP)/gzread.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
2011-09-10 02:26:49 -04:00
gzwrite.obj: $(TOP)/gzwrite.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
2011-09-10 02:22:37 -04:00
infback.obj: $(TOP)/infback.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
$(TOP)/inffast.h $(TOP)/inffixed.h
2011-09-10 02:22:37 -04:00
inffast.obj: $(TOP)/inffast.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
$(TOP)/inffast.h
2011-09-10 02:22:37 -04:00
inflate.obj: $(TOP)/inflate.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
$(TOP)/inffast.h $(TOP)/inffixed.h
2011-09-10 02:22:37 -04:00
inftrees.obj: $(TOP)/inftrees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h
2011-09-10 02:22:37 -04:00
trees.obj: $(TOP)/trees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/deflate.h $(TOP)/trees.h
2011-09-10 02:22:37 -04:00
uncompr.obj: $(TOP)/uncompr.c $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:22:37 -04:00
zutil.obj: $(TOP)/zutil.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:34:30 -04:00
gvmat64.obj: $(TOP)/contrib\masmx64\gvmat64.asm
2011-09-10 02:34:30 -04:00
inffasx64.obj: $(TOP)/contrib\masmx64\inffasx64.asm
2011-09-10 02:34:30 -04:00
inffas8664.obj: $(TOP)/contrib\masmx64\inffas8664.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h \
$(TOP)/inftrees.h $(TOP)/inflate.h $(TOP)/inffast.h
2011-09-10 02:34:30 -04:00
inffas32.obj: $(TOP)/contrib\masmx86\inffas32.asm
2011-09-10 02:34:30 -04:00
match686.obj: $(TOP)/contrib\masmx86\match686.asm
2011-09-10 02:22:37 -04:00
example.obj: $(TOP)/test/example.c $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:22:37 -04:00
minigzip.obj: $(TOP)/test/minigzip.c $(TOP)/zlib.h $(TOP)/zconf.h
2011-09-10 02:22:37 -04:00
zlib1.res: $(TOP)/win32/zlib1.rc
$(RC) $(RCFLAGS) /fo$@ $(TOP)/win32/zlib1.rc
2011-09-10 02:22:37 -04:00
# testing
test: example.exe minigzip.exe
example
echo hello world | minigzip | minigzip -d
testdll: example_d.exe minigzip_d.exe
example_d
echo hello world | minigzip_d | minigzip_d -d
# cleanup
clean:
-del $(STATICLIB)
-del $(SHAREDLIB)
-del $(IMPLIB)
-del *.obj
-del *.res
-del *.exp
-del *.exe
2011-09-10 02:25:27 -04:00
-del *.pdb
-del *.manifest
2011-09-10 02:22:37 -04:00
-del foo.gz