123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- # Makefile for uClibc
- #
- # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
- # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
- #
- # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- #
- CFLAGS-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
- CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
- # This stuff will not compile without at least -O1
- # psm: can't handle this here, could maybe search for -O0 in CFLAGS
- # and append -O1 if found
- #CFLAGS:=$(CFLAGS:-O0=-O1)
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
- else
- LDFLAGS-libpthread.so := $(LDFLAGS)
- endif
- LIBS-libpthread.so := $(LIBS) $(ldso)
- START_FILE-libpthread.so := $(SHARED_START_FILES)
- END_FILE-libpthread.so := $(SHARED_END_FILES)
- libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
- libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
- libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
- -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
- libpthread_SRC := \
- attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
- mutex.c oldsemaphore.c pt-machine.c ptfork.c ptlongjmp.c \
- rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
- ifeq ($(UCLIBC_HAS_XLOCALE),y)
- libpthread_SRC += locale.c
- endif
- libpthread_SPEC_SRC := pthread.c
- libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
- # remove generic sources, if arch specific version is present
- ifneq ($(strip $(libpthread_ARCH_SRC)),)
- libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
- endif
- libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
- libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
- #
- # Stuff that goes into libc.so, not libpthread.so
- #
- CFLAGS-forward.c := -DIS_IN_libc
- CFLAGS-libc_pthread_init.c := -DIS_IN_libc
- libpthread_libc_CSRC := forward.c libc_pthread_init.c
- libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
- libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
- libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
- libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
- libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
- ifeq ($(DOPIC),y)
- libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
- else
- libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
- endif
- libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
- lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
- lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
- objclean-y += libpthread_clean
- headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
- headers_clean-y += linuxthreads_headers_clean
- #ifeq ($(DOMULTI),n)
- $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
- $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
- #else
- #$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc)
- # $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
- #endif
- $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
- $(Q)$(RM) $@
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(do_strip:-x=-X --strip-debug)
- else
- $(do_strip)
- endif
- $(do_ar)
- $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
- $(Q)$(RM) $@
- $(compile-m)
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(do_t_strip:-x=-X --strip-debug)
- else
- $(do_t_strip)
- endif
- $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
- $(Q)$(INSTALL) -d $(dir $@)
- $(Q)$(RM) $@
- ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
- $(do_strip:-x=-X --strip-debug)
- else
- $(do_strip)
- endif
- $(do_ar)
- linuxthreads_headers:
- $(Q)$(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
- $(Q)$(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
- $(Q)$(INSTALL) -d $(top_builddir)include/bits
- $(Q)$(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
- linuxthreads_headers_clean:
- $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
- $(top_builddir)include/bits/pthreadtypes.h
- libpthread_clean:
- $(RM) $(libpthread_OUT)/*.{o,os,oS,a}
|