# $Source: /hpux/s800/supp//usr/src/cmd/gprof/./makefile,v $
# $Revision: 72.3 $	$Author: ssa $
# $State: Exp $   	$Locker:  $
# $Date: 94/06/13 15:56:46 $
#

# S800 version of gprof makefile, cleaned up to work with the Common Build

#
# COPTION -- attempt to discover the static call graph by probing object. (nop)
# DEBUG  -- compile in a regular ton of debug code.
# BROKENTYPEDEFS -- nscc has them
#  --rolled to SOM'.

DFLAGS = -UCOPTION -DBROKENTYPEDEFS 
LINTFLAGS = -x -a -n $(DFLAGS)

PR=pr

GPROFHDRS =	gprof.h hp-pa.h
GPROFSRCS =	gprof.c arcs.c dfn.c lookup.c calls.c \
		printgprof.c printlist.c fixbounds.c
GPROFOBJS =	gprof.o arcs.o dfn.o lookup.o calls.o \
		printgprof.o printlist.o fixbounds.o

default: gprof

metrics: gprof.M

gprof: $(GPROFOBJS)
	$(CC) -o gprof $(CFLAGS) $(GPROFOBJS)

gprof.M: $(GPROFSRCS) $(GPROFHDRS)
	$(METRICS) -o gprof.M $(CFLAGS) $(GPROFSRCS)

clean:
	rm -f $(GPROFOBJS) errs

clobber:	clean
	rm -f gprof gprof.M

print:
	@ ls -l | $(PR)
	@ $(PR) makefile
	@ $(PR) gcrt0.h
	@ $(PR) $(GPROFHDRS) $(GPROFSRCS)
	@ $(PR) gprof.flat gprof.callg

lint:
	lint $(LINTFLAGS) $(DFLAGS) $(GPROFSRCS)

$(GPROFOBJS): $(GPROFHDRS) gcrt0.h

#
# Re-define .c.o rule so implicit compiles from source to .o will use
# DFLAGS
#
.c.o:
	$(CC) $(CFLAGS) $(DFLAGS) -c $<
