kusano fc6ab3
# Makefile for zlib.  Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
kusano fc6ab3
# Copyright (C) 1995-1998 Jean-loup Gailly.
kusano fc6ab3
# For conditions of distribution and use, see copyright notice in zlib.h
kusano fc6ab3
kusano fc6ab3
# To compile, or to compile and test, type:
kusano fc6ab3
#
kusano fc6ab3
#   make -fmakefile.emx;  make test -fmakefile.emx
kusano fc6ab3
#
kusano fc6ab3
kusano fc6ab3
CC=gcc -Zwin32
kusano fc6ab3
kusano fc6ab3
#CFLAGS=-MMD -O
kusano fc6ab3
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
kusano fc6ab3
#CFLAGS=-MMD -g -DDEBUG
kusano fc6ab3
CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
kusano fc6ab3
             -Wstrict-prototypes -Wmissing-prototypes
kusano fc6ab3
kusano fc6ab3
# If cp.exe is available, replace "copy /Y" with "cp -fp" .
kusano fc6ab3
CP=copy /Y
kusano fc6ab3
# If gnu install.exe is available, replace $(CP) with ginstall.
kusano fc6ab3
INSTALL=$(CP)
kusano fc6ab3
# The default value of RM is "rm -f."  If "rm.exe" is found, comment out:
kusano fc6ab3
RM=del
kusano fc6ab3
LDLIBS=-L. -lzlib
kusano fc6ab3
LD=$(CC) -s -o
kusano fc6ab3
LDSHARED=$(CC)
kusano fc6ab3
kusano fc6ab3
INCL=zlib.h zconf.h
kusano fc6ab3
LIBS=zlib.a
kusano fc6ab3
kusano fc6ab3
AR=ar rcs
kusano fc6ab3
kusano fc6ab3
prefix=/usr/local
kusano fc6ab3
exec_prefix = $(prefix)
kusano fc6ab3
kusano fc6ab3
OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
kusano fc6ab3
       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
kusano fc6ab3
kusano fc6ab3
TEST_OBJS = example.o minigzip.o
kusano fc6ab3
kusano fc6ab3
all: example.exe minigzip.exe
kusano fc6ab3
kusano fc6ab3
test: all
kusano fc6ab3
	./example
kusano fc6ab3
	echo hello world | .\minigzip | .\minigzip -d
kusano fc6ab3
kusano fc6ab3
%.o : %.c
kusano fc6ab3
	$(CC) $(CFLAGS) -c $< -o $@
kusano fc6ab3
kusano fc6ab3
zlib.a: $(OBJS)
kusano fc6ab3
	$(AR) $@ $(OBJS)
kusano fc6ab3
kusano fc6ab3
%.exe : %.o $(LIBS)
kusano fc6ab3
	$(LD) $@ $< $(LDLIBS)
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
.PHONY : clean
kusano fc6ab3
kusano fc6ab3
clean:
kusano fc6ab3
	$(RM) *.d
kusano fc6ab3
	$(RM) *.o
kusano fc6ab3
	$(RM) *.exe
kusano fc6ab3
	$(RM) zlib.a
kusano fc6ab3
	$(RM) foo.gz
kusano fc6ab3
kusano fc6ab3
DEPS := $(wildcard *.d)
kusano fc6ab3
ifneq ($(DEPS),)
kusano fc6ab3
include $(DEPS)
kusano fc6ab3
endif