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