SRCS=	execl.c		abs.c		atexit.c	bsearch.c	\
	div.c		exit.c		getenv.c	getopt.c	\
	heapsort.c	labs.c		ldiv.c		qsort.c		\
	radixsort.c	rand.c		system.c	isatty.c	\
	ldexp.c		frexp.c		mktemp.c        errno.c		\
	abort.c		putenv.c	execv.c		tcgetattr.c	\
	execle.c	execvp.c	execlp.c	getlogin.c	\
	tmpnam.c	ttyname.c

# name of the output library
LIBRARY	= libstdlib

include	../Makerules
include	../Makeconfig

##########################################################################
# At this point, no further changes should be required.

ASMS	= $(SRCS:.c=.s)
OBJS	= $(SRCS:.c=.o)

ifndef ELF
all:	../libs/$(LIBRARY).a
else
all:	../libs/$(LIBRARY).a ../elf/$(LIBRARY).o
endif

../libs/$(LIBRARY).a:	$(LIBRARY).a
	$(CP) $(LIBRARY).a ../libs

../elf/$(LIBRARY).o: $(LIBRARY).o
	$(CP) $(LIBRARY).o ../elf

$(LIBRARY).a: $(OBJS)
	$(AR) $(ARFLAGS) $(LIBRARY).a $(OBJS)
	$(RANLIB) $(LIBRARY).a

$(LIBRARY).o: $(OBJS)
	$(LD) -o $(LIBRARY).o -r $(OBJS)

dep:
	$(CPP) $(CFLAGS) -M $(SRCS) > .depend

dummy:

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
