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