makefile.bor 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. CPPFLAGS=-I$(ZLIB_DIR)
  45. CFLAGS=-O2 -Z -X- -w -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
  46. # -M generate map file
  47. LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
  48. ## Variables
  49. OBJS = \
  50. png.obj \
  51. pngerror.obj \
  52. pngget.obj \
  53. pngmem.obj \
  54. pngpread.obj \
  55. pngread.obj \
  56. pngrio.obj \
  57. pngrtran.obj \
  58. pngrutil.obj \
  59. pngset.obj \
  60. pngtrans.obj \
  61. pngwio.obj \
  62. pngwrite.obj \
  63. pngwtran.obj \
  64. pngwutil.obj
  65. LIBOBJS = \
  66. +png.obj \
  67. +pngerror.obj \
  68. +pngget.obj \
  69. +pngmem.obj \
  70. +pngpread.obj \
  71. +pngread.obj \
  72. +pngrio.obj \
  73. +pngrtran.obj \
  74. +pngrutil.obj \
  75. +pngset.obj \
  76. +pngtrans.obj \
  77. +pngwio.obj \
  78. +pngwrite.obj \
  79. +pngwtran.obj \
  80. +pngwutil.obj
  81. LIBNAME=libpng$(MODEL).lib
  82. ## Implicit rules
  83. # Braces let make "batch" calls to the compiler,
  84. # 2 calls instead of 12; space is important.
  85. .c.obj:
  86. $(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
  87. .c.exe:
  88. $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
  89. $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
  90. ## Major targets
  91. all: libpng pngtest
  92. # try !inlude scripts\pnglibconf.mak for more options
  93. pnglibconf.h: scripts\pnglibconf.h.prebuilt
  94. copy scripts\pnglibconf.h.prebuilt $@
  95. libpng: $(LIBNAME)
  96. pngtest: pngtest$(MODEL).exe
  97. test: pngtest$(MODEL).exe
  98. pngtest$(MODEL)
  99. ## Minor Targets
  100. png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  101. pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  102. pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  103. pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  104. pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  105. pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  106. pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  107. pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  108. pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  109. pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  110. pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  111. pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  112. pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  113. pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  114. pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  115. $(LIBNAME): $(OBJS)
  116. -del $(LIBNAME)
  117. $(LIB) $(LIBNAME) @&&|
  118. $(LIBOBJS), libpng$(MODEL)
  119. |
  120. pngtest$(MODEL).obj: pngtest.c png.h pngconf.h pnglibconf.h
  121. $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c
  122. pngtest$(MODEL).exe: pngtest$(MODEL).obj
  123. $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
  124. # Clean up anything else you want
  125. clean:
  126. -del pnglibconf.h
  127. -del *.obj
  128. -del *.exe
  129. -del *.lib
  130. -del *.lst
  131. -del *.map
  132. # End of makefile for libpng