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.

100 lines
2.5 KiB

  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. # To compile, or to compile and test, type:
  5. #
  6. # make -fmakefile.dj2; make test -fmakefile.dj2
  7. #
  8. # To install libz.a, zconf.h and zlib.h in the djgpp directories, type:
  9. #
  10. # make install -fmakefile.dj2
  11. #
  12. # after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as
  13. # in the sample below if the pattern of the DJGPP distribution is to
  14. # be followed. Remember that, while <sp>'es around <=> are ignored in
  15. # makefiles, they are *not* in batch files or in djgpp.env.
  16. # - - - - -
  17. # [make]
  18. # INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include
  19. # LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib
  20. # BUTT=-m486
  21. # - - - - -
  22. # Alternately, these variables may be defined below, overriding the values
  23. # in djgpp.env, as
  24. # INCLUDE_PATH=c:\usr\include
  25. # LIBRARY_PATH=c:\usr\lib
  26. CC=gcc
  27. #CFLAGS=-MMD -O
  28. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  29. #CFLAGS=-MMD -g -DDEBUG
  30. CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
  31. -Wstrict-prototypes -Wmissing-prototypes
  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. INCL=zlib.h zconf.h
  42. LIBS=libz.a
  43. AR=ar rcs
  44. prefix=/usr/local
  45. exec_prefix = $(prefix)
  46. OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
  47. zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
  48. TEST_OBJS = example.o minigzip.o
  49. all: example.exe minigzip.exe
  50. test: all
  51. ./example
  52. echo hello world | .\minigzip | .\minigzip -d
  53. %.o : %.c
  54. $(CC) $(CFLAGS) -c $< -o $@
  55. libz.a: $(OBJS)
  56. $(AR) $@ $(OBJS)
  57. %.exe : %.o $(LIBS)
  58. $(LD) $@ $< $(LDLIBS)
  59. # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
  60. .PHONY : uninstall clean
  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. uninstall:
  68. $(RM) $(INCLUDE_PATH)\zlib.h
  69. $(RM) $(INCLUDE_PATH)\zconf.h
  70. $(RM) $(LIBRARY_PATH)\libz.a
  71. clean:
  72. $(RM) *.d
  73. $(RM) *.o
  74. $(RM) *.exe
  75. $(RM) libz.a
  76. $(RM) foo.gz
  77. DEPS := $(wildcard *.d)
  78. ifneq ($(DEPS),)
  79. include $(DEPS)
  80. endif