| 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 | |
| 16 | ## Compiler, linker and lib stuff |
| 17 | CC=bcc |
| 18 | LD=bcc |
| 19 | LIB=tlib |
| 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 | CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG) |
| 56 | |
| 57 | # -M generate map file |
| 58 | LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG) |
| 59 | |
| 60 | |
| 61 | ## Variables |
| 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 | |
| 99 | ## Implicit rules |
| 100 | # Braces let make "batch" calls to the compiler, |
| 101 | # 2 calls instead of 12; space is important. |
| 102 | .c.obj: |
| 103 | $(CC) $(CFLAGS) -c {$*.c } |
| 104 | |
| 105 | .c.exe: |
| 106 | $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
| 107 | |
| 108 | |
| 109 | ## Major targets |
| 110 | all: libpng pngtest |
| 111 | |
| 112 | libpng: $(LIBNAME) |
| 113 | |
| 114 | pngtest: pngtest$(MODEL).exe |
| 115 | |
| 116 | test: pngtest$(MODEL).exe |
| 117 | pngtest$(MODEL) |
| 118 | |
| 119 | |
| 120 | ## Minor Targets |
| 121 | |
| 122 | png.obj: png.c |
| 123 | pngerror.obj: pngerror.c |
| 124 | pngget.obj: pngget.c |
| 125 | pngmem.obj: pngmem.c |
| 126 | pngpread.obj: pngpread.c |
| 127 | pngread.obj: pngread.c |
| 128 | pngrio.obj: pngrio.c |
| 129 | pngrtran.obj: pngrtran.c |
| 130 | pngrutil.obj: pngrutil.c |
| 131 | pngset.obj: pngset.c |
| 132 | pngtrans.obj: pngtrans.c |
| 133 | pngwio.obj: pngwio.c |
| 134 | pngwrite.obj: pngwrite.c |
| 135 | pngwtran.obj: pngwtran.c |
| 136 | pngwutil.obj: pngwutil.c |
| 137 | |
| 138 | |
| 139 | $(LIBNAME): $(OBJS) |
| 140 | -del $(LIBNAME) |
| 141 | $(LIB) $(LIBNAME) @&&| |
| 142 | $(LIBOBJS), libpng$(MODEL) |
| 143 | | |
| 144 | |
| 145 | |
| 146 | pngtest$(MODEL).obj: pngtest.c |
| 147 | $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c |
| 148 | |
| 149 | pngtest$(MODEL).exe: pngtest$(MODEL).obj |
| 150 | $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
| 151 | |
| 152 | |
| 153 | # Clean up anything else you want |
| 154 | clean: |
| 155 | -del *.obj |
| 156 | -del *.exe |
| 157 | -del *.lib |
| 158 | -del *.lst |
| 159 | -del *.map |
| 160 | |
| 161 | |
| 162 | # End of makefile for libpng |