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