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