home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / Bas / Compression / ZLib / msdos / Makefile.dj2 < prev    next >
Makefile  |  1998-01-15  |  3KB  |  101 lines

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