]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | # Makefile for libpng |
9dfaa473 GD |
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" | |
c801d85f KB |
5 | # or: "make -fmakefile.bor -DMODEL=l" |
6 | # | |
9dfaa473 | 7 | # ------------ Borland C++ ------------ |
c801d85f KB |
8 | |
9 | ### Absolutely necessary for this makefile to work | |
10 | .AUTODEPEND | |
11 | ||
9dfaa473 GD |
12 | ## Where zlib.h, zconf.h and zlib_MODEL.lib are |
13 | ZLIB_DIR=..\zlib | |
c801d85f | 14 | |
c801d85f | 15 | |
9dfaa473 GD |
16 | ## Compiler, linker and lib stuff |
17 | CC=bcc | |
18 | LD=bcc | |
19 | LIB=tlib | |
c801d85f KB |
20 | |
21 | !ifndef MODEL | |
22 | MODEL=l | |
23 | !endif | |
24 | ||
9dfaa473 GD |
25 | MODEL_ARG=-m$(MODEL) |
26 | ||
c801d85f KB |
27 | #TARGET_CPU=3 |
28 | # 2 = 286, 3 = 386, etc. | |
29 | !ifndef TARGET_CPU | |
30 | TARGET_CPU=2 | |
31 | !endif | |
32 | ||
9dfaa473 GD |
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 | |
c801d85f KB |
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 | ||
9dfaa473 GD |
51 | # -X- turn on dependency generation in the object file |
52 | # -w set all warnings on | |
c801d85f KB |
53 | # -O2 optimize for speed |
54 | # -Z global optimization | |
9dfaa473 | 55 | CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG) |
c801d85f KB |
56 | |
57 | # -M generate map file | |
9dfaa473 | 58 | LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG) |
c801d85f | 59 | |
c801d85f | 60 | |
9dfaa473 | 61 | ## Variables |
c801d85f | 62 | OBJS = \ |
9dfaa473 GD |
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 | |
c801d85f KB |
78 | |
79 | LIBOBJS = \ | |
9dfaa473 GD |
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 | |
c801d85f KB |
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: | |
9dfaa473 | 106 | $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
c801d85f KB |
107 | |
108 | ||
109 | ## Major targets | |
9dfaa473 GD |
110 | all: libpng pngtest |
111 | ||
c801d85f KB |
112 | libpng: $(LIBNAME) |
113 | ||
114 | pngtest: pngtest$(MODEL).exe | |
115 | ||
9dfaa473 | 116 | test: pngtest$(MODEL).exe |
c801d85f KB |
117 | pngtest$(MODEL) |
118 | ||
119 | ||
120 | ## Minor Targets | |
121 | ||
122 | png.obj: png.c | |
9dfaa473 | 123 | pngerror.obj: pngerror.c |
c801d85f | 124 | pngget.obj: pngget.c |
9dfaa473 | 125 | pngmem.obj: pngmem.c |
c801d85f | 126 | pngpread.obj: pngpread.c |
9dfaa473 GD |
127 | pngread.obj: pngread.c |
128 | pngrio.obj: pngrio.c | |
c801d85f KB |
129 | pngrtran.obj: pngrtran.c |
130 | pngrutil.obj: pngrutil.c | |
9dfaa473 | 131 | pngset.obj: pngset.c |
c801d85f | 132 | pngtrans.obj: pngtrans.c |
9dfaa473 | 133 | pngwio.obj: pngwio.c |
c801d85f KB |
134 | pngwrite.obj: pngwrite.c |
135 | pngwtran.obj: pngwtran.c | |
136 | pngwutil.obj: pngwutil.c | |
137 | ||
138 | ||
139 | $(LIBNAME): $(OBJS) | |
140 | -del $(LIBNAME) | |
9dfaa473 | 141 | $(LIB) $(LIBNAME) @&&| |
c801d85f KB |
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 | |
9dfaa473 | 150 | $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) |
c801d85f KB |
151 | |
152 | ||
153 | # Clean up anything else you want | |
154 | clean: | |
155 | -del *.obj | |
9dfaa473 | 156 | -del *.exe |
c801d85f KB |
157 | -del *.lib |
158 | -del *.lst | |
9dfaa473 | 159 | -del *.map |
c801d85f KB |
160 | |
161 | ||
162 | # End of makefile for libpng |