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 CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG) 55 56 # -M generate map file 57 LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG) 58 59 ## Variables 60 61 OBJS = \ 62 png.obj \ 63 pngerror.obj \ 64 pngget.obj \ 65 pngmem.obj \ 66 pngpread.obj \ 67 pngread.obj \ 68 pngrio.obj \ 69 pngrtran.obj \ 70 pngrutil.obj \ 71 pngset.obj \ 72 pngtrans.obj \ 73 pngwio.obj \ 74 pngwrite.obj \ 75 pngwtran.obj \ 76 pngwutil.obj 77 78 LIBOBJS = \ 79 +png.obj \ 80 +pngerror.obj \ 81 +pngget.obj \ 82 +pngmem.obj \ 83 +pngpread.obj \ 84 +pngread.obj \ 85 +pngrio.obj \ 86 +pngrtran.obj \ 87 +pngrutil.obj \ 88 +pngset.obj \ 89 +pngtrans.obj \ 90 +pngwio.obj \ 91 +pngwrite.obj \ 92 +pngwtran.obj \ 93 +pngwutil.obj 94 95 LIBNAME=libpng$(MODEL).lib 96 97 ## Implicit rules 98 99 # Braces let make "batch" calls to the compiler, 100 # 2 calls instead of 12; space is important. 101 .c.obj: 102 $(CC) $(CFLAGS) -c {$*.c } 103 104 .c.exe: 105 $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) 106 107 ## Major targets 108 109 all: libpng pngtest 110 111 libpng: $(LIBNAME) 112 113 pngtest: pngtest$(MODEL).exe 114 115 test: pngtest$(MODEL).exe 116 pngtest$(MODEL) 117 118 ## Minor Targets 119 120 png.obj: png.c png.h pngconf.h 121 pngerror.obj: pngerror.c png.h pngconf.h 122 pngget.obj: pngget.c png.h pngconf.h 123 pngmem.obj: pngmem.c png.h pngconf.h 124 pngpread.obj: pngpread.c png.h pngconf.h 125 pngread.obj: pngread.c png.h pngconf.h 126 pngrio.obj: pngrio.c png.h pngconf.h 127 pngrtran.obj: pngrtran.c png.h pngconf.h 128 pngrutil.obj: pngrutil.c png.h pngconf.h 129 pngset.obj: pngset.c png.h pngconf.h 130 pngtrans.obj: pngtrans.c png.h pngconf.h 131 pngwio.obj: pngwio.c png.h pngconf.h 132 pngwrite.obj: pngwrite.c png.h pngconf.h 133 pngwtran.obj: pngwtran.c png.h pngconf.h 134 pngwutil.obj: pngwutil.c png.h pngconf.h 135 136 $(LIBNAME): $(OBJS) 137 -del $(LIBNAME) 138 $(LIB) $(LIBNAME) @&&| 139 $(LIBOBJS), libpng$(MODEL) 140 | 141 142 pngtest$(MODEL).obj: pngtest.c png.h pngconf.h 143 $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c 144 145 pngtest$(MODEL).exe: pngtest$(MODEL).obj 146 $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) 147 148 # Clean up anything else you want 149 clean: 150 -del *.obj 151 -del *.exe 152 -del *.lib 153 -del *.lst 154 -del *.map 155 156 # End of makefile for libpng 157