OSDN Git Service

DOMULTI may be used for libc, the excluded files need work, linuxthreads[_db] as...
[uclinux-h8/uClibc.git] / libpthread / linuxthreads.old / Makefile.in
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
4 # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 #
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 #
8
9 CFLAGS-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
10
11 CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
12
13 # This stuff will not compile without at least -O1
14 # psm: can't handle this here, could maybe search for -O0 in CFLAGS
15 # and append -O1 if found
16 #CFLAGS:=$(CFLAGS:-O0=-O1)
17
18 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
19 LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs
20 else
21 LDFLAGS-libpthread.so := $(LDFLAGS)
22 endif
23
24 LIBS-libpthread.so := $(LIBS) $(ldso)
25
26 START_FILE-libpthread.so := $(SHARED_START_FILES)
27 END_FILE-libpthread.so := $(SHARED_END_FILES)
28
29 libpthread_FULL_NAME := libpthread-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
30
31 libpthread_DIR := $(top_srcdir)libpthread/linuxthreads.old
32 libpthread_OUT := $(top_builddir)libpthread/linuxthreads.old
33
34 -include $(libpthread_DIR)/sysdeps/$(TARGET_ARCH)/Makefile.arch
35
36 libpthread_SRC := \
37         attr.c cancel.c condvar.c errno.c events.c join.c lockfile.c manager.c \
38         mutex.c oldsemaphore.c pt-machine.c ptfork.c ptlongjmp.c \
39         rwlock.c semaphore.c signals.c specific.c spinlock.c wrapsyscall.c
40 ifeq ($(UCLIBC_HAS_XLOCALE),y)
41 libpthread_SRC += locale.c
42 endif
43
44 libpthread_SPEC_SRC := pthread.c
45 libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
46
47 # remove generic sources, if arch specific version is present
48 ifneq ($(strip $(libpthread_ARCH_SRC)),)
49 libpthread_SRC := $(filter-out $(patsubst %.c,$(libpthread_DIR)/%.c,$(notdir $(libpthread_ARCH_SRC))),$(libpthread_SRC))
50 endif
51
52 libpthread_SRC := $(patsubst %,$(libpthread_DIR)/%,$(libpthread_SRC))
53
54 libpthread_OBJ := $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SRC))
55
56 #
57 # Stuff that goes into libc.so, not libpthread.so
58 #
59 CFLAGS-forward.c := -DIS_IN_libc
60 CFLAGS-libc_pthread_init.c := -DIS_IN_libc
61 libpthread_libc_CSRC := forward.c libc_pthread_init.c
62 libpthread_libc_OBJ  := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
63 libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
64 libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
65
66 libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
67 libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
68
69 ifeq ($(DOPIC),y)
70 libpthread-a-y  += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
71 else
72 libpthread-a-y  += $(libpthread_OBJ) $(libpthread-static-y)
73 endif
74 libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
75
76 lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
77 lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
78 objclean-y += libpthread_clean
79 headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
80 headers_clean-y += linuxthreads_headers_clean
81
82 #ifeq ($(DOMULTI),n)
83 $(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
84         $(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
85 #else
86 #$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc)
87 #       $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
88 #endif
89
90 $(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
91         $(Q)$(RM) $@
92 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
93         $(do_strip:-x=-X --strip-debug)
94 else
95         $(do_strip)
96 endif
97         $(do_ar)
98
99 $(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
100         $(Q)$(RM) $@
101         $(compile-m)
102 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
103         $(do_t_strip:-x=-X --strip-debug)
104 else
105         $(do_t_strip)
106 endif
107
108 $(top_builddir)lib/libpthread.a: $(libpthread-a-y)
109         $(Q)$(INSTALL) -d $(dir $@)
110         $(Q)$(RM) $@
111 ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
112         $(do_strip:-x=-X --strip-debug)
113 else
114         $(do_strip)
115 endif
116         $(do_ar)
117
118 linuxthreads_headers:
119         $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
120         $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
121         $(INSTALL) -d $(top_builddir)include/bits
122         $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
123
124 linuxthreads_headers_clean:
125         $(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
126                 $(top_builddir)include/bits/pthreadtypes.h
127
128 libpthread_clean:
129         $(RM) $(libpthread_OUT)/*.{o,os,oS,a}