# Makefile for ppm tools.
#
# Copyright (C) 1989, 1991 by Jef Poskanzer.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.  This software is provided "as is" without express or
# implied warranty.

# Default values, usually overridden by top-level Makefile.
CC =		gcc
CFLAGS =	-O -DLINUX -Djump -DLIBTIFF
LDFLAGS =	-s

SHELL =		/bin/sh
INCLUDE =	-I../include
ALLCFLAGS =	$(CFLAGS) $(RGBDEF) $(INCLUDE)
LIBPPM =	libppm.a
all:		$(LIBPPM)
#install:	install.bin
install:	install.merge


lib:		$(LIBPPM)
$(LIBPPM):	00_DATA.o libppm1.o libppm2.o libppm3.o libppm4.o libppm5.o
	-rm $(LIBPPM)
	ar rc $(LIBPPM) 00_DATA.o libppm1.o libppm2.o libppm3.o libppm4.o libppm5.o
	-ranlib $(LIBPPM)

clean:
	-rm -f *.o *.a *.cat core $(BINARIES) ppmmerge


.c.o:
	$(CC) -c $(ALLCFLAGS) $(LOCAL_INCLUDES) \
		$(CPPFLAGS) $*.c -o dummy.o
	ld -r -x dummy.o
	mv a.out $*.o
	rm dummy.o
