# Makefile for pbm 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 =	-O2 -DLINUX -Djump -I../include
TIFFDEF =       -DLIBTIFF
LDFLAGS =	-s

SHELL =		/bin/sh
ALLCFLAGS =	$(CFLAGS) $(RGBDEF) $(TIFFDEF)
LIBPBM =	libpbm.a

lib:		$(LIBPBM)
$(LIBPBM):	libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
	-rm $(LIBPBM)
	ar rc $(LIBPBM) libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o
	-ranlib $(LIBPBM)

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


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