Makefile.emx 1.4 KB
Newer Older
M
Mark Adler 已提交
1 2
# Makefile for zlib.  Modified for emx 0.9c by Chr. Spieler, 6/17/98.
# Copyright (C) 1995-1998 Jean-loup Gailly.
M
Mark Adler 已提交
3
# For conditions of distribution and use, see copyright notice in zlib.h
M
Mark Adler 已提交
4 5

# To compile, or to compile and test, type:
M
Mark Adler 已提交
6
#
M
Mark Adler 已提交
7
#   make -fmakefile.emx;  make test -fmakefile.emx
M
Mark Adler 已提交
8
#
M
Mark Adler 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

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 \
M
Mark Adler 已提交
37
       zutil.o inflate.o infback.o inftrees.o inffast.o
M
Mark Adler 已提交
38 39 40 41 42 43 44

TEST_OBJS = example.o minigzip.o

all: example.exe minigzip.exe

test: all
	./example
M
Mark Adler 已提交
45
	echo hello world | .\minigzip | .\minigzip -d
M
Mark Adler 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

%.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