# What plugin are we building ?

PLUGIN = rtpng

# Who are the maintainers ?
MAINTAINERS = robertw

C_INC += -DPNG_USER_MEM_SUPPORTED -DPNG_NO_CONSOLE_IO
C_INC += -DPNG_NO_PROGRESSIVE_READ -DPNG_NO_STDIO -DPNG_NO_WRITE_tIME

# This is a bit hacky, but stops the silly inclusion of
# sys/types.h in pngconf.h
C_INC += -DRISCOS

ZLIBOBJS =					\
	$(OBJDIR)/adler32.$(O)			\
	$(OBJDIR)/compress.$(O)			\
	$(OBJDIR)/gzio.$(O)			\
	$(OBJDIR)/uncompr.$(O)			\
	$(OBJDIR)/deflate.$(O)			\
	$(OBJDIR)/trees.$(O)			\
	$(OBJDIR)/zutil.$(O)			\
	$(OBJDIR)/inflate.$(O)			\
	$(OBJDIR)/infblock.$(O)			\
	$(OBJDIR)/inftrees.$(O)			\
	$(OBJDIR)/infcodes.$(O)			\
	$(OBJDIR)/infutil.$(O)			\
	$(OBJDIR)/inffast.$(O)			\
	$(OBJDIR)/crc32.$(O)

PNGLIBOBJS =					\
	$(OBJDIR)/png.$(O)			\
	$(OBJDIR)/pngerror.$(O)			\
	$(OBJDIR)/pnggccrd.$(O)			\
	$(OBJDIR)/pngget.$(O)			\
	$(OBJDIR)/pngmem.$(O)			\
	$(OBJDIR)/pngpread.$(O)			\
	$(OBJDIR)/pngread.$(O)			\
	$(OBJDIR)/pngrio.$(O)			\
	$(OBJDIR)/pngrtran.$(O)			\
	$(OBJDIR)/pngrutil.$(O)			\
	$(OBJDIR)/pngset.$(O)			\
	$(OBJDIR)/pngtrans.$(O)			\
	$(OBJDIR)/pngvcrd.$(O)			\
	$(OBJDIR)/pngwio.$(O)			\
	$(OBJDIR)/pngwrite.$(O)			\
	$(OBJDIR)/pngwtran.$(O)			\
	$(OBJDIR)/pngwutil.$(O)

#	$(OBJDIR)/pngtest.$(O)


OBJS = $(ZLIBOBJS) $(PNGLIBOBJS)

OPTTARGET=recurse

include ../maketool

VPATH  += ./lpng1012 ./zlib113
CFLAGS += -I./lpng1012 -I./zlib113

ifeq ("$(RWCOMPILER)", "cwsky")
# Workaround for cwsky compatibility with
# /usr/local/sce/ee/gcc/ee/include/stdio.h
CFLAGS += -D__STRICT_ANSI__
endif

recurse:
# For a PC release, we need to build both a regular and a codewarrior version of this lib
ifeq ("$(RWRELEASE)", "win")
ifneq ("$(RWCOMPILER)", "cwpc")
	$(MAKE) RWOPTIONS=$(RWOPTIONS) clean
	$(MAKE) RWOPTIONS=$(RWOPTIONS) RWCOMPILER=cwpc OPTEXT=cw
	$(MAKE) RWOPTIONS=$(RWOPTIONS) RWCOMPILER=cwpc OPTEXT=cw clean
endif
endif
