external/zlib-1.2.11/old/os2/Makefile.os2
author Sam Lantinga <slouken@libsdl.org>
Fri, 26 Oct 2018 14:58:01 -0700
changeset 617 d64228a395fc
parent 521 9ed2f7d4a251
permissions -rw-r--r--
Fixed webp library detection when cross-compiling for Windows
slouken@521
     1
# Makefile for zlib under OS/2 using GCC (PGCC)
slouken@521
     2
# For conditions of distribution and use, see copyright notice in zlib.h
slouken@521
     3
slouken@521
     4
# To compile and test, type:
slouken@521
     5
#   cp Makefile.os2 ..
slouken@521
     6
#   cd ..
slouken@521
     7
#   make -f Makefile.os2 test
slouken@521
     8
slouken@521
     9
# This makefile will build a static library z.lib, a shared library
slouken@521
    10
# z.dll and a import library zdll.lib. You can use either z.lib or
slouken@521
    11
# zdll.lib by specifying either -lz or -lzdll on gcc's command line
slouken@521
    12
slouken@521
    13
CC=gcc -Zomf -s
slouken@521
    14
slouken@521
    15
CFLAGS=-O6 -Wall
slouken@521
    16
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
slouken@521
    17
#CFLAGS=-g -DZLIB_DEBUG
slouken@521
    18
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
slouken@521
    19
#           -Wstrict-prototypes -Wmissing-prototypes
slouken@521
    20
slouken@521
    21
#################### BUG WARNING: #####################
slouken@521
    22
## infcodes.c hits a bug in pgcc-1.0, so you have to use either
slouken@521
    23
## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem)
slouken@521
    24
## This bug is reportedly fixed in pgcc >1.0, but this was not tested
slouken@521
    25
CFLAGS+=-fno-force-mem
slouken@521
    26
slouken@521
    27
LDFLAGS=-s -L. -lzdll -Zcrtdll
slouken@521
    28
LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll
slouken@521
    29
slouken@521
    30
VER=1.1.0
slouken@521
    31
ZLIB=z.lib
slouken@521
    32
SHAREDLIB=z.dll
slouken@521
    33
SHAREDLIBIMP=zdll.lib
slouken@521
    34
LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
slouken@521
    35
slouken@521
    36
AR=emxomfar cr
slouken@521
    37
IMPLIB=emximp
slouken@521
    38
RANLIB=echo
slouken@521
    39
TAR=tar
slouken@521
    40
SHELL=bash
slouken@521
    41
slouken@521
    42
prefix=/usr/local
slouken@521
    43
exec_prefix = $(prefix)
slouken@521
    44
slouken@521
    45
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
slouken@521
    46
       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
slouken@521
    47
slouken@521
    48
TEST_OBJS = example.o minigzip.o
slouken@521
    49
slouken@521
    50
DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
slouken@521
    51
  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
slouken@521
    52
  nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \
slouken@521
    53
  contrib/asm386/*.asm contrib/asm386/*.c \
slouken@521
    54
  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
slouken@521
    55
  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
slouken@521
    56
  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32
slouken@521
    57
slouken@521
    58
all: example.exe minigzip.exe
slouken@521
    59
slouken@521
    60
test: all
slouken@521
    61
	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
slouken@521
    62
	echo hello world | ./minigzip | ./minigzip -d || \
slouken@521
    63
	  echo '		*** minigzip test FAILED ***' ; \
slouken@521
    64
	if ./example; then \
slouken@521
    65
	  echo '		*** zlib test OK ***'; \
slouken@521
    66
	else \
slouken@521
    67
	  echo '		*** zlib test FAILED ***'; \
slouken@521
    68
	fi
slouken@521
    69
slouken@521
    70
$(ZLIB): $(OBJS)
slouken@521
    71
	$(AR) $@ $(OBJS)
slouken@521
    72
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
slouken@521
    73
slouken@521
    74
$(SHAREDLIB): $(OBJS) os2/z.def
slouken@521
    75
	$(LDSHARED) -o $@ $^
slouken@521
    76
slouken@521
    77
$(SHAREDLIBIMP): os2/z.def
slouken@521
    78
	$(IMPLIB) -o $@ $^
slouken@521
    79
slouken@521
    80
example.exe: example.o $(LIBS)
slouken@521
    81
	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
slouken@521
    82
slouken@521
    83
minigzip.exe: minigzip.o $(LIBS)
slouken@521
    84
	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
slouken@521
    85
slouken@521
    86
clean:
slouken@521
    87
	rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
slouken@521
    88
slouken@521
    89
distclean:	clean
slouken@521
    90
slouken@521
    91
zip:
slouken@521
    92
	mv Makefile Makefile~; cp -p Makefile.in Makefile
slouken@521
    93
	rm -f test.c ztest*.c
slouken@521
    94
	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
slouken@521
    95
	zip -ul9 zlib$$v $(DISTFILES)
slouken@521
    96
	mv Makefile~ Makefile
slouken@521
    97
slouken@521
    98
dist:
slouken@521
    99
	mv Makefile Makefile~; cp -p Makefile.in Makefile
slouken@521
   100
	rm -f test.c ztest*.c
slouken@521
   101
	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
slouken@521
   102
	rm -f $$d.tar.gz; \
slouken@521
   103
	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
slouken@521
   104
	files=""; \
slouken@521
   105
	for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
slouken@521
   106
	cd ..; \
slouken@521
   107
	GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
slouken@521
   108
	if test ! -d $$d; then rm -f $$d; fi
slouken@521
   109
	mv Makefile~ Makefile
slouken@521
   110
slouken@521
   111
tags:
slouken@521
   112
	etags *.[ch]
slouken@521
   113
slouken@521
   114
depend:
slouken@521
   115
	makedepend -- $(CFLAGS) -- *.[ch]
slouken@521
   116
slouken@521
   117
# DO NOT DELETE THIS LINE -- make depend depends on it.
slouken@521
   118
slouken@521
   119
adler32.o: zlib.h zconf.h
slouken@521
   120
compress.o: zlib.h zconf.h
slouken@521
   121
crc32.o: zlib.h zconf.h
slouken@521
   122
deflate.o: deflate.h zutil.h zlib.h zconf.h
slouken@521
   123
example.o: zlib.h zconf.h
slouken@521
   124
gzio.o: zutil.h zlib.h zconf.h
slouken@521
   125
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
slouken@521
   126
infcodes.o: zutil.h zlib.h zconf.h
slouken@521
   127
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
slouken@521
   128
inffast.o: zutil.h zlib.h zconf.h inftrees.h
slouken@521
   129
inffast.o: infblock.h infcodes.h infutil.h inffast.h
slouken@521
   130
inflate.o: zutil.h zlib.h zconf.h infblock.h
slouken@521
   131
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
slouken@521
   132
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
slouken@521
   133
minigzip.o: zlib.h zconf.h
slouken@521
   134
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
slouken@521
   135
uncompr.o: zlib.h zconf.h
slouken@521
   136
zutil.o: zutil.h zlib.h zconf.h