# Makefile for uClibc
#
# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

# Recurse to these dirs, compile files, produce klib.list
# files in each, then merge them in klib.list in this dir.
klib-y := \
    inet/    \
    misc/    \
    pwd_grp/ \
    signal/  \
    stdio/   \
    stdlib/  \
    string/  \
    sysdeps/ \
    termios/ \
    unistd/  \


# HAVE_SHARED is from .config
ifeq ($(HAVE_SHARED),y)

always := $(obj)/libc_so.a

$(obj)/libc_so.a: $(obj)/klib-shared.list
	@echo '  AR      $@'
	$(Q)rm -f $@; mkdir -p $(dir $@)
ifneq ($(PTDIR),)
	$(Q)$(AR) cr $@ `$(srctree)/scripts/catlist.sh $(obj)/klib-shared.list` $(PTDIR)/forward.oS $(PTDIR)/libc_pthread_init.oS
else
	$(Q)$(AR) cr $@ `$(srctree)/scripts/catlist.sh $(obj)/klib-shared.list`
endif

endif
