1 # Makefile for libpng 2 # 32-bit Borland C++ (Note: All modules are compiled in C mode) 3 # To build the library, do: 4 # "make -fmakefile.bc32" 5 # 6 # -------------------- 32-bit Borland C++ -------------------- 7 8 ### Absolutely necessary for this makefile to work 9 .AUTODEPEND 10 11 ## Where zlib.h, zconf.h and zlib.lib are 12 ZLIB_DIR=..\zlib 13 14 ## Compiler, linker and lib stuff 15 CC=bcc32 16 LD=bcc32 17 LIB=tlib 18 19 # -3 = 386, -4 = 486, -5 = Pentium etc. 20 !ifndef TARGET_CPU 21 #TARGET_CPU=-6 22 !endif 23 24 # Use this if you don't want Borland's fancy exception handling 25 # (Caution: doesn't work with CBuilderX) 26 #NOEHLIB=noeh32.lib 27 28 !ifdef DEBUG 29 CDEBUG=-v 30 LDEBUG=-v 31 !else 32 CDEBUG= 33 LDEBUG= 34 !endif 35 36 # STACKOFLOW=1 37 !ifdef STACKOFLOW 38 CDEBUG=$(CDEBUG) -N 39 LDEBUG=$(LDEBUG) -N 40 !endif 41 42 # -O2 optimize for speed 43 # -d merge duplicate strings 44 # -k- turn off standard stack frame 45 # -w display all warnings 46 CPPFLAGS=-I$(ZLIB_DIR) 47 CFLAGS=-O2 -d -k- -w $(TARGET_CPU) $(CDEBUG) 48 49 # -M generate map file 50 LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG) 51 52 ## Variables 53 OBJS = \ 54 png.obj \ 55 pngerror.obj \ 56 pngget.obj \ 57 pngmem.obj \ 58 pngpread.obj \ 59 pngread.obj \ 60 pngrio.obj \ 61 pngrtran.obj \ 62 pngrutil.obj \ 63 pngset.obj \ 64 pngtrans.obj \ 65 pngwio.obj \ 66 pngwrite.obj \ 67 pngwtran.obj \ 68 pngwutil.obj 69 70 LIBOBJS = \ 71 +png.obj \ 72 +pngerror.obj \ 73 +pngget.obj \ 74 +pngmem.obj \ 75 +pngpread.obj \ 76 +pngread.obj \ 77 +pngrio.obj \ 78 +pngrtran.obj \ 79 +pngrutil.obj \ 80 +pngset.obj \ 81 +pngtrans.obj \ 82 +pngwio.obj \ 83 +pngwrite.obj \ 84 +pngwtran.obj \ 85 +pngwutil.obj 86 87 LIBNAME=libpng.lib 88 89 ## Implicit rules 90 # Braces let make "batch" calls to the compiler, 91 # 2 calls instead of 12; space is important. 92 .c.obj: 93 $(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c } 94 95 .c.exe: 96 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \ 97 $(LIBNAME) zlib.lib $(NOEHLIB) 98 99 .obj.exe: 100 $(LD) $(LDFLAGS) $*.obj $(LIBNAME) zlib.lib $(NOEHLIB) 101 102 ## Major targets 103 all: libpng pngtest 104 105 libpng: $(LIBNAME) 106 107 pngtest: pngtest.exe 108 109 test: pngtest.exe 110 pngtest 111 112 ## Minor Targets 113 114 # see scripts\pnglibconf.mak for how to make this file 115 # with different options 116 pnglibconf.h: scripts\pnglibconf.h.prebuilt 117 copy scripts\pnglibconf.h.prebuilt $@ 118 119 png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 120 pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 121 pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 122 pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 123 pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 124 pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 125 pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 126 pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 127 pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 128 pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 129 pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 130 pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 131 pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 132 pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 133 pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h 134 pngtest.obj: pngtest.c png.h pngconf.h pnglibconf.h 135 136 $(LIBNAME): $(OBJS) 137 -del $(LIBNAME) 138 $(LIB) $(LIBNAME) @&&| 139 $(LIBOBJS), libpng 140 | 141 142 # Cleanup 143 clean: 144 -del pnglibconf.h 145 -del *.obj 146 -del $(LIBNAME) 147 -del pngtest.exe 148 -del *.lst 149 -del *.map 150 -del *.tds 151 -del pngout.png 152 153 # End of makefile for libpng 154