1 # Makefile for zlib under OS/2 using GCC (PGCC)
2 # For conditions of distribution and use, see copyright notice in zlib.h
4 # To compile and test, type:
7 # make -f Makefile.os2 test
9 # This makefile will build a static library z.lib, a shared library
10 # z.dll and a import library zdll.lib. You can use either z.lib or
11 # zdll.lib by specifying either -lz or -lzdll on gcc's command line
16 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
17 #CFLAGS=-g -DZLIB_DEBUG
18 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
19 # -Wstrict-prototypes -Wmissing-prototypes
21 #################### BUG WARNING: #####################
22 ## infcodes.c hits a bug in pgcc-1.0, so you have to use either
23 ## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
24 ## This bug is reportedly fixed in pgcc >1.0, but this was not tested
25 CFLAGS+=-fno-force-mem
27 LDFLAGS=-s -L. -lzdll -Zcrtdll
28 LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
34 LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
43 exec_prefix = $(prefix)
45 OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
46 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
48 TEST_OBJS = example.o minigzip.o
50 DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
51 algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
52 nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
53 contrib/asm386/*.asm contrib/asm386/*.c \
54 contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
55 contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
56 contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
58 all: example.exe minigzip.exe
61 @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
62 echo hello world | ./minigzip | ./minigzip -d || \
63 echo ' *** minigzip test FAILED ***' ; \
65 echo ' *** zlib test OK ***'; \
67 echo ' *** zlib test FAILED ***'; \
72 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
74 $(SHAREDLIB): $(OBJS) os2/z.def
77 $(SHAREDLIBIMP): os2/z.def
80 example.exe: example.o $(LIBS)
81 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
83 minigzip.exe: minigzip.o $(LIBS)
84 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
87 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
92 mv Makefile Makefile~; cp -p Makefile.in Makefile
94 v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
95 zip -ul9 zlib$$v $(DISTFILES)
99 mv Makefile Makefile~; cp -p Makefile.in Makefile
100 rm -f test.c ztest*.c
101 d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
103 if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
105 for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
107 GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
108 if test ! -d $$d; then rm -f $$d; fi
109 mv Makefile~ Makefile
115 makedepend -- $(CFLAGS) -- *.[ch]
117 # DO NOT DELETE THIS LINE -- make depend depends on it.
119 adler32.o: zlib.h zconf.h
120 compress.o: zlib.h zconf.h
121 crc32.o: zlib.h zconf.h
122 deflate.o: deflate.h zutil.h zlib.h zconf.h
123 example.o: zlib.h zconf.h
124 gzio.o: zutil.h zlib.h zconf.h
125 infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
126 infcodes.o: zutil.h zlib.h zconf.h
127 infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
128 inffast.o: zutil.h zlib.h zconf.h inftrees.h
129 inffast.o: infblock.h infcodes.h infutil.h inffast.h
130 inflate.o: zutil.h zlib.h zconf.h infblock.h
131 inftrees.o: zutil.h zlib.h zconf.h inftrees.h
132 infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
133 minigzip.o: zlib.h zconf.h
134 trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
135 uncompr.o: zlib.h zconf.h
136 zutil.o: zutil.h zlib.h zconf.h