xref: /netbsd-src/external/gpl3/gdb/dist/zlib/old/os2/Makefile.os2 (revision 796c32c94f6e154afc9de0f63da35c91bb739b45)
1212397c6Schristos# Makefile for zlib under OS/2 using GCC (PGCC)
2212397c6Schristos# For conditions of distribution and use, see copyright notice in zlib.h
3212397c6Schristos
4212397c6Schristos# To compile and test, type:
5212397c6Schristos#   cp Makefile.os2 ..
6212397c6Schristos#   cd ..
7212397c6Schristos#   make -f Makefile.os2 test
8212397c6Schristos
9212397c6Schristos# This makefile will build a static library z.lib, a shared library
10212397c6Schristos# z.dll and a import library zdll.lib. You can use either z.lib or
11212397c6Schristos# zdll.lib by specifying either -lz or -lzdll on gcc's command line
12212397c6Schristos
13212397c6SchristosCC=gcc -Zomf -s
14212397c6Schristos
15212397c6SchristosCFLAGS=-O6 -Wall
16212397c6Schristos#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
17*796c32c9Schristos#CFLAGS=-g -DZLIB_DEBUG
18212397c6Schristos#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
19212397c6Schristos#           -Wstrict-prototypes -Wmissing-prototypes
20212397c6Schristos
21212397c6Schristos#################### BUG WARNING: #####################
22212397c6Schristos## infcodes.c hits a bug in pgcc-1.0, so you have to use either
23212397c6Schristos## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
24212397c6Schristos## This bug is reportedly fixed in pgcc >1.0, but this was not tested
25212397c6SchristosCFLAGS+=-fno-force-mem
26212397c6Schristos
27212397c6SchristosLDFLAGS=-s -L. -lzdll -Zcrtdll
28212397c6SchristosLDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
29212397c6Schristos
30212397c6SchristosVER=1.1.0
31212397c6SchristosZLIB=z.lib
32212397c6SchristosSHAREDLIB=z.dll
33212397c6SchristosSHAREDLIBIMP=zdll.lib
34212397c6SchristosLIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
35212397c6Schristos
36212397c6SchristosAR=emxomfar cr
37212397c6SchristosIMPLIB=emximp
38212397c6SchristosRANLIB=echo
39212397c6SchristosTAR=tar
40212397c6SchristosSHELL=bash
41212397c6Schristos
42212397c6Schristosprefix=/usr/local
43212397c6Schristosexec_prefix = $(prefix)
44212397c6Schristos
45212397c6SchristosOBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
46212397c6Schristos       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
47212397c6Schristos
48212397c6SchristosTEST_OBJS = example.o minigzip.o
49212397c6Schristos
50212397c6SchristosDISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
51212397c6Schristos  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
52212397c6Schristos  nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \
53212397c6Schristos  contrib/asm386/*.asm contrib/asm386/*.c \
54212397c6Schristos  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
55212397c6Schristos  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
56212397c6Schristos  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
57212397c6Schristos
58212397c6Schristosall: example.exe minigzip.exe
59212397c6Schristos
60212397c6Schristostest: all
61212397c6Schristos	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
62212397c6Schristos	echo hello world | ./minigzip | ./minigzip -d || \
63212397c6Schristos	  echo '		*** minigzip test FAILED ***' ; \
64212397c6Schristos	if ./example; then \
65212397c6Schristos	  echo '		*** zlib test OK ***'; \
66212397c6Schristos	else \
67212397c6Schristos	  echo '		*** zlib test FAILED ***'; \
68212397c6Schristos	fi
69212397c6Schristos
70212397c6Schristos$(ZLIB): $(OBJS)
71212397c6Schristos	$(AR) $@ $(OBJS)
72212397c6Schristos	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
73212397c6Schristos
74212397c6Schristos$(SHAREDLIB): $(OBJS) os2/z.def
75212397c6Schristos	$(LDSHARED) -o $@ $^
76212397c6Schristos
77212397c6Schristos$(SHAREDLIBIMP): os2/z.def
78212397c6Schristos	$(IMPLIB) -o $@ $^
79212397c6Schristos
80212397c6Schristosexample.exe: example.o $(LIBS)
81212397c6Schristos	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
82212397c6Schristos
83212397c6Schristosminigzip.exe: minigzip.o $(LIBS)
84212397c6Schristos	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
85212397c6Schristos
86212397c6Schristosclean:
87212397c6Schristos	rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
88212397c6Schristos
89212397c6Schristosdistclean:	clean
90212397c6Schristos
91212397c6Schristoszip:
92212397c6Schristos	mv Makefile Makefile~; cp -p Makefile.in Makefile
93212397c6Schristos	rm -f test.c ztest*.c
94212397c6Schristos	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
95212397c6Schristos	zip -ul9 zlib$$v $(DISTFILES)
96212397c6Schristos	mv Makefile~ Makefile
97212397c6Schristos
98212397c6Schristosdist:
99212397c6Schristos	mv Makefile Makefile~; cp -p Makefile.in Makefile
100212397c6Schristos	rm -f test.c ztest*.c
101212397c6Schristos	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
102212397c6Schristos	rm -f $$d.tar.gz; \
103212397c6Schristos	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
104212397c6Schristos	files=""; \
105212397c6Schristos	for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
106212397c6Schristos	cd ..; \
107212397c6Schristos	GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
108212397c6Schristos	if test ! -d $$d; then rm -f $$d; fi
109212397c6Schristos	mv Makefile~ Makefile
110212397c6Schristos
111212397c6Schristostags:
112212397c6Schristos	etags *.[ch]
113212397c6Schristos
114212397c6Schristosdepend:
115212397c6Schristos	makedepend -- $(CFLAGS) -- *.[ch]
116212397c6Schristos
117212397c6Schristos# DO NOT DELETE THIS LINE -- make depend depends on it.
118212397c6Schristos
119212397c6Schristosadler32.o: zlib.h zconf.h
120212397c6Schristoscompress.o: zlib.h zconf.h
121212397c6Schristoscrc32.o: zlib.h zconf.h
122212397c6Schristosdeflate.o: deflate.h zutil.h zlib.h zconf.h
123212397c6Schristosexample.o: zlib.h zconf.h
124212397c6Schristosgzio.o: zutil.h zlib.h zconf.h
125212397c6Schristosinfblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
126212397c6Schristosinfcodes.o: zutil.h zlib.h zconf.h
127212397c6Schristosinfcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
128212397c6Schristosinffast.o: zutil.h zlib.h zconf.h inftrees.h
129212397c6Schristosinffast.o: infblock.h infcodes.h infutil.h inffast.h
130212397c6Schristosinflate.o: zutil.h zlib.h zconf.h infblock.h
131212397c6Schristosinftrees.o: zutil.h zlib.h zconf.h inftrees.h
132212397c6Schristosinfutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
133212397c6Schristosminigzip.o: zlib.h zconf.h
134212397c6Schristostrees.o: deflate.h zutil.h zlib.h zconf.h trees.h
135212397c6Schristosuncompr.o: zlib.h zconf.h
136212397c6Schristoszutil.o: zutil.h zlib.h zconf.h
137