fukasawa e60969
# Makefile for libpng
fukasawa e60969
# 16-bit Borland C++ (Note: All modules are compiled in C mode)
fukasawa e60969
# To build the library, do:
fukasawa e60969
#       "make -fmakefile.bor -DMODEL=c"
fukasawa e60969
# or:   "make -fmakefile.bor -DMODEL=l"
fukasawa e60969
#
fukasawa e60969
# ------------ Borland C++ ------------
fukasawa e60969
fukasawa e60969
### Absolutely necessary for this makefile to work
fukasawa e60969
.AUTODEPEND
fukasawa e60969
fukasawa e60969
## Where zlib.h, zconf.h and zlib_MODEL.lib are
fukasawa e60969
ZLIB_DIR=..\zlib
fukasawa e60969
fukasawa e60969
## Compiler, linker, librarian and other tools
fukasawa e60969
CC=bcc
fukasawa e60969
LD=bcc
fukasawa e60969
LIB=tlib
fukasawa e60969
CP=copy
fukasawa e60969
fukasawa e60969
!ifndef MODEL
fukasawa e60969
MODEL=l
fukasawa e60969
!endif
fukasawa e60969
fukasawa e60969
MODEL_ARG=-m$(MODEL)
fukasawa e60969
fukasawa e60969
#TARGET_CPU=3
fukasawa e60969
# 2 = 286, 3 = 386, etc.
fukasawa e60969
!ifndef TARGET_CPU
fukasawa e60969
TARGET_CPU=2
fukasawa e60969
!endif
fukasawa e60969
fukasawa e60969
# Use this if you don't want Borland's fancy exception handling
fukasawa e60969
# (for Borland C++ 4.0 or later)
fukasawa e60969
#NOEHLIB=noeh$(MODEL).lib
fukasawa e60969
fukasawa e60969
!ifdef DEBUG
fukasawa e60969
CDEBUG=-v
fukasawa e60969
LDEBUG=-v
fukasawa e60969
!else
fukasawa e60969
CDEBUG=
fukasawa e60969
LDEBUG=
fukasawa e60969
!endif
fukasawa e60969
fukasawa e60969
# STACKOFLOW=1
fukasawa e60969
!ifdef STACKOFLOW
fukasawa e60969
CDEBUG=$(CDEBUG) -N
fukasawa e60969
LDEBUG=$(LDEBUG) -N
fukasawa e60969
!endif
fukasawa e60969
fukasawa e60969
# -X- turn on dependency generation in the object file
fukasawa e60969
# -w  set all warnings on
fukasawa e60969
# -O2 optimize for speed
fukasawa e60969
# -Z  global optimization
fukasawa e60969
CPPFLAGS=-I$(ZLIB_DIR)
fukasawa e60969
CFLAGS=-O2 -Z -X- -w -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
fukasawa e60969
fukasawa e60969
# -M  generate map file
fukasawa e60969
LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
fukasawa e60969
fukasawa e60969
# Pre-built configuration
fukasawa e60969
# See scripts\pnglibconf.mak for more options
fukasawa e60969
!ifndef PNGLIBCONF_H_PREBUILT
fukasawa e60969
PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
fukasawa e60969
!endif
fukasawa e60969
fukasawa e60969
## Variables
fukasawa e60969
fukasawa e60969
OBJS = \
fukasawa e60969
	png.obj \
fukasawa e60969
	pngerror.obj \
fukasawa e60969
	pngget.obj \
fukasawa e60969
	pngmem.obj \
fukasawa e60969
	pngpread.obj \
fukasawa e60969
	pngread.obj \
fukasawa e60969
	pngrio.obj \
fukasawa e60969
	pngrtran.obj \
fukasawa e60969
	pngrutil.obj \
fukasawa e60969
	pngset.obj \
fukasawa e60969
	pngtrans.obj \
fukasawa e60969
	pngwio.obj \
fukasawa e60969
	pngwrite.obj \
fukasawa e60969
	pngwtran.obj \
fukasawa e60969
	pngwutil.obj
fukasawa e60969
fukasawa e60969
LIBOBJS = \
fukasawa e60969
	+png.obj \
fukasawa e60969
	+pngerror.obj \
fukasawa e60969
	+pngget.obj \
fukasawa e60969
	+pngmem.obj \
fukasawa e60969
	+pngpread.obj \
fukasawa e60969
	+pngread.obj \
fukasawa e60969
	+pngrio.obj \
fukasawa e60969
	+pngrtran.obj \
fukasawa e60969
	+pngrutil.obj \
fukasawa e60969
	+pngset.obj \
fukasawa e60969
	+pngtrans.obj \
fukasawa e60969
	+pngwio.obj \
fukasawa e60969
	+pngwrite.obj \
fukasawa e60969
	+pngwtran.obj \
fukasawa e60969
	+pngwutil.obj
fukasawa e60969
fukasawa e60969
LIBNAME=libpng$(MODEL).lib
fukasawa e60969
fukasawa e60969
## Implicit rules
fukasawa e60969
fukasawa e60969
# Braces let make "batch" calls to the compiler,
fukasawa e60969
# 2 calls instead of 12; space is important.
fukasawa e60969
.c.obj:
fukasawa e60969
	$(CC) $(CPPFLAGS) $(CFLAGS) -c {$*.c }
fukasawa e60969
fukasawa e60969
.c.exe:
fukasawa e60969
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $*.c \
fukasawa e60969
	  $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
fukasawa e60969
fukasawa e60969
## Major targets
fukasawa e60969
fukasawa e60969
all: libpng pngtest
fukasawa e60969
fukasawa e60969
# try !include scripts\pnglibconf.mak for more options
fukasawa e60969
pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
fukasawa e60969
	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
fukasawa e60969
fukasawa e60969
libpng: $(LIBNAME)
fukasawa e60969
fukasawa e60969
pngtest: pngtest$(MODEL).exe
fukasawa e60969
fukasawa e60969
test: pngtest$(MODEL).exe
fukasawa e60969
	pngtest$(MODEL)
fukasawa e60969
fukasawa e60969
## Minor Targets
fukasawa e60969
fukasawa e60969
png.obj: png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngerror.obj: pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngget.obj: pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngmem.obj: pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngpread.obj: pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngread.obj: pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrio.obj: pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrtran.obj: pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngrutil.obj: pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngset.obj: pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngtrans.obj: pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwio.obj: pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwrite.obj: pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwtran.obj: pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
pngwutil.obj: pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
fukasawa e60969
$(LIBNAME): $(OBJS)
fukasawa e60969
	-del $(LIBNAME)
fukasawa e60969
	$(LIB) $(LIBNAME) @&&|
fukasawa e60969
$(LIBOBJS), libpng$(MODEL)
fukasawa e60969
|
fukasawa e60969
fukasawa e60969
pngtest$(MODEL).obj: pngtest.c png.h pngconf.h pnglibconf.h
fukasawa e60969
	$(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c
fukasawa e60969
fukasawa e60969
pngtest$(MODEL).exe: pngtest$(MODEL).obj
fukasawa e60969
	$(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB)
fukasawa e60969
fukasawa e60969
# Clean up anything else you want
fukasawa e60969
clean:
fukasawa e60969
	-del pnglibconf.h
fukasawa e60969
	-del *.obj
fukasawa e60969
	-del *.exe
fukasawa e60969
	-del *.lib
fukasawa e60969
	-del *.lst
fukasawa e60969
	-del *.map
fukasawa e60969
fukasawa e60969
# End of makefile for libpng