home *** CD-ROM | disk | FTP | other *** search
/ Freelog 11 / Freelog011.iso / Bas / Compression / ZLib / nt / Makefile.gcc < prev    next >
Makefile  |  1998-07-08  |  2KB  |  88 lines

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