#
# Makefile for LIBALLOC
#
# Copyright 2000 Silicon Graphics, Inc. All rights reserved.
#
DEPTH        = .
EXTRA_CFLAGS = $(GFLAGS) -DALLOC_DEBUG
ifeq ($(ARCH),s390x)
EXTRA_CFLAGS = $(GFLAGS) -DPTRSZ64 -DALLOC_DEBUG
endif
ifeq ($(ARCH),ia64)
EXTRA_CFLAGS = $(GFLAGS) -DPTRSZ64
endif
EXTRA_CFLAGS += -I. -I$(TOPDIR)/include

.c.o:
	$(CC) $(EXTRA_CFLAGS) -c -o $*.o $<

TARGETS   = liblkcd_alloc.a
CFILES    = alloc.c
HFILES    = alloc.h
OFILES    = $(CFILES:.c=.o)

all: default

clean:
	/bin/rm -f *.o 
	/usr/bin/find . -name ".[A-z]*.flags" -print | xargs /bin/rm -f
	/usr/bin/find . -name ".depend" -print | xargs /bin/rm -f

mrproper clobber: clean
	/bin/rm -f $(TARGETS)

headers:
	mkdir -p $(ROOT)/usr/include/lkcd
	install -m 644 $(HFILES) $(ROOT)/usr/include/lkcd

exports install: $(TARGETS) headers
	mkdir -p $(ROOT)/usr/lib/lkcd
	install -m 644 $(TARGETS) $(ROOT)/usr/lib/lkcd
	
default: $(TARGETS)

$(TARGETS): $(OFILES)
	$(AR) ccurl $(TARGETS) $(OFILES)

include $(DEPTH)/../Rules.make
