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