# Makefile for uClibc
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
-# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
-CFLAGS-linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
+subdirs += libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)
+subdirs += libpthread/linuxthreads/sysdeps/unix/sysv/linux
+subdirs += libpthread/linuxthreads/sysdeps/pthread
-CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads)
-CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ := $(CFLAGS-linuxthreads)
-CFLAGS-libpthread/linuxthreads/sysdeps/pthread/ := $(CFLAGS-linuxthreads)
+CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread
+CFLAGS-libpthread/linuxthreads := $(CFLAGS-dir_linuxthreads) $(SSP_ALL_CFLAGS)
# This stuff will not compile without at least -O1
# psm: can't handle this here, could maybe search for -O0 in CFLAGS
#ifeq ($(DOMULTI),n)
$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
- $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+ $(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
#else
#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
-# $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+# $(call linkm.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
#endif
$(Q)$(RM) $@
- $(Q)cp $(top_srcdir)extra/scripts/format.lds $@
- $(Q)echo "GROUP ( $(notdir $@).$(MAJOR_VERSION) libpthread_nonshared.a )" >> $@
+ $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
+ $(Q)echo "GROUP ( $(notdir $@).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
+ $(Q)mv $@.tmp $@
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
$(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
$(Q)$(RM) $@
$(do_ar)
-include/pthread.h:
- $(do_ln) ../$(PTDIR)/sysdeps/pthread/$(@F) $(top_builddir)$@
-include/semaphore.h:
- $(do_ln) ../$(PTDIR)/$(@F) $(top_builddir)$@
-include/bits/pthreadtypes.h: | include/bits
- $(do_ln) ../../$(PTDIR)/sysdeps/pthread/bits/$(@F) $(top_builddir)$@
-
-linuxthreads_headers := include/pthread.h include/semaphore.h \
- include/bits/pthreadtypes.h
-$(linuxthreads_headers): $(wildcard $(addprefix include/config/linuxthreads/,old.h new.h))
+$(top_builddir)include/pthread.h:
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
+$(top_builddir)include/semaphore.h:
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
+$(top_builddir)include/bits/pthreadtypes.h: | $(top_builddir)include/bits
+ $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
+
+linuxthreads_headers := $(top_builddir)include/pthread.h \
+ $(top_builddir)include/semaphore.h \
+ $(top_builddir)include/bits/pthreadtypes.h
+$(linuxthreads_headers): $(wildcard $(addprefix $(top_builddir)include/config/linuxthreads/,old.h new.h))
headers-$(UCLIBC_HAS_THREADS) += $(linuxthreads_headers)
-objclean-y += libpthread_clean
-headers_clean-y += linuxthreads_headers_clean
-linuxthreads_headers_clean:
- $(RM) $(addprefix $(top_builddir),$(linuxthreads_headers))
+objclean-y += CLEAN_libpthread/linuxthreads
+headers_clean-y += HEADERCLEAN_libpthread/linuxthreads
+HEADERCLEAN_libpthread/linuxthreads:
+ $(do_rm) $(linuxthreads_headers)
-libpthread_clean:
- $(RM) $(libpthread_OUT)/{,*/,*/*/,*/*/*/,*/*/*/*/}*.{o,os,oS,a}
+CLEAN_libpthread/linuxthreads:
+ $(do_rm) $(addprefix $(libpthread_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*. */*/*/*.,$(d)$(e))))