summaryrefslogtreecommitdiff
path: root/libpthread/Makefile.in
blob: 1ce452c1b987f46b4dc117b0184979532295bf51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Makefile for uClibc
#
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

ifeq ($(UCLIBC_HAS_THREADS),y)
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
DIRS:= $(PTNAME) $(PTNAME)_db
libs: subdirs
else
# both do not work at once
include $(PTDIR)/Makefile.in
#include $(PTDIR)_db/Makefile.in
endif

headers-y+=threads_headers

# NPTL does not have a generic pthreadtypes.h
# and each arch has to have both semaphore.h/pthreadtypes.h ?
threads_headers:
	$(LN) -sf $(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
	$(LN) -sf $(PTDIR)/semaphore.h $(top_builddir)include/
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
	$(LN) -sf $(PTDIR)_db/thread_db.h $(top_builddir)include/
endif
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
	$(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/semaphore.h $(top_builddir)include/bits/
	$(LN) -sf ../$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/pthreadtypes.h $(top_builddir)include/bits/
	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/libc-lock.h $(top_builddir)include/bits/
	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/stdio-lock.h $(top_builddir)include/bits/
else
	$(LN) -sf ../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
endif

endif

headers_clean-y+=threads_headers_clean

threads_headers_clean:
	$(RM)	$(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
		$(top_builddir)include/thread_db.h \
		$(top_builddir)include/bits/pthreadtypes.h $(top_builddir)include/bits/semaphore.h \
		$(top_builddir)include/bits/libc-lock.h $(top_builddir)include/bits/stdio-lock
# note to sjhill: the clean target shouldn't depend on PTNAME/PTDIR
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
	$(RM)	$(PTNAME)/version.h $(PTDIR)/banner.h \
		$(PTDIR)/sysdeps/unix/sysv/linux/rtld-libc-lowlevellock.c
endif

objclean-y+=libpthread_gen_clean

libpthread_gen_clean:
	$(RM) $(top_builddir)libpthread/*/*.{o,os,a}

ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
subdirs: $(patsubst %, _dir_%, $(DIRS))
$(patsubst %, _dir_%, $(DIRS)):
	$(MAKE) -C $(patsubst _dir_%, %, $@)
endif