# change next line as necessary and depending on whether ZLIB
# and libpng are used (libpng requires zlib)

#DEFS1=-DUSE_LIBPNG
DEFS1=-DUSE_LIBPNG -DNEED_STRNSTR
LIBS=-lpng -lz -lm
#LIBS=-lz

# change next line as necessary and depending on whether ZLIB and
# libpng are used (zlib's and libpng's include files must be found)
# and whether they are the default search path

# The lines given are necessary for MacOS (10.6), and do no harm on
# most other systems

#LDFLAGS=-Lsomething
#CPPFLAGS=-Isomething
LDFLAGS=-L/usr/X11/lib
CPPFLAGS=-I/usr/X11/include

# change this line to relect your favourite compiler

CC=gcc
CFLAGS=-ansi -std=c99 -pedantic -Wall -O0 -g $(DEFS)

# Nothing more should need changing

DEFS=${DEFS1} -DUSE_LZW -DUSE_ZLIB -DFIG2PDF

OBJS=fig2pdf.o write_line.o write_text.o write_pdf.o write_ellipse.o \
     write_arc.o write_spline.o write_picture.o read_colour.o readpdf.o \
     write_font.o

B2E_OBJS=A85p.o delzw.o compact.o colour_count.o \
         lzw_flate.o palette_check.o read_image.o \
         readppm.o readgif.o  readjpeg.o readpgm.o \
         readpbm.o readpnmhead.o readpng.o readpnma.o to_lzw2.o


fig2pdf: ${OBJS} ${B2E_OBJS}
	cc -o fig2pdf ${LDFLAGS} ${OBJS} ${B2E_OBJS} ${LIBS}

clean:
	rm ${OBJS} ${B2E_OBJS} fig2pdf
