makefile.bor 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # Makefile for libpng
  2. # 16-bit Borland C++ (Note: All modules are compiled in C mode)
  3. # To build the library, do:
  4. # "make -fmakefile.bor -DMODEL=c"
  5. # or: "make -fmakefile.bor -DMODEL=l"
  6. #
  7. # ------------ Borland C++ ------------
  8. ### Absolutely necessary for this makefile to work
  9. .AUTODEPEND
  10. ## Where zlib.h, zconf.h and zlib_MODEL.lib are
  11. ZLIB_DIR=..\zlib
  12. ## Compiler, linker and lib stuff
  13. CC=bcc
  14. LD=bcc
  15. LIB=tlib
  16. !ifndef MODEL
  17. MODEL=l
  18. !endif
  19. MODEL_ARG=-m$(MODEL)
  20. #TARGET_CPU=3
  21. # 2 = 286, 3 = 386, etc.
  22. !ifndef TARGET_CPU
  23. TARGET_CPU=2
  24. !endif
  25. # Use this if you don't want Borland's fancy exception handling
  26. # (for Borland C++ 4.0 or later)
  27. #NOEHLIB=noeh$(MODEL).lib
  28. !ifdef DEBUG
  29. CDEBUG=-v
  30. LDEBUG=-v
  31. !else
  32. CDEBUG=
  33. LDEBUG=
  34. !endif
  35. # STACKOFLOW=1
  36. !ifdef STACKOFLOW
  37. CDEBUG=$(CDEBUG) -N
  38. LDEBUG=$(LDEBUG) -N
  39. !endif
  40. # -X- turn on dependency generation in the object file
  41. # -w set all warnings on
  42. # -O2 optimize for speed
  43. # -Z global optimization
  44. CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
  45. # -M generate map file
  46. LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
  47. ## Variables
  48. OBJS = \
  49. png.obj \
  50. pngerror.obj \
  51. pngget.obj \
  52. pngmem.obj \
  53. pngpread.obj \
  54. pngread.obj \
  55. pngrio.obj \
  56. pngrtran.obj \
  57. pngrutil.obj \
  58. pngset.obj \
  59. pngtrans.obj \
  60. pngwio.obj \
  61. pngwrite.obj \
  62. pngwtran.obj \
  63. pngwutil.obj
  64. LIBOBJS = \
  65. +png.obj \
  66. +pngerror.obj \
  67. +pngget.obj \
  68. +pngmem.obj \
  69. +pngpread.obj \
  70. +pngread.obj \
  71. +pngrio.obj \
  72. +pngrtran.obj \
  73. +pngrutil.obj \
  74. +pngset.obj \
  75. +pngtrans.obj \
  76. +pngwio.obj \
  77. +pngwrite.obj \
  78. +pngwtran.obj \
  79. +pngwutil.obj
  80. LIBNAME=libpng$(MODEL).lib
  81. ## Implicit rules
  82. # Braces let make "batch" calls to the compiler,
  83. # 2 calls instead of 12; space is important.
  84. .c.obj:
  85. $(CC) $(CFLAGS) -c {$*.c }
  86. .c.exe:
  87. $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
  88. ## Major targets
  89. all: libpng pngtest
  90. # try !inlude scripts\pnglibconf.mak for more options
  91. pnglibconf.h: scripts\pnglibconf.h.prebuilt
  92. copy scripts\pnglibconf.h.prebuilt $@
  93. libpng: $(LIBNAME)
  94. pngtest: pngtest$(MODEL).exe
  95. test: pngtest$(MODEL).exe
  96. pngtest$(MODEL)
  97. ## Minor Targets
  98. png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  99. pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  100. pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  101. pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  102. pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  103. pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  104. pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  105. pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  106. pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  107. pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  108. pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  109. pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  110. pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  111. pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  112. pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  113. $(LIBNAME): $(OBJS)
  114. -del $(LIBNAME)
  115. $(LIB) $(LIBNAME) @&&|
  116. $(LIBOBJS), libpng$(MODEL)
  117. |
  118. pngtest$(MODEL).obj: pngtest.c png.h pngconf.h pnglibconf.h
  119. $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c
  120. pngtest$(MODEL).exe: pngtest$(MODEL).obj
  121. $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
  122. # Clean up anything else you want
  123. clean:
  124. -del pnglibconf.h
  125. -del *.obj
  126. -del *.exe
  127. -del *.lib
  128. -del *.lst
  129. -del *.map
  130. # End of makefile for libpng