##
##   FACILITY:
## 
##       Utility Library - Makefile
## 
##   ABSTRACT:
## 
##       This is the makefile to rebuild the rtl utility library
## 
##--
##

#
# Makefile to revise and build the rtl utility library
#

#
# Pull in common Makefile fragments
#

include /vmk/include/general.Makefile

CC			= gcc

CFLAGS			= -g -O $(CFLAGS)

INCLUDE			= /vmk/utilities/include/
LIB			= /vmk/utilities/lib/
VMK_BIN			= /vmk/bin/

rtl-utility-library	: rtl1				\
			  $(INCLUDE)intrinsic.h		\
			  $(INCLUDE)list.h              \
			  $(INCLUDE)mem.h               \
			  $(INCLUDE)sort.h              \
			  $(INCLUDE)str.h               \
			  $(INCLUDE)tree.h              \
			  $(INCLUDE)util.h              \
			  $(LIB)rtl.a
			  @echo $(PAD)Utility rtl library updated

rtl1			:
			  @echo $(PAD)Utility rtl library update started

$(INCLUDE)intrinsic.h	: intrinsic.h
			  @rm -f $(INCLUDE)intrinsic.h
			  @cp intrinsic.h $(INCLUDE)intrinsic.h

$(INCLUDE)list.h	: list.h
			  @rm -f $(INCLUDE)list.h
			  @cp list.h $(INCLUDE)list.h

$(INCLUDE)mem.h		: mem.h
			  @rm -f $(INCLUDE)mem.h
			  @cp mem.h $(INCLUDE)mem.h

$(INCLUDE)sort.h	: sort.h
			  @rm -f $(INCLUDE)sort.h
			  @cp sort.h $(INCLUDE)sort.h

$(INCLUDE)str.h		: str.h
			  @rm -f $(INCLUDE)str.h
			  @cp str.h $(INCLUDE)str.h

$(INCLUDE)tree.h	: tree.h
			  @rm -f $(INCLUDE)tree.h
			  @cp tree.h $(INCLUDE)tree.h

$(INCLUDE)util.h	: util.h
			  @rm -f $(INCLUDE)util.h
			  @cp util.h $(INCLUDE)util.h

$(LIB)rtl.a		: rtl.a
			  @echo $(PADX)Exporting rtl.a
			  @rm -f $(LIB)rtl.a
			  @cp rtl.a $(LIB)rtl.a

rtl.a			: intrinsic.h			\
			  list.o			\
			  mem.o				\
			  sort.o			\
			  str.o				\
			  tree.o			\
			  util.o
			  @echo $(PADX)Generating rtl.a
			  @ar cr rtl.a			\
				 list.o			\
				 mem.o			\
				 sort.o			\
				 str.o			\
				 tree.o			\
				 util.o
			  @ranlib rtl.a

list.o			: list.h			\
			  list.c

mem.o			: mem.h				\
			  mem.c

sort.o			: sort.h			\
			  sort.c

str.o			: str.h				\
			  str.c

tree.o			: tree.h			\
			  tree.c

util.o			: util.h			\
			  util.c


