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