#
# File:		makefile.bcc
# Author:	Julian Smart
# Created:	1993
# Updated:	
# Copyright:
#
# "%W% %G%"
#
# Makefile : Builds PNG library (BC++ 16-bit) 

# WXWIN and BCCDIR are set by parent make

WXDIR = $(WXWIN)
!include $(WXDIR)\src\makebcc.env

WINPNGLIB = ..\..\lib\winpng.lib

WXLIBDIR = $(WXDIR)\lib
WXINC = $(WXDIR)\include\msw
WXLIB = $(WXLIBDIR)\wx.lib 

!if "$(FINAL)" == "0"
OPT = -Od
DEBUG_FLAGS= -v
!else
OPT = -Od
DEBUG_FLAGS =
!endif
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)

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

all: $(WINPNGLIB)

$(WINPNGLIB): $(OBJECTS) 
        erase $(WINPNGLIB)
	tlib $(WINPNGLIB) /P512 @&&!
-+$(OBJECTS:.obj =.obj -+) 
!

.$(SRCSUFF).obj:
	bcc $(CPPFLAGS) -c {$< }

.c.obj:
	bcc $(CPPFLAGS) -P- -c {$< }

$(CFG): makefile.bcc
	copy &&!
-H=$(WXDIR)\src\msw\borland.pch
-2
-P
-d
-w-hid
-w-par
-w-pia
-w-aus
-w-rch
-ml
-Od
-WE
-Fs-
-Vf
-Ff=4
-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
-I$(WXDIR)\include\wx\msw\gnuwin32
-L$(BCCDIR)\lib
-D__WXWIN__
-D__WXMSW__
-D__WINDOWS__
-D__WIN16__
! $(CFG)
!if "$(BOR_VER)" == "3.1"
	echo -Ff=4 >>$(CFG)
!elif "$(BOR_VER)" == "4"
	echo -Ff=512 >>$(CFG)
	echo -dc >>$(CFG)
!else
	echo -Ff=512 >>$(CFG)
	echo -dc >>$(CFG)
!endif

clean:
        -erase *.obj
        -erase *.exe
        -erase *.res
        -erase *.map
        -erase *.rws
        -erase $(WINPNGLIB)

