Makefile.bor 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Makefile for zlib
  2. # Borland C++
  3. # Last updated: 15-Mar-2003
  4. # To use, do "make -fmakefile.bor"
  5. # To compile in small model, set below: MODEL=s
  6. # WARNING: the small model is supported but only for small values of
  7. # MAX_WBITS and MAX_MEM_LEVEL. For example:
  8. # -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
  9. # If you wish to reduce the memory requirements (default 256K for big
  10. # objects plus a few K), you can add to the LOC macro below:
  11. # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
  12. # See zconf.h for details about the memory requirements.
  13. # ------------ Turbo C++, Borland C++ ------------
  14. # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
  15. # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
  16. # to the declaration of LOC here:
  17. LOC = $(LOCAL_ZLIB)
  18. # type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  19. CPU_TYP = 0
  20. # memory model: one of s, m, c, l (small, medium, compact, large)
  21. MODEL=l
  22. # replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
  23. CC=bcc
  24. LD=bcc
  25. AR=tlib
  26. # compiler flags
  27. # replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
  28. CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
  29. LDFLAGS=-m$(MODEL) -f-
  30. # variables
  31. ZLIB_LIB = zlib_$(MODEL).lib
  32. OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
  33. OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
  34. OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
  35. OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
  36. # targets
  37. all: $(ZLIB_LIB) example.exe minigzip.exe
  38. .c.obj:
  39. $(CC) -c $(CFLAGS) $*.c
  40. adler32.obj: adler32.c zlib.h zconf.h
  41. compress.obj: compress.c zlib.h zconf.h
  42. crc32.obj: crc32.c zlib.h zconf.h crc32.h
  43. deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
  44. gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
  45. gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
  46. gzread.obj: gzread.c zlib.h zconf.h gzguts.h
  47. gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
  48. infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  49. inffast.h inffixed.h
  50. inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  51. inffast.h
  52. inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  53. inffast.h inffixed.h
  54. inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
  55. trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
  56. uncompr.obj: uncompr.c zlib.h zconf.h
  57. zutil.obj: zutil.c zutil.h zlib.h zconf.h
  58. example.obj: example.c zlib.h zconf.h
  59. minigzip.obj: minigzip.c zlib.h zconf.h
  60. # the command line is cut to fit in the MS-DOS 128 byte limit:
  61. $(ZLIB_LIB): $(OBJ1) $(OBJ2)
  62. -del $(ZLIB_LIB)
  63. $(AR) $(ZLIB_LIB) $(OBJP1)
  64. $(AR) $(ZLIB_LIB) $(OBJP2)
  65. example.exe: example.obj $(ZLIB_LIB)
  66. $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
  67. minigzip.exe: minigzip.obj $(ZLIB_LIB)
  68. $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
  69. test: example.exe minigzip.exe
  70. example
  71. echo hello world | minigzip | minigzip -d
  72. clean:
  73. -del *.obj
  74. -del *.lib
  75. -del *.exe
  76. -del zlib_*.bak
  77. -del foo.gz