external/zlib-1.2.11/old/Makefile.emx
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.  Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
slouken@521
     2
# Copyright (C) 1995-1998 Jean-loup Gailly.
slouken@521
     3
# For conditions of distribution and use, see copyright notice in zlib.h
slouken@521
     4
slouken@521
     5
# To compile, or to compile and test, type:
slouken@521
     6
#
slouken@521
     7
#   make -fmakefile.emx;  make test -fmakefile.emx
slouken@521
     8
#
slouken@521
     9
slouken@521
    10
CC=gcc -Zwin32
slouken@521
    11
slouken@521
    12
#CFLAGS=-MMD -O
slouken@521
    13
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
slouken@521
    14
#CFLAGS=-MMD -g -DZLIB_DEBUG
slouken@521
    15
CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
slouken@521
    16
             -Wstrict-prototypes -Wmissing-prototypes
slouken@521
    17
slouken@521
    18
# If cp.exe is available, replace "copy /Y" with "cp -fp" .
slouken@521
    19
CP=copy /Y
slouken@521
    20
# If gnu install.exe is available, replace $(CP) with ginstall.
slouken@521
    21
INSTALL=$(CP)
slouken@521
    22
# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
slouken@521
    23
RM=del
slouken@521
    24
LDLIBS=-L. -lzlib
slouken@521
    25
LD=$(CC) -s -o
slouken@521
    26
LDSHARED=$(CC)
slouken@521
    27
slouken@521
    28
INCL=zlib.h zconf.h
slouken@521
    29
LIBS=zlib.a
slouken@521
    30
slouken@521
    31
AR=ar rcs
slouken@521
    32
slouken@521
    33
prefix=/usr/local
slouken@521
    34
exec_prefix = $(prefix)
slouken@521
    35
slouken@521
    36
OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
slouken@521
    37
       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
slouken@521
    38
slouken@521
    39
TEST_OBJS = example.o minigzip.o
slouken@521
    40
slouken@521
    41
all: example.exe minigzip.exe
slouken@521
    42
slouken@521
    43
test: all
slouken@521
    44
	./example
slouken@521
    45
	echo hello world | .\minigzip | .\minigzip -d
slouken@521
    46
slouken@521
    47
%.o : %.c
slouken@521
    48
	$(CC) $(CFLAGS) -c $< -o $@
slouken@521
    49
slouken@521
    50
zlib.a: $(OBJS)
slouken@521
    51
	$(AR) $@ $(OBJS)
slouken@521
    52
slouken@521
    53
%.exe : %.o $(LIBS)
slouken@521
    54
	$(LD) $@ $< $(LDLIBS)
slouken@521
    55
slouken@521
    56
slouken@521
    57
.PHONY : clean
slouken@521
    58
slouken@521
    59
clean:
slouken@521
    60
	$(RM) *.d
slouken@521
    61
	$(RM) *.o
slouken@521
    62
	$(RM) *.exe
slouken@521
    63
	$(RM) zlib.a
slouken@521
    64
	$(RM) foo.gz
slouken@521
    65
slouken@521
    66
DEPS := $(wildcard *.d)
slouken@521
    67
ifneq ($(DEPS),)
slouken@521
    68
include $(DEPS)
slouken@521
    69
endif