makefile.bor 4.2 KB

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