2013-08-31 07:15:53 -04:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
|
|
|
include ../compiler.mak
|
|
|
|
include ../version.mak
|
|
|
|
include ../dirs.mak
|
|
|
|
|
|
|
|
OPTLEVEL?=-O2 -g
|
|
|
|
CXXFLAGS?=$(OPTLEVEL)
|
|
|
|
CPPFLAGS?=
|
|
|
|
|
|
|
|
CPPFLAGS:=$(CPPFLAGS) -D__is_sortix_libpthread -I include
|
|
|
|
CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
|
|
|
|
|
|
|
|
OBJS=\
|
2013-09-03 09:06:16 -04:00
|
|
|
pthread_attr_destroy.o \
|
2014-01-09 17:48:43 -05:00
|
|
|
pthread_attr_getdetachstate.o \
|
2013-09-03 09:08:38 -04:00
|
|
|
pthread_attr_getstacksize.o \
|
2013-09-03 09:06:16 -04:00
|
|
|
pthread_attr_init.o \
|
2014-01-09 17:48:43 -05:00
|
|
|
pthread_attr_setdetachstate.o \
|
2013-09-03 09:08:38 -04:00
|
|
|
pthread_attr_setstacksize.o \
|
2013-09-03 09:51:15 -04:00
|
|
|
pthread_condattr_destroy.o \
|
2014-07-07 09:13:17 -04:00
|
|
|
pthread_condattr_getclock.o \
|
2013-09-03 09:51:15 -04:00
|
|
|
pthread_condattr_init.o \
|
2014-07-07 09:13:17 -04:00
|
|
|
pthread_condattr_setclock.o \
|
2013-09-03 09:17:13 -04:00
|
|
|
pthread_cond_broadcast.o \
|
2013-09-03 09:36:33 -04:00
|
|
|
pthread_cond_destroy.o \
|
|
|
|
pthread_cond_init.o \
|
2013-09-03 09:17:13 -04:00
|
|
|
pthread_cond_signal.o \
|
2013-09-16 18:07:29 -04:00
|
|
|
pthread_cond_timedwait.o \
|
2013-09-03 09:17:13 -04:00
|
|
|
pthread_cond_wait.o \
|
2013-08-31 12:04:36 -04:00
|
|
|
pthread_create.o \
|
2014-01-10 09:43:16 -05:00
|
|
|
pthread_detach.o \
|
2013-09-15 11:24:20 -04:00
|
|
|
pthread_equal.o \
|
2013-08-31 13:46:42 -04:00
|
|
|
pthread_exit.o \
|
2014-01-13 16:33:00 -05:00
|
|
|
pthread_getspecific.o \
|
2013-08-31 07:15:53 -04:00
|
|
|
pthread_initialize.o \
|
2014-01-09 17:20:45 -05:00
|
|
|
pthread_join.o \
|
2014-01-13 16:00:41 -05:00
|
|
|
pthread_key_create.o \
|
|
|
|
pthread_key_delete.o \
|
2013-09-03 08:51:44 -04:00
|
|
|
pthread_mutexattr_destroy.o \
|
2014-01-08 13:04:16 -05:00
|
|
|
pthread_mutexattr_gettype.o \
|
2013-09-03 08:51:44 -04:00
|
|
|
pthread_mutexattr_init.o \
|
2014-01-08 13:04:16 -05:00
|
|
|
pthread_mutexattr_settype.o \
|
2013-08-31 09:06:56 -04:00
|
|
|
pthread_mutex_destroy.o \
|
|
|
|
pthread_mutex_init.o \
|
2013-08-31 07:18:20 -04:00
|
|
|
pthread_mutex_lock.o \
|
2013-08-31 08:55:16 -04:00
|
|
|
pthread_mutex_trylock.o \
|
2013-08-31 07:18:20 -04:00
|
|
|
pthread_mutex_unlock.o \
|
2014-01-10 10:01:28 -05:00
|
|
|
pthread_once.o \
|
2013-09-03 15:56:28 -04:00
|
|
|
pthread_rwlock_destroy.o \
|
|
|
|
pthread_rwlock_init.o \
|
2013-09-03 15:47:19 -04:00
|
|
|
pthread_rwlock_rdlock.o \
|
2013-09-03 16:10:28 -04:00
|
|
|
pthread_rwlock_tryrdlock.o \
|
|
|
|
pthread_rwlock_trywrlock.o \
|
2013-09-03 15:47:19 -04:00
|
|
|
pthread_rwlock_unlock.o \
|
|
|
|
pthread_rwlock_wrlock.o \
|
2013-09-15 11:20:28 -04:00
|
|
|
pthread_self.o \
|
2014-01-13 16:33:00 -05:00
|
|
|
pthread_setspecific.o \
|
2014-01-10 10:16:30 -05:00
|
|
|
pthread_sigmask.o \
|
2013-08-31 07:15:53 -04:00
|
|
|
|
|
|
|
BINS:=libpthread.a
|
|
|
|
|
|
|
|
# Main build rules.
|
|
|
|
all: $(BINS)
|
|
|
|
|
|
|
|
.PHONY: headers clean install install-headers libs install-libs
|
|
|
|
|
|
|
|
headers:
|
|
|
|
|
|
|
|
libs: $(BINS)
|
|
|
|
|
|
|
|
libpthread.a: $(OBJS)
|
|
|
|
$(HOSTAR) rcs $@ $(OBJS)
|
|
|
|
|
|
|
|
%.o: %.c++
|
|
|
|
$(HOSTCXX) -std=gnu++11 -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINS) $(OBJS) *.o
|
|
|
|
|
|
|
|
# Installation into sysroot.
|
|
|
|
install: install-headers install-libs
|
|
|
|
|
|
|
|
install-headers: headers
|
|
|
|
cp -RTv include $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
|
|
|
|
install-libs:
|
|
|
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
|
|
|
cp -P libpthread.a $(DESTDIR)$(LIBDIR)
|