# Makefile for pnm 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  -DSYSV -Djump
TIFFDEF =	-DLIBTIFF
ALLCFLAGS =	$(CFLAGS) $(TIFFDEF) -I../include -I../tiff
LIBPNM =	libpnm.a

lib:		$(LIBPNM)
$(LIBPNM):	00_DATA.o libpnm1.o libpnm2.o libpnm3.o libpnm4.o
	-rm $(LIBPNM)
	ar rc $(LIBPNM) 00_DATA.o libpnm1.o libpnm2.o libpnm3.o libpnm4.o
	-ranlib $(LIBPNM)

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

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