# $Source: /hpux/shared/supp//usr/src/cmd/find/./makefile,v $
# $Revision: 78.2 $

# Common makefile for find

# FINDMSG = /usr/bin/findmsg
GENCAT  = /usr/bin/gencat
OBJECTS = find.o funcs.o cpio.o libcpio.o
SOURCES = find.c funcs.c cpio.c libcpio.c
FLAGS	= -Ae -D_HPUX_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_EXT__

default: find find.cat

metrics: find.M

find : $(OBJECTS) hpux_rel.o
	$(CC) $(CFLAGS) $(FLAGS) $(LDFLAGS) -o find hpux_rel.o $(OBJECTS) -lBUILD 

find.M : $(SOURCES) hpux_rel.c
	$(METRICS) $(CFLAGS) $(FLAGS) -o $@ hpux_rel.c $(SOURCES) -lBUILD

#
# Redefine the .c.o rule so that it uses $(FLAGS) too
#
.c.o:
	$(CC) -c $(CFLAGS) $(FLAGS) $<

find.cat: find.c
#	$(FINDMSG) find.c > find.msg
#	$(FINDMSG) cpio.c > cpio.msg
#	$(GENCAT)  $@ find.msg cpio.msg
	$(GENCAT)  $@ find.msg

clean:
	/bin/rm -f *.o *.msg

clobber: clean
	/bin/rm -f find find.cat find.M
