| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 | # Makefile for uClibc NPTL## Copyright (C) 2005-2006 Steven J. Hill <sjhill@realitydiluted.com>## Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.#subdirs += libpthread/nptllibpthread_DIR = $(top_srcdir)libpthread/nptllibpthread_OUT = $(top_builddir)libpthread/nptlinclude $(libpthread_DIR)/sysdeps/Makefile.inlibc-shared-routines-y = forward.c libc-cancellation.clibc-static-routines-y = alloca_cutoff.c libc-cancellation.clibpthread-shared-only-routines-y = version.clibpthread-static-only-routines-y = pthread_atfork.clibpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated fileslibpthread-routines- += allocatestack.c # dummy included by pthread_create.clibpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!libpthread-routines-$(UCLIBC_HAS_RESOLVER_SUPPORT) += res.clibpthread-routines-$(UCLIBC_SUSV4_LEGACY) += pthread_getconcurrency.c \	pthread_setconcurrency.clibpthread_CSRC = $(filter-out $(libpthread-routines-) \		  		$(libc-shared-routines-y) \		  		$(libc-static-routines-y) \				$(libpthread-shared-only-routines-y) \				$(libpthread-static-only-routines-y) \				$(notdir $(libpthread_OBJS:.o=.c)), \		  $(notdir $(wildcard $(libpthread_DIR)/*.c)))libpthread_OBJS += $(addprefix $(libpthread_OUT)/,$(libpthread_CSRC:.c=.o))libpthread-so-y += $(addprefix $(libpthread_OUT)/,$(libpthread-shared-only-routines-y:.c=.oS))libpthread-so-y += $(libpthread_OBJS:.o=.oS)libpthread-nonshared-y := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.oS))libpthread-static-y    := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.o))libpthread-static-y    += $(libpthread_OBJS)ifeq ($(DOPIC),y)libpthread-a-y := $(libpthread-static-y:.o=.os)elselibpthread-a-y := $(libpthread-static-y)endiflibc-shared-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-shared-routines-y))libc-static-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-static-routines-y))libc-shared-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-shared-routines-y:.c=.oS))libc-static-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-static-routines-y:.c=.o))libc-shared-y += $(libc-shared-routines-y) $(libpthread_libc_OBJS:.o=.oS)ifeq ($(DOPIC),y)libc-static-y += $(libc-static-routines-y:.o=.os) $(libpthread_libc_a_OBJS:.o=.os) $(libpthread_ld_tls_COBJ:.o=.os)elselibc-static-y += $(libc-static-routines-y) $(libpthread_libc_a_OBJS) $(libpthread_ld_tls_COBJ)endiflibrt-pt-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-routines-y)))librt-pt-shared-only-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-shared-only-routines-y)))librt_OBJS = $(libpthread_librt_OBJS) $(librt-pt-routines-y)ifeq ($(DOPIC),y)librt-a-y += $(librt_OBJS:.o=.os)elselibrt-a-y += $(librt_OBJS)endiflibrt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)ifeq ($(UCLIBC_CTOR_DTOR),y)START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crti.oEND_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crtn.oLDFLAGS-libpthread.so += -nostartfiles$(top_builddir)lib/libpthread.so: | $(START_FILE-libpthread.so) $(END_FILE-libpthread.so)endiflibpthread_FULL_NAME := libpthread-$(VERSION).solib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.alib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(libdl.depend) $(top_builddir)lib/libpthread_nonshared.a	$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))	$(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)endif$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)	$(Q)$(RM) $@	$(do_ar)$(top_builddir)lib/libpthread.a: $(libpthread-a-y)	$(Q)$(INSTALL) -d $(dir $@)	$(Q)$(RM) $@	$(do_ar)$(libpthread_OUT)/pthread-errnos.h: $(top_srcdir)extra/scripts/gen-as-const.awk$(libpthread_OUT)/pthread-errnos.h: $(libpthread_DIR)/pthread-errnos.sym	@$(disp_gen)	$(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \	| $(CC) $(CFLAGS) -x c - -S -o - \	| $(SED) $(PTHREAD_GENERATE_MANGLE) > $@	@if test ! -s $@ ; then rm -f $@ ; false ; fipregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread_OUT)/pthread-errnos.hheaders-$(UCLIBC_HAS_THREADS_NATIVE) += $(nptl_headers_bootstrap)libpthread_H := $(addprefix $(top_builddir)include/,semaphore.h)libpthread_include_H := $(addprefix $(top_builddir)include/,pthread.h)libpthread_include_BITS_H := $(addprefix $(top_builddir)include/bits/,libc-lock.h stdio-lock.h)libpthread_include_STD_IMPL_OS_ARCH_BITS_H := $(addprefix $(top_builddir)include/bits/,pthreadtypes.h semaphore.h)$(libpthread_include_STD_IMPL_OS_ARCH_BITS_H): $(top_builddir)include/bits/%:	$(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/$(@F) $@$(libpthread_include_BITS_H): $(top_builddir)include/bits/%:	$(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@$(libpthread_include_H): $(top_builddir)include/%:	$(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@$(libpthread_H): $(top_builddir)include/%:	$(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@nptl_headers_bootstrap = $(libpthread_H) $(libpthread_include_H) $(libpthread_include_BITS_H) $(libpthread_include_STD_IMPL_OS_ARCH_BITS_H)objclean-y += CLEAN_libpthread/nptlheaders_clean-y += HEADERCLEAN_libpthread/nptlHEADERCLEAN_libpthread/nptl:	$(do_rm) $(nptl_headers_bootstrap) \	      $(libpthread_OUT)/pthread-errnos.hCLEAN_libpthread/nptl:	$(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)ifeq ($(PTHREADS_DEBUG_SUPPORT),y)LDFLAGS-libpthread.so += $(LDFLAGS_NOSTRIP) -Wl,-z,defselseLDFLAGS-libpthread.so += $(LDFLAGS)endifLDFLAGS-libpthread.so += $(top_builddir)lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so $(top_builddir)lib/libdl-$(VERSION).so \	-Wl,-z,nodelete,-z,initfirst,-init=$(SYMBOL_PREFIX)__pthread_initialize_minimal_internalLIBS-libpthread.so := $(LIBS)CFLAGS-dir_nptl := -DNOT_IN_libc -DIS_IN_libpthreadCFLAGS-libpthread/nptl := $(CFLAGS-dir_nptl) $(SSP_ALL_CFLAGS)# Since cancellation handling is in large parts handled using exceptions# we have to compile some files with exception handling enabled, some# even with asynchronous unwind tables.# init.c contains sigcancel_handler().CFLAGS-init.c = -fexceptions -fasynchronous-unwind-tables# The unwind code itself,CFLAGS-unwind.c = -fexceptionsCFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables# The following three functions must be async-cancel safe.CFLAGS-pthread_cancel.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pthread_setcancelstate.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pthread_setcanceltype.c = -fexceptions -fasynchronous-unwind-tables# These are internal functions which similar functionality as setcancelstate# and setcanceltype.CFLAGS-cancellation.c = -fasynchronous-unwind-tablesCFLAGS-libc-cancellation.c = -fasynchronous-unwind-tables# Calling pthread_exit() must cause the registered cancel handlers to# be executed.  Therefore exceptions have to be thrown through this# function.CFLAGS-pthread_exit.c = -fexceptions# Among others, __pthread_unwind is forwarded.  This function must handle# exceptions.CFLAGS-forward.c = -fexceptions# The following are cancellation points.  Some of the functions can# block and therefore temporarily enable asynchronous cancellation.# Those must be compiled asynchronous unwind tables.CFLAGS-pthread_testcancel.c = -fexceptionsCFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \			-fasynchronous-unwind-tablesCFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sem_timedwait.c = -fexceptions -fasynchronous-unwind-tables# These are the function wrappers we have to duplicate here.CFLAGS-accept.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-clock_nanosleep.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-close.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-connect.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-creat.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-fdatasync.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-fsync.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-lockf.c = -fexceptionsCFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-msync.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-nanosleep.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-open64.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-open.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pause.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-poll.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-ppoll.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pread_write.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pselect.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-read.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-readv.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-recv.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-__rt_sigtimedwait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-__rt_sigwaitinfo.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-select.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-send.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sendto.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sigpause.c = -fexceptionsCFLAGS-sigsuspend.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sigtimedwait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-sigwaitinfo.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-__syscall_fcntl64.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-__syscall_fcntl.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-usleep.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-wait4.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-wait.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-waitid.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-waitpid.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-write.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-writev.c = -fexceptions -fasynchronous-unwind-tablesCFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib## The rest of this file is uClibc specific.#CFLAGS-pthread_barrier_init.c = -D_GNU_SOURCECFLAGS-pthread_barrier_destroy.c = -D_GNU_SOURCECFLAGS-pthread_barrierattr_init.c = -D_GNU_SOURCECFLAGS-pthread_barrierattr_destroy.c = -D_GNU_SOURCECFLAGS-pthread_barrierattr_getpshared.c = -D_GNU_SOURCECFLAGS-pthread_barrierattr_setpshared.c = -D_GNU_SOURCECFLAGS-sem_open.c = -D_GNU_SOURCECFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-dir_nptl)CFLAGS-OMIT-forward.c = $(CFLAGS-dir_nptl)CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-dir_nptl)CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-dir_nptl)
 |