Makefile.dj2 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 gzclose.o gzlib.o gzread.o gzwrite.o \
  47. uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
  48. OBJA =
  49. # to use the asm code: make OBJA=match.o
  50. TEST_OBJS = example.o minigzip.o
  51. all: example.exe minigzip.exe
  52. check: test
  53. test: all
  54. ./example
  55. echo hello world | .\minigzip | .\minigzip -d
  56. %.o : %.c
  57. $(CC) $(CFLAGS) -c $< -o $@
  58. libz.a: $(OBJS) $(OBJA)
  59. $(AR) $@ $(OBJS) $(OBJA)
  60. %.exe : %.o $(LIBS)
  61. $(LD) $@ $< $(LDLIBS)
  62. # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env .
  63. .PHONY : uninstall clean
  64. install: $(INCL) $(LIBS)
  65. -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH)
  66. -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH)
  67. $(INSTALL) zlib.h $(INCLUDE_PATH)
  68. $(INSTALL) zconf.h $(INCLUDE_PATH)
  69. $(INSTALL) libz.a $(LIBRARY_PATH)
  70. uninstall:
  71. $(RM) $(INCLUDE_PATH)\zlib.h
  72. $(RM) $(INCLUDE_PATH)\zconf.h
  73. $(RM) $(LIBRARY_PATH)\libz.a
  74. clean:
  75. $(RM) *.d
  76. $(RM) *.o
  77. $(RM) *.exe
  78. $(RM) libz.a
  79. $(RM) foo.gz
  80. DEPS := $(wildcard *.d)
  81. ifneq ($(DEPS),)
  82. include $(DEPS)
  83. endif