1*44bedb31SLionel Sambuc# Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. 2*44bedb31SLionel Sambuc# Copyright (C) 1995-1998 Jean-loup Gailly. 3*44bedb31SLionel Sambuc# For conditions of distribution and use, see copyright notice in zlib.h 4*44bedb31SLionel Sambuc 5*44bedb31SLionel Sambuc# To compile, or to compile and test, type: 6*44bedb31SLionel Sambuc# 7*44bedb31SLionel Sambuc# make -fmakefile.dj2; make test -fmakefile.dj2 8*44bedb31SLionel Sambuc# 9*44bedb31SLionel Sambuc# To install libz.a, zconf.h and zlib.h in the djgpp directories, type: 10*44bedb31SLionel Sambuc# 11*44bedb31SLionel Sambuc# make install -fmakefile.dj2 12*44bedb31SLionel Sambuc# 13*44bedb31SLionel Sambuc# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as 14*44bedb31SLionel Sambuc# in the sample below if the pattern of the DJGPP distribution is to 15*44bedb31SLionel Sambuc# be followed. Remember that, while <sp>'es around <=> are ignored in 16*44bedb31SLionel Sambuc# makefiles, they are *not* in batch files or in djgpp.env. 17*44bedb31SLionel Sambuc# - - - - - 18*44bedb31SLionel Sambuc# [make] 19*44bedb31SLionel Sambuc# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include 20*44bedb31SLionel Sambuc# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib 21*44bedb31SLionel Sambuc# BUTT=-m486 22*44bedb31SLionel Sambuc# - - - - - 23*44bedb31SLionel Sambuc# Alternately, these variables may be defined below, overriding the values 24*44bedb31SLionel Sambuc# in djgpp.env, as 25*44bedb31SLionel Sambuc# INCLUDE_PATH=c:\usr\include 26*44bedb31SLionel Sambuc# LIBRARY_PATH=c:\usr\lib 27*44bedb31SLionel Sambuc 28*44bedb31SLionel SambucCC=gcc 29*44bedb31SLionel Sambuc 30*44bedb31SLionel Sambuc#CFLAGS=-MMD -O 31*44bedb31SLionel Sambuc#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 32*44bedb31SLionel Sambuc#CFLAGS=-MMD -g -DDEBUG 33*44bedb31SLionel SambucCFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ 34*44bedb31SLionel Sambuc -Wstrict-prototypes -Wmissing-prototypes 35*44bedb31SLionel Sambuc 36*44bedb31SLionel Sambuc# If cp.exe is available, replace "copy /Y" with "cp -fp" . 37*44bedb31SLionel SambucCP=copy /Y 38*44bedb31SLionel Sambuc# If gnu install.exe is available, replace $(CP) with ginstall. 39*44bedb31SLionel SambucINSTALL=$(CP) 40*44bedb31SLionel Sambuc# The default value of RM is "rm -f." If "rm.exe" is found, comment out: 41*44bedb31SLionel SambucRM=del 42*44bedb31SLionel SambucLDLIBS=-L. -lz 43*44bedb31SLionel SambucLD=$(CC) -s -o 44*44bedb31SLionel SambucLDSHARED=$(CC) 45*44bedb31SLionel Sambuc 46*44bedb31SLionel SambucINCL=zlib.h zconf.h 47*44bedb31SLionel SambucLIBS=libz.a 48*44bedb31SLionel Sambuc 49*44bedb31SLionel SambucAR=ar rcs 50*44bedb31SLionel Sambuc 51*44bedb31SLionel Sambucprefix=/usr/local 52*44bedb31SLionel Sambucexec_prefix = $(prefix) 53*44bedb31SLionel Sambuc 54*44bedb31SLionel SambucOBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 55*44bedb31SLionel Sambuc zutil.o inflate.o infback.o inftrees.o inffast.o 56*44bedb31SLionel Sambuc 57*44bedb31SLionel SambucOBJA = 58*44bedb31SLionel Sambuc# to use the asm code: make OBJA=match.o 59*44bedb31SLionel Sambuc 60*44bedb31SLionel SambucTEST_OBJS = example.o minigzip.o 61*44bedb31SLionel Sambuc 62*44bedb31SLionel Sambucall: example.exe minigzip.exe 63*44bedb31SLionel Sambuc 64*44bedb31SLionel Sambuccheck: test 65*44bedb31SLionel Sambuctest: all 66*44bedb31SLionel Sambuc ./example 67*44bedb31SLionel Sambuc echo hello world | .\minigzip | .\minigzip -d 68*44bedb31SLionel Sambuc 69*44bedb31SLionel Sambuc%.o : %.c 70*44bedb31SLionel Sambuc $(CC) $(CFLAGS) -c $< -o $@ 71*44bedb31SLionel Sambuc 72*44bedb31SLionel Sambuclibz.a: $(OBJS) $(OBJA) 73*44bedb31SLionel Sambuc $(AR) $@ $(OBJS) $(OBJA) 74*44bedb31SLionel Sambuc 75*44bedb31SLionel Sambuc%.exe : %.o $(LIBS) 76*44bedb31SLionel Sambuc $(LD) $@ $< $(LDLIBS) 77*44bedb31SLionel Sambuc 78*44bedb31SLionel Sambuc# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . 79*44bedb31SLionel Sambuc 80*44bedb31SLionel Sambuc.PHONY : uninstall clean 81*44bedb31SLionel Sambuc 82*44bedb31SLionel Sambucinstall: $(INCL) $(LIBS) 83*44bedb31SLionel Sambuc -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) 84*44bedb31SLionel Sambuc -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) 85*44bedb31SLionel Sambuc $(INSTALL) zlib.h $(INCLUDE_PATH) 86*44bedb31SLionel Sambuc $(INSTALL) zconf.h $(INCLUDE_PATH) 87*44bedb31SLionel Sambuc $(INSTALL) libz.a $(LIBRARY_PATH) 88*44bedb31SLionel Sambuc 89*44bedb31SLionel Sambucuninstall: 90*44bedb31SLionel Sambuc $(RM) $(INCLUDE_PATH)\zlib.h 91*44bedb31SLionel Sambuc $(RM) $(INCLUDE_PATH)\zconf.h 92*44bedb31SLionel Sambuc $(RM) $(LIBRARY_PATH)\libz.a 93*44bedb31SLionel Sambuc 94*44bedb31SLionel Sambucclean: 95*44bedb31SLionel Sambuc $(RM) *.d 96*44bedb31SLionel Sambuc $(RM) *.o 97*44bedb31SLionel Sambuc $(RM) *.exe 98*44bedb31SLionel Sambuc $(RM) libz.a 99*44bedb31SLionel Sambuc $(RM) foo.gz 100*44bedb31SLionel Sambuc 101*44bedb31SLionel SambucDEPS := $(wildcard *.d) 102*44bedb31SLionel Sambucifneq ($(DEPS),) 103*44bedb31SLionel Sambucinclude $(DEPS) 104*44bedb31SLionel Sambucendif 105