summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libpng/scripts/makefile.bc32
blob: 4b96231b540d73e4a09fb37c407b7cf527334894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Makefile for libpng
# 32-bit Borland C++ (Note: All modules are compiled in C mode)
# To build the library, do:
#       "make -fmakefile.bc32"
#
# -------------------- 32-bit Borland C++ --------------------

### Absolutely necessary for this makefile to work
.AUTODEPEND

## Where zlib.h, zconf.h and zlib.lib are
ZLIB_DIR=..\zlib

## Compiler, linker and lib stuff
CC=bcc32
LD=bcc32
LIB=tlib

# -3 = 386, -4 = 486, -5 = Pentium etc.
!ifndef TARGET_CPU
#TARGET_CPU=-6
!endif

# Use this if you don't want Borland's fancy exception handling
# (Caution: doesn't work with CBuilderX)
#NOEHLIB=noeh32.lib

!ifdef DEBUG
CDEBUG=-v
LDEBUG=-v
!else
CDEBUG=
LDEBUG=
!endif

# STACKOFLOW=1
!ifdef STACKOFLOW
CDEBUG=$(CDEBUG) -N
LDEBUG=$(LDEBUG) -N
!endif

# -O2 optimize for speed
# -d  merge duplicate strings
# -k- turn off standard stack frame
# -w  display all warnings
CFLAGS=-I$(ZLIB_DIR) -O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)

# -M  generate map file
LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)

## Variables
OBJS = \
	png.obj \
	pngerror.obj \
	pngget.obj \
	pngmem.obj \
	pngpread.obj \
	pngread.obj \
	pngrio.obj \
	pngrtran.obj \
	pngrutil.obj \
	pngset.obj \
	pngtrans.obj \
	pngwio.obj \
	pngwrite.obj \
	pngwtran.obj \
	pngwutil.obj

LIBOBJS = \
	+png.obj \
	+pngerror.obj \
	+pngget.obj \
	+pngmem.obj \
	+pngpread.obj \
	+pngread.obj \
	+pngrio.obj \
	+pngrtran.obj \
	+pngrutil.obj \
	+pngset.obj \
	+pngtrans.obj \
	+pngwio.obj \
	+pngwrite.obj \
	+pngwtran.obj \
	+pngwutil.obj

LIBNAME=libpng.lib

## Implicit rules
# Braces let make "batch" calls to the compiler,
# 2 calls instead of 12; space is important.
.c.obj:
	$(CC) $(CFLAGS) -c {$*.c }

.c.exe:
	$(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib.lib $(NOEHLIB)

.obj.exe:
	$(LD) $(LDFLAGS) $*.obj $(LIBNAME) zlib.lib $(NOEHLIB)

## Major targets
all: libpng pngtest

libpng: $(LIBNAME)

pngtest: pngtest.exe

test: pngtest.exe
	pngtest

## Minor Targets

png.obj: png.c png.h pngconf.h
pngerror.obj: pngerror.c png.h pngconf.h
pngget.obj: pngget.c png.h pngconf.h
pngmem.obj: pngmem.c png.h pngconf.h
pngpread.obj: pngpread.c png.h pngconf.h
pngread.obj: pngread.c png.h pngconf.h
pngrio.obj: pngrio.c png.h pngconf.h
pngrtran.obj: pngrtran.c png.h pngconf.h
pngrutil.obj: pngrutil.c png.h pngconf.h
pngset.obj: pngset.c png.h pngconf.h
pngtrans.obj: pngtrans.c png.h pngconf.h
pngwio.obj: pngwio.c png.h pngconf.h
pngwrite.obj: pngwrite.c png.h pngconf.h
pngwtran.obj: pngwtran.c png.h pngconf.h
pngwutil.obj: pngwutil.c png.h pngconf.h
pngtest.obj: pngtest.c png.h pngconf.h

$(LIBNAME): $(OBJS)
	-del $(LIBNAME)
	$(LIB) $(LIBNAME) @&&|
$(LIBOBJS), libpng
|

# Cleanup
clean:
	-del *.obj
	-del $(LIBNAME)
	-del pngtest.exe
	-del *.lst
	-del *.map
	-del *.tds
	-del pngout.png

# End of makefile for libpng