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

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

TARGETS   = liblkcd_rl.a
CFILES    = rl.c hist.c
HFILES    = rl.h
OFILES    = $(CFILES:.c=.o)

all: default

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

clobber: clean
	/bin/rm -rf $(TARGETS)

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

exports install: headers $(TARGETS)
	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
