summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--win32/Makefile.gcc15
-rw-r--r--win32/Makefile.msc33
-rw-r--r--win32/zlib.def13
3 files changed, 49 insertions, 12 deletions
diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc
index 7f9973b..da32859 100644
--- a/win32/Makefile.gcc
+++ b/win32/Makefile.gcc
@@ -16,7 +16,7 @@
16# 16#
17 17
18LIB = libz.a 18LIB = libz.a
19SHAREDLIB = libz.so 19SHAREDLIB = zlib.dll
20VER = 1.2.0 20VER = 1.2.0
21 21
22CC = gcc 22CC = gcc
@@ -32,6 +32,8 @@ LDFLAGS = $(LOC) -s
32AR = ar 32AR = ar
33ARFLAGS = rcs 33ARFLAGS = rcs
34 34
35RC = windres
36
35CP = cp -fp 37CP = cp -fp
36# If GNU install is available, replace $(CP) with install. 38# If GNU install is available, replace $(CP) with install.
37INSTALL = $(CP) 39INSTALL = $(CP)
@@ -43,12 +45,14 @@ exec_prefix = $(prefix)
43OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ 45OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \
44 inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 46 inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
45 47
48DLLDEF = win32/zlibgcc.def
49
46# to use the asm code: make OBJA=match.o 50# to use the asm code: make OBJA=match.o
47OBJA = 51OBJA =
48 52
49TEST_OBJS = example.o minigzip.o 53TEST_OBJS = example.o minigzip.o
50 54
51all: $(LIB) example minigzip 55all: $(LIB) $(SHAREDLIB) example minigzip
52 56
53test: all 57test: all
54 ./example 58 ./example
@@ -60,12 +64,18 @@ test: all
60libz.a: $(OBJS) 64libz.a: $(OBJS)
61 $(AR) $(ARFLAGS) $@ $(OBJS) 65 $(AR) $(ARFLAGS) $@ $(OBJS)
62 66
67$(SHAREDLIB): $(OBJS) $(DLLDEF) zlibrc.o
68 dllwrap --driver-name $(CC) --def $(DLLDEF) -o $@ $(OBJS) zlibrc.o
69
63example: example.o $(LIB) 70example: example.o $(LIB)
64 $(LD) -o $@ $< $(LIB) 71 $(LD) -o $@ $< $(LIB)
65 72
66minigzip: minigzip.o $(LIB) 73minigzip: minigzip.o $(LIB)
67 $(LD) -o $@ $< $(LIB) 74 $(LD) -o $@ $< $(LIB)
68 75
76zlibrc.o: win32/zlib.rc
77 -$(RC) -o $@ --define GCC_WINDRES win32/zlib.rc
78
69 79
70# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 80# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
71 81
@@ -87,6 +97,7 @@ clean:
87 $(RM) *.o 97 $(RM) *.o
88 $(RM) *.exe 98 $(RM) *.exe
89 $(RM) libz.a 99 $(RM) libz.a
100 $(RM) zlib.dll
90 $(RM) foo.gz 101 $(RM) foo.gz
91 102
92adler32.o: zlib.h zconf.h 103adler32.o: zlib.h zconf.h
diff --git a/win32/Makefile.msc b/win32/Makefile.msc
index 9760208..4dc8819 100644
--- a/win32/Makefile.msc
+++ b/win32/Makefile.msc
@@ -1,10 +1,13 @@
1# Makefile for (static) zlib -- Microsoft (Visual) C. 1# Makefile for Win32 zlib.dll and the static library zlibstat.lib
2# Author: Cosmin Truta, 11-Mar-2003. 2# -- Microsoft (Visual) C.
3# Author: Cosmin Truta, 11-Mar-2003
4# Christian Spieler, 19-Mar-2003
3# 5#
4# Usage: nmake -f win32/Makefile.msc 6# Usage: nmake -f win32/Makefile.msc
5 7
6CC = cl 8CC = cl
7LD = cl 9LD = cl
10RC = rc
8CFLAGS = -nologo -MD -O2 11CFLAGS = -nologo -MD -O2
9LDFLAGS = -nologo 12LDFLAGS = -nologo
10 13
@@ -12,19 +15,33 @@ OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \
12 inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 15 inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
13 16
14# targets 17# targets
15all: zlib.lib example.exe minigzip.exe 18all: zlib.dll zlibstat.lib example.exe minigzip.exe exampl_s.exe minigz_s.exe
16 19
17zlib.lib: $(OBJS) 20zlibstat.lib: $(OBJS)
18 lib -out:$@ $(OBJS) 21 lib -out:$@ $(OBJS)
19 22
23zlib.dll: $(OBJS) zlib.res win32/zlib.def
24 link -release -def:win32/zlib.def -dll -out:$@ $(OBJS) zlib.res
25
26zlib.lib: zlib.dll
27
20example.exe: example.obj zlib.lib 28example.exe: example.obj zlib.lib
21 $(LD) $(LDFLAGS) example.obj zlib.lib 29 $(LD) $(LDFLAGS) example.obj zlib.lib
22 30
23minigzip.exe: minigzip.obj zlib.lib 31minigzip.exe: minigzip.obj zlib.lib
24 $(LD) $(LDFLAGS) minigzip.obj zlib.lib 32 $(LD) $(LDFLAGS) minigzip.obj zlib.lib
25 33
34exampl_s.exe: example.obj zlibstat.lib
35 $(LD) $(LDFLAGS) -o $@ example.obj zlibstat.lib
36
37minigz_s.exe: minigzip.obj zlibstat.lib
38 $(LD) $(LDFLAGS) -o $@ minigzip.obj zlibstat.lib
39
26.c.obj: 40.c.obj:
27 $(CC) -c $(CFLAGS) $*.c 41 $(CC) -c $(CFLAGS) $<
42
43zlib.res: win32/zlib.rc
44 $(RC) /l 0x409 /fo$@ /d WIN32 win32/zlib.rc
28 45
29adler32.obj: adler32.c zlib.h zconf.h 46adler32.obj: adler32.c zlib.h zconf.h
30 47
@@ -62,8 +79,14 @@ test: example.exe minigzip.exe
62 example 79 example
63 echo hello world | minigzip | minigzip -d 80 echo hello world | minigzip | minigzip -d
64 81
82teststat: exampl_s.exe minigz_s.exe
83 exampl_s
84 echo hello world | minigz_s | minigz_s -d
85
65# cleanup 86# cleanup
66clean: 87clean:
67 del *.obj 88 del *.obj
89 del *.dll
68 del *.lib 90 del *.lib
91 del *.exp
69 del *.exe 92 del *.exe
diff --git a/win32/zlib.def b/win32/zlib.def
index 3b4b05a..d299ed5 100644
--- a/win32/zlib.def
+++ b/win32/zlib.def
@@ -1,5 +1,5 @@
1LIBRARY zlib.dll 1LIBRARY zlib.dll
2DESCRIPTION "zlib compression library for Windows" 2DESCRIPTION "zlib data compression library"
3 3
4EXPORTS 4EXPORTS
5 adler32 @1 5 adler32 @1
@@ -43,7 +43,10 @@ EXPORTS
43 compress2 @39 43 compress2 @39
44 gzputs @40 44 gzputs @40
45 gzgets @41 45 gzgets @41
46; The following functions exist since zlib-1.2.0 46; since zlib-1.2.0:
47; deflateBound @42 47 inflateCopy @42
48; compressBound @43 48 inflateBackInit_ @43
49; etc. 49 inflateBack @44
50 inflateBackEnd @45
51 compressBound @46
52 deflateBound @47