You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.0 KiB

  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. # To compile, or to compile and test, type:
  6. #
  7. # make -fmakefile.gcc; make test -fmakefile.gcc
  8. #
  9. # To install libz.a, zconf.h and zlib.h in the mingw32 directories, type:
  10. #
  11. # make install -fmakefile.gcc
  12. #
  13. CC=gcc
  14. #CFLAGS=-MMD -O
  15. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  16. #CFLAGS=-MMD -g -DDEBUG
  17. CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
  18. -Wstrict-prototypes -Wmissing-prototypes
  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. INCL=zlib.h zconf.h
  29. LIBS=libz.a
  30. AR=ar rcs
  31. prefix=/usr/local
  32. exec_prefix = $(prefix)
  33. OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
  34. zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
  35. TEST_OBJS = example.o minigzip.o
  36. all: example.exe minigzip.exe
  37. test: all
  38. ./example
  39. echo hello world | .\minigzip | .\minigzip -d
  40. %.o : %.c
  41. $(CC) $(CFLAGS) -c $< -o $@
  42. libz.a: $(OBJS)
  43. $(AR) $@ $(OBJS)
  44. %.exe : %.o $(LIBS)
  45. $(LD) $@ $< $(LDLIBS)
  46. # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
  47. .PHONY : uninstall clean
  48. install: $(INCL) $(LIBS)
  49. -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
  50. -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
  51. $(INSTALL) zlib.h $(INCLUDE_PATH)
  52. $(INSTALL) zconf.h $(INCLUDE_PATH)
  53. $(INSTALL) libz.a $(LIBRARY_PATH)
  54. uninstall:
  55. $(RM) $(INCLUDE_PATH)\zlib.h
  56. $(RM) $(INCLUDE_PATH)\zconf.h
  57. $(RM) $(LIBRARY_PATH)\libz.a
  58. clean:
  59. $(RM) *.d
  60. $(RM) *.o
  61. $(RM) *.exe
  62. $(RM) libz.a
  63. $(RM) foo.gz
  64. DEPS := $(wildcard *.d)
  65. ifneq ($(DEPS),)
  66. include $(DEPS)
  67. endif