# $Source: /hpux/shared/supp//usr/src/lib/libmalloc/./makefile,v $
# $Revision: 72.3 $

# Common makefile for libmalloc
# The old make files used to place the profiled files into a seperate
# directory.  This make file will just rename the profiled files by 
# replacing the .c with a _p.c.

OBJECTS = hpux_rel.o malloc.o
OBJECTS_P = $(OBJECTS:.o=_p.o)
OBJECTS_SL = $(OBJECTS:.o=_sl.o)
SOURCES = hpux_rel.c malloc.c
LIB	= libmalloc.a
LIB_P	= libmalloc_p.a
LIB_SL	= libmalloc.sl
LIB_M	= libmalloc.M
LINT	= lint
PFLAGS	= -p
DFLAGS	= -DPROF

default: $(LIB) $(LIB_P)

metrics: $(LIB_M)

$(LIB): $(OBJECTS)
	rm -f $(LIB)
	ar q $(LIB) $(OBJECTS) 

$(LIB_P): $(OBJECTS_P)
	rm -f $(LIB_P)
	ar q $(LIB_P) $(OBJECTS_P) 

$(LIB_SL): $(OBJECTS_SL)
	rm -f $(LIB_SL)
	ld -b -o $(LIB_SL) $(OBJECTS_SL)

$(LIB_M): $(SOURCES)
	$(METRICS) $(CFLAGS) $(SOURCES) -o $(LIB_M)

malloc.o:	mallint.h

.c_p.o:
	$(CC) $(CFLAGS) $(PFLAGS) $(DFLAGS) -c $< -o $@

.c_sl.o:
	$(CC) $(CFLAGS) +z -c $< -o $@

clean: 
	rm -f $(OBJECTS) $(OBJECTS_P) $(OBJECTS_SL)

clobber:	 clean
	rm -f $(LIB) $(LIB_P) $(LIB_SL)

.SUFFIXES: _p.o _sl.o
