Files
glibc/linuxthreads/Makefile
T

161 lines
5.3 KiB
Makefile
Raw Normal View History

2002-05-03 07:39:22 +00:00
# Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
1998-03-11 12:42:25 +00:00
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
2001-07-06 04:58:11 +00:00
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
1998-03-11 12:42:25 +00:00
# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2001-07-06 04:58:11 +00:00
# Lesser General Public License for more details.
1998-03-11 12:42:25 +00:00
2001-07-06 04:58:11 +00:00
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
1998-03-11 12:42:25 +00:00
#
# Sub-makefile for linuxthreads portion of the library.
#
subdir := linuxthreads
1998-08-03 16:47:01 +00:00
linuxthreads-version := $(shell sed -n 's/^.*$(subdir)-\([0-9.]*\).*$$/\1/p' \
Banner)
1998-03-11 12:42:25 +00:00
1999-04-15 13:54:57 +00:00
headers := pthread.h semaphore.h
distribute := internals.h queue.h restart.h spinlock.h smp.h tst-signal.sh
1998-03-11 12:42:25 +00:00
1998-11-30 14:21:53 +00:00
routines := weaks no-tsd
1998-03-11 12:42:25 +00:00
extra-libs := libpthread
extra-libs-others := $(extra-libs)
libpthread-routines := attr cancel condvar join manager mutex ptfork \
1998-04-20 18:41:05 +00:00
ptlongjmp pthread signals specific errno lockfile \
1999-07-09 20:58:54 +00:00
semaphore spinlock wrapsyscall rwlock pt-machine \
2001-04-23 19:01:10 +00:00
oldsemaphore events getcpuclockid pspinlock barrier \
2002-08-28 06:47:35 +00:00
ptclock_gettime ptclock_settime sighandler \
pthandles
1998-03-11 12:42:25 +00:00
2000-07-21 00:15:14 +00:00
nodelete-yes = -Wl,--enable-new-dtags,-z,nodelete
2001-02-02 06:54:15 +00:00
initfirst-yes = -Wl,--enable-new-dtags,-z,initfirst
LDFLAGS-pthread.so = $(nodelete-$(have-z-nodelete)) \
$(initfirst-$(have-z-initfirst))
2000-07-21 00:15:14 +00:00
1998-07-07 15:23:31 +00:00
vpath %.c Examples
2000-08-17 07:38:02 +00:00
2001-04-12 02:29:04 +00:00
tst-cancel-ARGS = "$(objpfx)"
2002-01-17 00:32:33 +00:00
CFLAGS-tst-cancel.c = -fno-inline -fno-inline-functions
2001-04-12 02:29:04 +00:00
2000-08-25 19:33:19 +00:00
include ../Makeconfig
2001-02-02 06:54:15 +00:00
ifeq ($(build-shared),yes)
extra-objs += crti.o crtn.o
omit-deps += crti crtn
2001-02-02 06:54:15 +00:00
CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
endif
2000-08-17 07:38:02 +00:00
librt-tests = ex10 ex11
tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 $(librt-tests) ex12 ex13 joinrace \
2001-03-21 18:50:57 +00:00
tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 \
2002-07-10 20:50:46 +00:00
ex17 ex18 tst-cancel tst-context bug-sleep
2002-01-16 17:44:51 +00:00
test-srcs = tst-signal
2000-08-25 19:33:19 +00:00
2002-07-23 00:37:27 +00:00
ifeq ($(build-static),yes)
2002-08-30 22:07:28 +00:00
tests += tststatic tst-static-locale
tests-static += tststatic tst-static-locale
2002-07-23 00:37:27 +00:00
endif
2000-08-25 19:33:19 +00:00
ifeq (yes,$(build-shared))
tests-nodelete-yes = unload
endif
1998-07-07 15:23:31 +00:00
1998-03-11 12:42:25 +00:00
include ../Rules
2001-02-02 06:54:15 +00:00
extra-B-pthread.so = -B$(common-objpfx)linuxthreads/
$(objpfx)libpthread.so: $(objpfx)crti.o $(objpfx)crtn.o
2001-07-16 22:33:08 +00:00
$(objpfx)libpthread.so: +preinit += $(objpfx)crti.o
$(objpfx)libpthread.so: +postinit += $(objpfx)crtn.o
2001-02-02 06:54:15 +00:00
2001-01-12 07:29:55 +00:00
znodelete-yes = -DHAVE_Z_NODELETE
1998-11-18 17:02:37 +00:00
CFLAGS-mutex.c += -D__NO_WEAK_PTHREAD_ALIASES
CFLAGS-specific.c += -D__NO_WEAK_PTHREAD_ALIASES
2001-01-12 07:29:55 +00:00
CFLAGS-pthread.c += -D__NO_WEAK_PTHREAD_ALIASES $(znodelete-$(have-z-nodelete))
1998-11-18 17:02:37 +00:00
CFLAGS-ptfork.c += -D__NO_WEAK_PTHREAD_ALIASES
2001-03-20 21:05:29 +00:00
CFLAGS-cancel.c += -D__NO_WEAK_PTHREAD_ALIASES -D_RPC_THREAD_SAFE_
2000-08-25 19:33:19 +00:00
CFLAGS-unload.c += -DPREFIX=\"$(objpfx)\"
2002-05-03 07:39:22 +00:00
CFLAGS-sighandler.c += $(exceptions)
1998-11-18 17:02:37 +00:00
1998-03-11 12:42:25 +00:00
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
2001-03-18 21:34:58 +00:00
$(objpfx)libpthread.so: $(common-objpfx)libc.so \
$(common-objpfx)libc_nonshared.a
1998-07-07 15:23:31 +00:00
# Make sure we link with the thread library.
ifeq ($(build-shared),yes)
2002-07-23 00:37:27 +00:00
$(addprefix $(objpfx), \
$(filter-out $(tests-static), \
$(tests) $(test-srcs))): $(objpfx)libpthread.so
2000-08-17 07:38:02 +00:00
$(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.so
2000-08-25 19:33:19 +00:00
$(objpfx)unload: $(common-objpfx)dlfcn/libdl.so
else
2002-01-16 17:44:51 +00:00
$(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a
2000-08-17 07:38:02 +00:00
$(addprefix $(objpfx),$(librt-tests)): $(common-objpfx)rt/librt.a
endif
ifeq ($(build-bounded),yes)
$(tests:%=$(objpfx)%-bp): $(objpfx)libpthread_b.a
$(librt-tests:%=$(objpfx)%-bp): $(common-objpfx)rt/librt_b.a
endif
2001-02-02 06:54:15 +00:00
2002-07-23 00:37:27 +00:00
ifeq ($(build-static),yes)
$(addprefix $(objpfx), $(tests-static)): $(objpfx)libpthread.a
endif
2001-02-02 06:54:15 +00:00
ifeq ($(build-shared),yes)
vpath pt-initfini.c $(full_config_sysdirs)
$(objpfx)pt-initfini.s: pt-initfini.c
$(compile.c) -S $(CFLAGS-pt-initfini.s) -finhibit-size-directive \
$(patsubst -f%,-fno-%,$(exceptions)) -o $@
# We only have one kind of startup code files. Static binaries and
# shared libraries are build using the PIC version.
$(objpfx)crti.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@
$(objpfx)crtn.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@
2001-02-02 06:54:15 +00:00
$(objpfx)defs.h: $(objpfx)pt-initfini.s
sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
$(AWK) -f ../csu/defs.awk > $@
$(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
$(compile.S) -g0 $(ASFLAGS-.os) -o $@
$(objpfx)crtn.o: $(objpfx)crtn.S $(objpfx)defs.h
2001-02-02 06:54:15 +00:00
$(compile.S) -g0 $(ASFLAGS-.os) -o $@
generated += crti.S crtn.S defs.h pt-initfini.s
2001-02-02 06:54:15 +00:00
endif
2001-04-18 16:06:52 +00:00
ifeq (yes,$(build-static-nss))
otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a
endif
2002-01-16 17:44:51 +00:00
ifeq (no,$(cross-compiling))
ifeq (yes,$(build-shared))
tests: $(objpfx)tst-signal.out
$(objpfx)tst-signal.out: tst-signal.sh $(objpfx)tst-signal
2002-07-23 00:37:27 +00:00
$(SHELL) -e $< $(common-objpfx) > $@
2002-01-16 17:44:51 +00:00
endif
endif