home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / cvs-1.8.7-src.tgz / tar.out / fsf / cvs / zlib / Makefile.dj2 < prev    next >
Makefile  |  1996-09-28  |  2KB  |  94 lines

  1. # Makefile for zlib.  Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96.
  2. # Copyright (C) 1995-1996 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.  
  23. CC=gcc
  24.  
  25. #CFLAGS=-MMD -O
  26. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  27. #CFLAGS=-MMD -g -DDEBUG
  28. CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
  29.              -Wstrict-prototypes -Wmissing-prototypes
  30.  
  31. # If cp.exe is not found, replace with copy /Y .
  32. CP=cp -f
  33. # If install.exe is not found, replace with $(CP).
  34. INSTALL=install
  35. # The default value of RM is "rm -f."  If "rm.exe" is not found, uncomment:
  36. # RM=del
  37. LDLIBS=-L. -lz
  38. LD=$(CC) -s -o
  39. LDSHARED=$(CC)
  40.  
  41. INCL=zlib.h zconf.h
  42. LIBS=libz.a
  43.  
  44. AR=ar rcs
  45.  
  46. prefix=/usr/local
  47. exec_prefix = $(prefix)
  48.  
  49. OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
  50.        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
  51.  
  52. TEST_OBJS = example.o minigzip.o
  53.  
  54. all: example.exe minigzip.exe
  55.  
  56. test: all
  57.     ./example
  58.     echo hello world | .\minigzip | .\minigzip -d 
  59.  
  60. %.o : %.c
  61.     $(CC) $(CFLAGS) -c $< -o $@
  62.  
  63. libz.a: $(OBJS)
  64.     $(AR) $@ $(OBJS)
  65.  
  66. %.exe : %.o $(LIBS)
  67.     $(LD) $@ $< $(LDLIBS)
  68.  
  69. # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
  70.  
  71. .PHONY : uninstall clean
  72.  
  73. install: $(INCL) $(LIBS)
  74.     -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
  75.     -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
  76.     for %%f in ($(INCL)) do $(INSTALL) %%f $(INCLUDE_PATH)
  77.     for %%p in ($(LIBS)) do $(INSTALL) %%p $(LIBRARY_PATH)
  78.  
  79. uninstall:
  80.     for %%f in ($(INCL)) do $(RM) $(INCLUDE_PATH)\%%f
  81.     for %%p in ($(LIBS)) do $(RM) $(LIBRARY_PATH)\%%p
  82.  
  83. clean:
  84.     for %%p in (*.d *.o *.exe libz.a libz.so*) do $(RM) %%p
  85.  
  86. DEPS := $(wildcard *.d)
  87. ifneq ($(DEPS),)
  88. include $(DEPS)
  89. endif
  90.