0
|
1 |
# Makefile for zlib, derived from Makefile.dj2.
|
|
2 |
# Modified for mingw32 by C. Spieler, 6/16/98.
|
|
3 |
# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
|
|
4 |
# Last updated: 1-Aug-2003.
|
|
5 |
# Tested under Cygwin and MinGW.
|
|
6 |
|
|
7 |
# Copyright (C) 1995-2003 Jean-loup Gailly.
|
|
8 |
# For conditions of distribution and use, see copyright notice in zlib.h
|
|
9 |
|
|
10 |
# To compile, or to compile and test, type:
|
|
11 |
#
|
|
12 |
# make -fmakefile.gcc; make test testdll -fmakefile.gcc
|
|
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 |
#
|
|
18 |
# To install libz.a, zconf.h and zlib.h in the system directories, type:
|
|
19 |
#
|
|
20 |
# make install -fmakefile.gcc
|
|
21 |
|
|
22 |
# Note:
|
|
23 |
# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
|
|
24 |
# the DLL name should be changed from "zlib1.dll".
|
|
25 |
|
|
26 |
STATICLIB = libz.a
|
|
27 |
SHAREDLIB = zlib1.dll
|
|
28 |
IMPLIB = libzdll.a
|
|
29 |
|
|
30 |
#LOC = -DASMV
|
|
31 |
#LOC = -DDEBUG -g
|
|
32 |
|
|
33 |
CC = gcc
|
|
34 |
CFLAGS = $(LOC) -O3 -Wall
|
|
35 |
|
|
36 |
AS = $(CC)
|
|
37 |
ASFLAGS = $(LOC) -Wall
|
|
38 |
|
|
39 |
LD = $(CC)
|
|
40 |
LDFLAGS = $(LOC) -s
|
|
41 |
|
|
42 |
AR = ar
|
|
43 |
ARFLAGS = rcs
|
|
44 |
|
|
45 |
RC = windres
|
|
46 |
RCFLAGS = --define GCC_WINDRES
|
|
47 |
|
|
48 |
CP = cp -fp
|
|
49 |
# If GNU install is available, replace $(CP) with install.
|
|
50 |
INSTALL = $(CP)
|
|
51 |
RM = rm -f
|
|
52 |
|
|
53 |
prefix = /usr/local
|
|
54 |
exec_prefix = $(prefix)
|
|
55 |
|
|
56 |
OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \
|
|
57 |
inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
|
|
58 |
OBJA =
|
|
59 |
|
|
60 |
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example minigzip example_d minigzip_d
|
|
61 |
|
|
62 |
test: example minigzip
|
|
63 |
./example
|
|
64 |
echo hello world | ./minigzip | ./minigzip -d
|
|
65 |
|
|
66 |
testdll: example_d minigzip_d
|
|
67 |
./example_d
|
|
68 |
echo hello world | ./minigzip_d | ./minigzip_d -d
|
|
69 |
|
|
70 |
.c.o:
|
|
71 |
$(CC) $(CFLAGS) -c -o $@ $<
|
|
72 |
|
|
73 |
.S.o:
|
|
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 |
|
|
86 |
example: example.o $(STATICLIB)
|
|
87 |
$(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
|
|
88 |
|
|
89 |
minigzip: minigzip.o $(STATICLIB)
|
|
90 |
$(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
|
|
91 |
|
|
92 |
example_d: example.o $(IMPLIB)
|
|
93 |
$(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
|
|
94 |
|
|
95 |
minigzip_d: minigzip.o $(IMPLIB)
|
|
96 |
$(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
|
|
97 |
|
|
98 |
zlibrc.o: win32/zlib1.rc
|
|
99 |
$(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
|
|
100 |
|
|
101 |
|
|
102 |
# INCLUDE_PATH and LIBRARY_PATH must be set.
|
|
103 |
|
|
104 |
.PHONY: install uninstall clean
|
|
105 |
|
|
106 |
install: zlib.h zconf.h $(LIB)
|
|
107 |
-@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
|
|
108 |
-@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
|
|
109 |
-$(INSTALL) zlib.h $(INCLUDE_PATH)
|
|
110 |
-$(INSTALL) zconf.h $(INCLUDE_PATH)
|
|
111 |
-$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
|
|
112 |
-$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
|
|
113 |
|
|
114 |
uninstall:
|
|
115 |
-$(RM) $(INCLUDE_PATH)/zlib.h
|
|
116 |
-$(RM) $(INCLUDE_PATH)/zconf.h
|
|
117 |
-$(RM) $(LIBRARY_PATH)/$(STATICLIB)
|
|
118 |
-$(RM) $(LIBRARY_PATH)/$(IMPLIB)
|
|
119 |
|
|
120 |
clean:
|
|
121 |
-$(RM) $(STATICLIB)
|
|
122 |
-$(RM) $(SHAREDLIB)
|
|
123 |
-$(RM) $(IMPLIB)
|
|
124 |
-$(RM) *.o
|
|
125 |
-$(RM) *.exe
|
|
126 |
-$(RM) foo.gz
|
|
127 |
|
|
128 |
adler32.o: zlib.h zconf.h
|
|
129 |
compress.o: zlib.h zconf.h
|
|
130 |
crc32.o: crc32.h zlib.h zconf.h
|
|
131 |
deflate.o: deflate.h zutil.h zlib.h zconf.h
|
|
132 |
example.o: zlib.h zconf.h
|
|
133 |
gzio.o: zutil.h zlib.h zconf.h
|
|
134 |
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
|
|
135 |
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
|
|
136 |
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
|
|
137 |
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
|
|
138 |
minigzip.o: zlib.h zconf.h
|
|
139 |
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
|
|
140 |
uncompr.o: zlib.h zconf.h
|
|
141 |
zutil.o: zutil.h zlib.h zconf.h
|