xref: /netbsd-src/external/gpl3/gdb.old/dist/zlib/old/os2/Makefile.os2 (revision 699b0f9210494f137dd95d11c9bffdbb2f69ace2)
14e00368fSchristos# Makefile for zlib under OS/2 using GCC (PGCC)
24e00368fSchristos# For conditions of distribution and use, see copyright notice in zlib.h
34e00368fSchristos
44e00368fSchristos# To compile and test, type:
54e00368fSchristos#   cp Makefile.os2 ..
64e00368fSchristos#   cd ..
74e00368fSchristos#   make -f Makefile.os2 test
84e00368fSchristos
94e00368fSchristos# This makefile will build a static library z.lib, a shared library
104e00368fSchristos# z.dll and a import library zdll.lib. You can use either z.lib or
114e00368fSchristos# zdll.lib by specifying either -lz or -lzdll on gcc's command line
124e00368fSchristos
134e00368fSchristosCC=gcc -Zomf -s
144e00368fSchristos
154e00368fSchristosCFLAGS=-O6 -Wall
164e00368fSchristos#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
17*699b0f92Schristos#CFLAGS=-g -DZLIB_DEBUG
184e00368fSchristos#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
194e00368fSchristos#           -Wstrict-prototypes -Wmissing-prototypes
204e00368fSchristos
214e00368fSchristos#################### BUG WARNING: #####################
224e00368fSchristos## infcodes.c hits a bug in pgcc-1.0, so you have to use either
234e00368fSchristos## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
244e00368fSchristos## This bug is reportedly fixed in pgcc >1.0, but this was not tested
254e00368fSchristosCFLAGS+=-fno-force-mem
264e00368fSchristos
274e00368fSchristosLDFLAGS=-s -L. -lzdll -Zcrtdll
284e00368fSchristosLDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
294e00368fSchristos
304e00368fSchristosVER=1.1.0
314e00368fSchristosZLIB=z.lib
324e00368fSchristosSHAREDLIB=z.dll
334e00368fSchristosSHAREDLIBIMP=zdll.lib
344e00368fSchristosLIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
354e00368fSchristos
364e00368fSchristosAR=emxomfar cr
374e00368fSchristosIMPLIB=emximp
384e00368fSchristosRANLIB=echo
394e00368fSchristosTAR=tar
404e00368fSchristosSHELL=bash
414e00368fSchristos
424e00368fSchristosprefix=/usr/local
434e00368fSchristosexec_prefix = $(prefix)
444e00368fSchristos
454e00368fSchristosOBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
464e00368fSchristos       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
474e00368fSchristos
484e00368fSchristosTEST_OBJS = example.o minigzip.o
494e00368fSchristos
504e00368fSchristosDISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
514e00368fSchristos  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
524e00368fSchristos  nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \
534e00368fSchristos  contrib/asm386/*.asm contrib/asm386/*.c \
544e00368fSchristos  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
554e00368fSchristos  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
564e00368fSchristos  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
574e00368fSchristos
584e00368fSchristosall: example.exe minigzip.exe
594e00368fSchristos
604e00368fSchristostest: all
614e00368fSchristos	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
624e00368fSchristos	echo hello world | ./minigzip | ./minigzip -d || \
634e00368fSchristos	  echo '		*** minigzip test FAILED ***' ; \
644e00368fSchristos	if ./example; then \
654e00368fSchristos	  echo '		*** zlib test OK ***'; \
664e00368fSchristos	else \
674e00368fSchristos	  echo '		*** zlib test FAILED ***'; \
684e00368fSchristos	fi
694e00368fSchristos
704e00368fSchristos$(ZLIB): $(OBJS)
714e00368fSchristos	$(AR) $@ $(OBJS)
724e00368fSchristos	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
734e00368fSchristos
744e00368fSchristos$(SHAREDLIB): $(OBJS) os2/z.def
754e00368fSchristos	$(LDSHARED) -o $@ $^
764e00368fSchristos
774e00368fSchristos$(SHAREDLIBIMP): os2/z.def
784e00368fSchristos	$(IMPLIB) -o $@ $^
794e00368fSchristos
804e00368fSchristosexample.exe: example.o $(LIBS)
814e00368fSchristos	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
824e00368fSchristos
834e00368fSchristosminigzip.exe: minigzip.o $(LIBS)
844e00368fSchristos	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
854e00368fSchristos
864e00368fSchristosclean:
874e00368fSchristos	rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
884e00368fSchristos
894e00368fSchristosdistclean:	clean
904e00368fSchristos
914e00368fSchristoszip:
924e00368fSchristos	mv Makefile Makefile~; cp -p Makefile.in Makefile
934e00368fSchristos	rm -f test.c ztest*.c
944e00368fSchristos	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
954e00368fSchristos	zip -ul9 zlib$$v $(DISTFILES)
964e00368fSchristos	mv Makefile~ Makefile
974e00368fSchristos
984e00368fSchristosdist:
994e00368fSchristos	mv Makefile Makefile~; cp -p Makefile.in Makefile
1004e00368fSchristos	rm -f test.c ztest*.c
1014e00368fSchristos	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
1024e00368fSchristos	rm -f $$d.tar.gz; \
1034e00368fSchristos	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
1044e00368fSchristos	files=""; \
1054e00368fSchristos	for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
1064e00368fSchristos	cd ..; \
1074e00368fSchristos	GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
1084e00368fSchristos	if test ! -d $$d; then rm -f $$d; fi
1094e00368fSchristos	mv Makefile~ Makefile
1104e00368fSchristos
1114e00368fSchristostags:
1124e00368fSchristos	etags *.[ch]
1134e00368fSchristos
1144e00368fSchristosdepend:
1154e00368fSchristos	makedepend -- $(CFLAGS) -- *.[ch]
1164e00368fSchristos
1174e00368fSchristos# DO NOT DELETE THIS LINE -- make depend depends on it.
1184e00368fSchristos
1194e00368fSchristosadler32.o: zlib.h zconf.h
1204e00368fSchristoscompress.o: zlib.h zconf.h
1214e00368fSchristoscrc32.o: zlib.h zconf.h
1224e00368fSchristosdeflate.o: deflate.h zutil.h zlib.h zconf.h
1234e00368fSchristosexample.o: zlib.h zconf.h
1244e00368fSchristosgzio.o: zutil.h zlib.h zconf.h
1254e00368fSchristosinfblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
1264e00368fSchristosinfcodes.o: zutil.h zlib.h zconf.h
1274e00368fSchristosinfcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
1284e00368fSchristosinffast.o: zutil.h zlib.h zconf.h inftrees.h
1294e00368fSchristosinffast.o: infblock.h infcodes.h infutil.h inffast.h
1304e00368fSchristosinflate.o: zutil.h zlib.h zconf.h infblock.h
1314e00368fSchristosinftrees.o: zutil.h zlib.h zconf.h inftrees.h
1324e00368fSchristosinfutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
1334e00368fSchristosminigzip.o: zlib.h zconf.h
1344e00368fSchristostrees.o: deflate.h zutil.h zlib.h zconf.h trees.h
1354e00368fSchristosuncompr.o: zlib.h zconf.h
1364e00368fSchristoszutil.o: zutil.h zlib.h zconf.h
137