summaryrefslogtreecommitdiff
path: root/win32/Makefile.gcc
diff options
context:
space:
mode:
Diffstat (limited to 'win32/Makefile.gcc')
-rw-r--r--win32/Makefile.gcc119
1 files changed, 72 insertions, 47 deletions
diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc
index da32859..62a8430 100644
--- a/win32/Makefile.gcc
+++ b/win32/Makefile.gcc
@@ -1,26 +1,36 @@
1# Makefile for zlib, derived from Makefile.dj2. 1# Makefile for zlib, derived from Makefile.dj2.
2# Modified for mingw32 by C. Spieler, 6/16/98. 2# Modified for mingw32 by C. Spieler, 6/16/98.
3# Updated for zlib-1.2.x by Cosmin Truta, 11-Mar-2003. 3# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
4# Last updated: 1-Aug-2003.
4# Tested under Cygwin and MinGW. 5# Tested under Cygwin and MinGW.
5 6
6# Copyright (C) 1995-1998 Jean-loup Gailly. 7# Copyright (C) 1995-2003 Jean-loup Gailly.
7# For conditions of distribution and use, see copyright notice in zlib.h 8# For conditions of distribution and use, see copyright notice in zlib.h
8 9
9# To compile, or to compile and test, type: 10# To compile, or to compile and test, type:
10# 11#
11# make -fmakefile.gcc; make test -fmakefile.gcc 12# make -fmakefile.gcc; make test testdll -fmakefile.gcc
12# 13#
14# To use the asm code, type:
15# cp contrib/asm?86/match.S ./match.S
16# make LOC=-DASMV OBJA=match.o -fmakefile.gcc
17#
13# To install libz.a, zconf.h and zlib.h in the system directories, type: 18# To install libz.a, zconf.h and zlib.h in the system directories, type:
14# 19#
15# make install -fmakefile.gcc 20# make install -fmakefile.gcc
16#
17 21
18LIB = libz.a 22# Note:
19SHAREDLIB = zlib.dll 23# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
20VER = 1.2.0 24# the DLL name should be changed from "zlib1.dll".
25
26STATICLIB = libz.a
27SHAREDLIB = zlib1.dll
28IMPLIB = libzdll.a
29
30#LOC = -DASMV
31#LOC = -DDEBUG -g
21 32
22CC = gcc 33CC = gcc
23#CFLAGS = -DDEBUG -MMD -g
24CFLAGS = $(LOC) -O3 -Wall 34CFLAGS = $(LOC) -O3 -Wall
25 35
26AS = $(CC) 36AS = $(CC)
@@ -33,6 +43,7 @@ AR = ar
33ARFLAGS = rcs 43ARFLAGS = rcs
34 44
35RC = windres 45RC = windres
46RCFLAGS = --define GCC_WINDRES
36 47
37CP = cp -fp 48CP = cp -fp
38# If GNU install is available, replace $(CP) with install. 49# If GNU install is available, replace $(CP) with install.
@@ -44,61 +55,75 @@ exec_prefix = $(prefix)
44 55
45OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ 56OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \
46 inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 57 inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
47
48DLLDEF = win32/zlibgcc.def
49
50# to use the asm code: make OBJA=match.o
51OBJA = 58OBJA =
52 59
53TEST_OBJS = example.o minigzip.o 60all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example minigzip example_d minigzip_d
54
55all: $(LIB) $(SHAREDLIB) example minigzip
56 61
57test: all 62test: example minigzip
58 ./example 63 ./example
59 echo hello world | ./minigzip | ./minigzip -d 64 echo hello world | ./minigzip | ./minigzip -d
65
66testdll: example_d minigzip_d
67 ./example_d
68 echo hello world | ./minigzip_d | ./minigzip_d -d
60 69
61.c.o: 70.c.o:
62 $(CC) $(CFLAGS) -c -o $@ $< 71 $(CC) $(CFLAGS) -c -o $@ $<
63 72
64libz.a: $(OBJS) 73.S.o:
65 $(AR) $(ARFLAGS) $@ $(OBJS) 74 $(AS) $(ASFLAGS) -c -o $@ $<
75
76$(STATICLIB): $(OBJS) $(OBJA)
77 $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
78
79$(IMPLIB): $(SHAREDLIB)
80
81$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
82 dllwrap --driver-name $(CC) --def win32/zlib.def \
83 --implib $(IMPLIB) -o $@ $(OBJS) $(OBJA) zlibrc.o
84 strip $@
85
86example: example.o $(STATICLIB)
87 $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
66 88
67$(SHAREDLIB): $(OBJS) $(DLLDEF) zlibrc.o 89minigzip: minigzip.o $(STATICLIB)
68 dllwrap --driver-name $(CC) --def $(DLLDEF) -o $@ $(OBJS) zlibrc.o 90 $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
69 91
70example: example.o $(LIB) 92example_d: example.o $(IMPLIB)
71 $(LD) -o $@ $< $(LIB) 93 $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
72 94
73minigzip: minigzip.o $(LIB) 95minigzip_d: minigzip.o $(IMPLIB)
74 $(LD) -o $@ $< $(LIB) 96 $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
75 97
76zlibrc.o: win32/zlib.rc 98zlibrc.o: win32/zlib1.rc
77 -$(RC) -o $@ --define GCC_WINDRES win32/zlib.rc 99 $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
78 100
79 101
80# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 102# INCLUDE_PATH and LIBRARY_PATH must be set.
81 103
82.PHONY : uninstall clean 104.PHONY: install uninstall clean
83 105
84install: zlib.h zconf.h $(LIB) 106install: zlib.h zconf.h $(LIB)
85 -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH) 107 -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
86 -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH) 108 -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
87 $(INSTALL) zlib.h $(INCLUDE_PATH) 109 -$(INSTALL) zlib.h $(INCLUDE_PATH)
88 $(INSTALL) zconf.h $(INCLUDE_PATH) 110 -$(INSTALL) zconf.h $(INCLUDE_PATH)
89 $(INSTALL) $(LIB) $(LIBRARY_PATH) 111 -$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
112 -$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
90 113
91uninstall: 114uninstall:
92 $(RM) $(INCLUDE_PATH)/zlib.h 115 -$(RM) $(INCLUDE_PATH)/zlib.h
93 $(RM) $(INCLUDE_PATH)/zconf.h 116 -$(RM) $(INCLUDE_PATH)/zconf.h
94 $(RM) $(LIBRARY_PATH)/libz.a 117 -$(RM) $(LIBRARY_PATH)/$(STATICLIB)
118 -$(RM) $(LIBRARY_PATH)/$(IMPLIB)
95 119
96clean: 120clean:
97 $(RM) *.o 121 -$(RM) $(STATICLIB)
98 $(RM) *.exe 122 -$(RM) $(SHAREDLIB)
99 $(RM) libz.a 123 -$(RM) $(IMPLIB)
100 $(RM) zlib.dll 124 -$(RM) *.o
101 $(RM) foo.gz 125 -$(RM) *.exe
126 -$(RM) foo.gz
102 127
103adler32.o: zlib.h zconf.h 128adler32.o: zlib.h zconf.h
104compress.o: zlib.h zconf.h 129compress.o: zlib.h zconf.h
@@ -110,7 +135,7 @@ inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
110inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 135inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
111infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 136infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
112inftrees.o: zutil.h zlib.h zconf.h inftrees.h 137inftrees.o: zutil.h zlib.h zconf.h inftrees.h
113minigzip.o: zlib.h zconf.h 138minigzip.o: zlib.h zconf.h
114trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 139trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
115uncompr.o: zlib.h zconf.h 140uncompr.o: zlib.h zconf.h
116zutil.o: zutil.h zlib.h zconf.h 141zutil.o: zutil.h zlib.h zconf.h