1996-01-26 07:38:47 +00:00
|
|
|
# Makefile for libpng
|
|
|
|
# Borland C++ 4.5 (Note: All modules are compiled in C mode)
|
|
|
|
# Will work with C++ 4.02 also
|
|
|
|
# To build the library, do:
|
|
|
|
# "make -fmakefile.bor -DMODEL=m"
|
|
|
|
# or: "make -fmakefile.bor -DMODEL=l"
|
|
|
|
#
|
|
|
|
# ------------- Borland C++ 4.5 -------------
|
|
|
|
|
|
|
|
### Absolutely necessary for this makefile to work
|
|
|
|
.AUTODEPEND
|
|
|
|
|
|
|
|
## Useful user options
|
|
|
|
|
|
|
|
# Usually defined in builtins.mak or the environment
|
|
|
|
# Currently unused.
|
|
|
|
!ifndef BCROOT
|
|
|
|
BCROOT=N:\BC45
|
|
|
|
!endif
|
|
|
|
|
|
|
|
# Where zlib.h and zconf.h and zlib.lib are
|
|
|
|
ZLIB_PATH=..\zlib
|
|
|
|
|
|
|
|
!ifndef MODEL
|
|
|
|
MODEL=l
|
|
|
|
!endif
|
|
|
|
|
|
|
|
#TARGET_CPU=3
|
|
|
|
# 2 = 286, 3 = 386, etc.
|
|
|
|
!ifndef TARGET_CPU
|
|
|
|
TARGET_CPU=2
|
|
|
|
!endif
|
|
|
|
|
|
|
|
|
|
|
|
# Use this if you don't want Borland's fancy exception handling.
|
|
|
|
NOEHLIB=noeh$(MODEL).lib
|
|
|
|
|
|
|
|
!ifdef DEBUG
|
|
|
|
CDEBUG=-v
|
|
|
|
LDEBUG=-v
|
|
|
|
!else
|
|
|
|
CDEBUG=
|
|
|
|
LDEBUG=
|
|
|
|
!endif
|
|
|
|
|
|
|
|
# STACKOFLOW=1
|
|
|
|
!ifdef STACKOFLOW
|
|
|
|
CDEBUG=$(CDEBUG) -N
|
|
|
|
LDEBUG=$(LDEBUG) -N
|
|
|
|
!endif
|
|
|
|
|
|
|
|
|
|
|
|
## Compiler, linker, and lib stuff
|
|
|
|
CC=bcc
|
|
|
|
LD=bcc
|
|
|
|
LIB=tlib
|
|
|
|
|
|
|
|
MODELARG=-m$(MODEL)
|
|
|
|
|
|
|
|
# -X- turns on dependency generation in the object file
|
|
|
|
# -w sets all warnings on
|
|
|
|
# -O2 optimize for speed
|
|
|
|
# -Z global optimization
|
|
|
|
CFLAGS=-O2 -Z -X- -w -I$(ZLIB_PATH) -$(TARGET_CPU) $(MODELARG) $(CDEBUG)
|
|
|
|
|
|
|
|
# -M generate map file
|
|
|
|
LDFLAGS=-M $(LDEBUG)
|
|
|
|
|
|
|
|
O=obj
|
|
|
|
|
|
|
|
## variables
|
|
|
|
OBJS = \
|
|
|
|
png.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
pngerror.$(O) \
|
|
|
|
pngmem.$(O) \
|
|
|
|
pngpread.$(O) \
|
1996-01-26 07:38:47 +00:00
|
|
|
pngrcb.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
pngread.$(O) \
|
|
|
|
pngrio.$(O) \
|
|
|
|
pngrtran.$(O) \
|
1996-01-26 07:38:47 +00:00
|
|
|
pngrutil.$(O) \
|
|
|
|
pngtrans.$(O) \
|
|
|
|
pngwrite.$(O) \
|
|
|
|
pngwtran.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
pngwio.$(O) \
|
|
|
|
pngwutil.$(O)
|
1996-01-26 07:38:47 +00:00
|
|
|
|
|
|
|
LIBOBJS = \
|
|
|
|
+png.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
+pngerror.$(O) \
|
1996-01-26 07:38:47 +00:00
|
|
|
+pngmem.$(O) \
|
|
|
|
+pngpread.$(O) \
|
|
|
|
+pngread.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
+pngrcb.$(O) \
|
|
|
|
+pngrio.$(O) \
|
1996-01-26 07:38:47 +00:00
|
|
|
+pngrtran.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
+pngrutil.$(O) \
|
|
|
|
+pngtrans.$(O) \
|
|
|
|
+pngwrite.$(O) \
|
1996-01-26 07:38:47 +00:00
|
|
|
+pngwtran.$(O) \
|
1996-06-05 20:50:50 +00:00
|
|
|
+pngwio.$(O)
|
|
|
|
+pngwutil.$(O)
|
1996-01-26 07:38:47 +00:00
|
|
|
|
|
|
|
LIBNAME=libpng$(MODEL).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
|
|
|
|
|
|
|
|
|
|
|
|
## Major targets
|
|
|
|
libpng: $(LIBNAME)
|
|
|
|
|
|
|
|
pngtest: pngtest$(MODEL).exe
|
|
|
|
|
|
|
|
test:
|
|
|
|
pngtest$(MODEL)
|
|
|
|
|
|
|
|
|
|
|
|
## Minor Targets
|
|
|
|
|
|
|
|
png.obj: png.c
|
|
|
|
pngrcb.obj: pngrcb.c
|
|
|
|
pngread.obj: pngread.c
|
|
|
|
pngpread.obj: pngpread.c
|
|
|
|
pngrtran.obj: pngrtran.c
|
|
|
|
pngrutil.obj: pngrutil.c
|
|
|
|
pngerror.obj: pngerror.c
|
|
|
|
pngmem.obj: pngmem.c
|
1996-06-05 20:50:50 +00:00
|
|
|
pngrio.obj: pngrio.c
|
|
|
|
pngwio.obj: pngwio.c
|
1996-01-26 07:38:47 +00:00
|
|
|
pngtrans.obj: pngtrans.c
|
|
|
|
pngwrite.obj: pngwrite.c
|
|
|
|
pngwtran.obj: pngwtran.c
|
|
|
|
pngwutil.obj: pngwutil.c
|
|
|
|
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
|
|
|
-del $(LIBNAME)
|
|
|
|
$(LIB) $(LIBNAME) @&&|
|
|
|
|
$(LIBOBJS), libpng$(MODEL)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pngtest$(MODEL).obj: pngtest.c
|
|
|
|
$(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c
|
|
|
|
|
|
|
|
pngtest$(MODEL).exe: pngtest$(MODEL).obj
|
|
|
|
$(CC) $(MODELARG) $(LDFLAGS) -L$(ZLIB_PATH) pngtest$(MODEL).obj $(LIBNAME) zlib$(MODEL).lib $(NOEHLIB)
|
|
|
|
|
|
|
|
|
|
|
|
# Clean up anything else you want
|
|
|
|
clean:
|
|
|
|
-del *.obj
|
|
|
|
-del *.lib
|
|
|
|
-del *.lst
|
|
|
|
|
|
|
|
|
|
|
|
# End of makefile for libpng
|