srcdir=@srcdir@
VPATH=$(srcdir)

include ../Make.config

CFLAGS=@CFLAGS@ -Wall -ansi -I.. -I$(srcdir)/../libpcd @X_CFLAGS@
LDLIBS=-L../libpcd -lpcd

PROGS=@TEST_PROGS@

SRCS=	$(srcdir)/ppm.c \
	$(srcdir)/plug-0.54.c \
	$(srcdir)/view.c \
	$(srcdir)/svga.c \
	$(srcdir)/dither.c

all: $(PROGS)

pcdview: view.o dither.o svga.o
	rm -f $@
	$(CC) -o $@ view.o dither.o svga.o $(LDLIBS) @LIBVGA@

suid:
	su -c "chown root.root pcdview;chmod 4711 pcdview"

install:
	$(MKDIR) $(bindir)
	$(INSTALL_PROGRAM) pcdtoppm $(bindir)
	test -f pcdview && \
		$(INSTALL_PROGRAM) $(SUID_ROOT) pcdview $(bindir) || true

pcdtoppm: ppm.o
	$(CC) -o $@ ppm.o $(LDLIBS) @LIBJPEG@

plug-0.54: plug-0.54.o
	$(CC) -o $@ plug.o $(LDLIBS) @LIBGIMP54@


depend dep:
	$(DEPEND) -- $(CFLAGS) -- $(SRCS)

clean:
	rm -f *~ *.o *.bak

realclean:
	rm -f $(PROGS)

#-------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.
