Makefile.emx 1.4 KB
Newer Older
M
Mark Adler 已提交
1
# Makefile for zlib.  Modified for emx/rsxnt by Chr. Spieler, 6/16/98.
M
Mark Adler 已提交
2
# 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

M
Mark Adler 已提交
10
CC=gcc -Zwin32
M
Mark Adler 已提交
11 12 13

#CFLAGS=-MMD -O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
14
#CFLAGS=-MMD -g -DZLIB_DEBUG
M
Mark Adler 已提交
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
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)

M
Mark Adler 已提交
36
OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
M
Mark Adler 已提交
37
       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.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