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