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