cannam@128: # Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. cannam@128: # Copyright (C) 1995-1998 Jean-loup Gailly. cannam@128: # For conditions of distribution and use, see copyright notice in zlib.h cannam@128: cannam@128: # To compile, or to compile and test, type: cannam@128: # cannam@128: # make -fmakefile.dj2; make test -fmakefile.dj2 cannam@128: # cannam@128: # To install libz.a, zconf.h and zlib.h in the djgpp directories, type: cannam@128: # cannam@128: # make install -fmakefile.dj2 cannam@128: # cannam@128: # after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as cannam@128: # in the sample below if the pattern of the DJGPP distribution is to cannam@128: # be followed. Remember that, while 'es around <=> are ignored in cannam@128: # makefiles, they are *not* in batch files or in djgpp.env. cannam@128: # - - - - - cannam@128: # [make] cannam@128: # INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include cannam@128: # LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib cannam@128: # BUTT=-m486 cannam@128: # - - - - - cannam@128: # Alternately, these variables may be defined below, overriding the values cannam@128: # in djgpp.env, as cannam@128: # INCLUDE_PATH=c:\usr\include cannam@128: # LIBRARY_PATH=c:\usr\lib cannam@128: cannam@128: CC=gcc cannam@128: cannam@128: #CFLAGS=-MMD -O cannam@128: #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 cannam@128: #CFLAGS=-MMD -g -DDEBUG cannam@128: CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ cannam@128: -Wstrict-prototypes -Wmissing-prototypes cannam@128: cannam@128: # If cp.exe is available, replace "copy /Y" with "cp -fp" . cannam@128: CP=copy /Y cannam@128: # If gnu install.exe is available, replace $(CP) with ginstall. cannam@128: INSTALL=$(CP) cannam@128: # The default value of RM is "rm -f." If "rm.exe" is found, comment out: cannam@128: RM=del cannam@128: LDLIBS=-L. -lz cannam@128: LD=$(CC) -s -o cannam@128: LDSHARED=$(CC) cannam@128: cannam@128: INCL=zlib.h zconf.h cannam@128: LIBS=libz.a cannam@128: cannam@128: AR=ar rcs cannam@128: cannam@128: prefix=/usr/local cannam@128: exec_prefix = $(prefix) cannam@128: cannam@128: OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ cannam@128: uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o cannam@128: cannam@128: OBJA = cannam@128: # to use the asm code: make OBJA=match.o cannam@128: cannam@128: TEST_OBJS = example.o minigzip.o cannam@128: cannam@128: all: example.exe minigzip.exe cannam@128: cannam@128: check: test cannam@128: test: all cannam@128: ./example cannam@128: echo hello world | .\minigzip | .\minigzip -d cannam@128: cannam@128: %.o : %.c cannam@128: $(CC) $(CFLAGS) -c $< -o $@ cannam@128: cannam@128: libz.a: $(OBJS) $(OBJA) cannam@128: $(AR) $@ $(OBJS) $(OBJA) cannam@128: cannam@128: %.exe : %.o $(LIBS) cannam@128: $(LD) $@ $< $(LDLIBS) cannam@128: cannam@128: # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . cannam@128: cannam@128: .PHONY : uninstall clean cannam@128: cannam@128: install: $(INCL) $(LIBS) cannam@128: -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) cannam@128: -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) cannam@128: $(INSTALL) zlib.h $(INCLUDE_PATH) cannam@128: $(INSTALL) zconf.h $(INCLUDE_PATH) cannam@128: $(INSTALL) libz.a $(LIBRARY_PATH) cannam@128: cannam@128: uninstall: cannam@128: $(RM) $(INCLUDE_PATH)\zlib.h cannam@128: $(RM) $(INCLUDE_PATH)\zconf.h cannam@128: $(RM) $(LIBRARY_PATH)\libz.a cannam@128: cannam@128: clean: cannam@128: $(RM) *.d cannam@128: $(RM) *.o cannam@128: $(RM) *.exe cannam@128: $(RM) libz.a cannam@128: $(RM) foo.gz cannam@128: cannam@128: DEPS := $(wildcard *.d) cannam@128: ifneq ($(DEPS),) cannam@128: include $(DEPS) cannam@128: endif