Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. CLEANUP_TYPE=C
  2. #CLEANUP_TYPE=CPP
  3. VPATH = ../..:../helper
  4. TARGET_LIB = libpthread-psp.a
  5. MUTEX_OBJS = \
  6. pthread_mutex_unlock.o \
  7. pthread_mutex_init.o \
  8. pthread_mutex_destroy.o \
  9. pthread_mutex_lock.o \
  10. pthread_mutex_timedlock.o \
  11. pthread_mutex_trylock.o
  12. MUTEXATTR_OBJS = \
  13. pthread_mutexattr_destroy.o \
  14. pthread_mutexattr_getkind_np.o \
  15. pthread_mutexattr_getpshared.o \
  16. pthread_mutexattr_gettype.o \
  17. pthread_mutexattr_init.o \
  18. pthread_mutexattr_setkind_np.o \
  19. pthread_mutexattr_setpshared.o \
  20. pthread_mutexattr_settype.o
  21. SUPPORT_OBJS = \
  22. pte_relmillisecs.o \
  23. pte_mutex_check_need_init.o \
  24. pte_threadDestroy.o \
  25. pte_new.o \
  26. pte_threadStart.o \
  27. global.o \
  28. pte_reuse.o \
  29. pthread_init.o \
  30. pthread_terminate.o
  31. THREAD_OBJS = \
  32. create.o \
  33. pthread_self.o \
  34. pthread_equal.o \
  35. pthread_join.o \
  36. pthread_detach.o \
  37. pte_detach.o \
  38. pte_callUserDestroyRoutines.o \
  39. pte_tkAssocDestroy.o \
  40. pthread_kill.o \
  41. pthread_attr_destroy.o \
  42. pthread_attr_getdetachstate.o \
  43. pthread_attr_getinheritsched.o \
  44. pthread_attr_getschedparam.o \
  45. pthread_attr_getschedpolicy.o \
  46. pthread_attr_getscope.o \
  47. pthread_attr_getstackaddr.o \
  48. pthread_attr_getstacksize.o \
  49. pthread_attr_init.o \
  50. pthread_attr_setdetachstate.o \
  51. pthread_attr_setinheritsched.o \
  52. pthread_attr_setschedparam.o \
  53. pthread_attr_setschedpolicy.o \
  54. pthread_attr_setscope.o \
  55. pthread_attr_setstackaddr.o \
  56. pthread_attr_setstacksize.o \
  57. pte_is_attr.o \
  58. pthread_exit.o \
  59. pthread_getschedparam.o \
  60. pthread_setschedparam.o \
  61. sched_get_priority_max.o \
  62. sched_get_priority_min.o
  63. TLS_OBJS = \
  64. pthread_key_create.o \
  65. pthread_key_delete.o \
  66. pthread_getspecific.o \
  67. pthread_setspecific.o \
  68. pte_tkAssocCreate.o
  69. MISC_OBJS = \
  70. sched_yield.o \
  71. pthread_delay_np.o \
  72. pthread_testcancel.o \
  73. pte_throw.o \
  74. cleanup.o \
  75. pthread_once.o \
  76. pthread_num_processors_np.o \
  77. pte_getprocessors.o \
  78. pte_spinlock_check_need_init.o \
  79. global.o \
  80. pthread_timechange_handler_np.o \
  81. pte_cond_check_need_init.o \
  82. pthread_getconcurrency.o \
  83. pthread_setconcurrency.o \
  84. pte_cancellable_wait.o
  85. SEM_OBJS = \
  86. sem_close.o \
  87. sem_destroy.o \
  88. sem_getvalue.o \
  89. sem_init.o \
  90. sem_open.o \
  91. sem_post.o \
  92. sem_post_multiple.o \
  93. sem_timedwait.o \
  94. sem_trywait.o \
  95. sem_unlink.o \
  96. sem_wait.o
  97. BARRIER_OBJS = \
  98. pthread_barrier_init.o \
  99. pthread_barrier_destroy.o \
  100. pthread_barrier_wait.o \
  101. pthread_barrierattr_init.o \
  102. pthread_barrierattr_destroy.o \
  103. pthread_barrierattr_getpshared.o \
  104. pthread_barrierattr_setpshared.o \
  105. SPIN_OBJS = \
  106. pthread_spin_destroy.o \
  107. pthread_spin_init.o \
  108. pthread_spin_lock.o \
  109. pthread_spin_trylock.o \
  110. pthread_spin_unlock.o
  111. CONDVAR_OBJS = \
  112. pthread_cond_destroy.o \
  113. pthread_cond_init.o \
  114. pthread_cond_signal.o \
  115. pthread_cond_wait.o \
  116. pthread_condattr_destroy.o \
  117. pthread_condattr_getpshared.o \
  118. pthread_condattr_init.o \
  119. pthread_condattr_setpshared.o
  120. RWLOCK_OBJS = \
  121. pthread_rwlock_init.o \
  122. pthread_rwlock_destroy.o \
  123. pthread_rwlock_rdlock.o \
  124. pthread_rwlock_timedrdlock.o \
  125. pthread_rwlock_timedwrlock.o \
  126. pthread_rwlock_tryrdlock.o \
  127. pthread_rwlock_trywrlock.o \
  128. pthread_rwlock_unlock.o \
  129. pthread_rwlock_wrlock.o \
  130. pthread_rwlockattr_init.o \
  131. pthread_rwlockattr_destroy.o \
  132. pthread_rwlockattr_getpshared.o \
  133. pthread_rwlockattr_setpshared.o \
  134. pte_rwlock_check_need_init.o \
  135. pte_rwlock_cancelwrwait.o
  136. CANCEL_OBJS = \
  137. pthread_cancel.o \
  138. pthread_setcanceltype.o \
  139. pthread_setcancelstate.o
  140. OS_OBJS = \
  141. psp_osal.o \
  142. tls-helper.o
  143. OBJS = $(MUTEX_OBJS) $(MUTEXATTR_OBJS) $(THREAD_OBJS) $(SUPPORT_OBJS) $(TLS_OBJS) $(MISC_OBJS) $(SEM_OBJS) $(BARRIER_OBJS) $(SPIN_OBJS) $(CONDVAR_OBJS) $(RWLOCK_OBJS) $(CANCEL_OBJS) $(OS_OBJS)
  144. INCDIR =
  145. CFLAGS = $(GLOBAL_CFLAGS) -G0 -O2 -Wall -g -fno-strict-aliasing -I../.. -I../helper
  146. CXXFLAGS = $(CFLAGS) -fexceptions -fno-rtti -Werror -D__CLEANUP_CXX
  147. ASFLAGS = $(CFLAGS)
  148. LDFLAGS =
  149. LIBS =
  150. PSPSDK=$(shell psp-config --pspsdk-path)
  151. PSPDIR=$(shell psp-config --psp-prefix)
  152. include $(PSPSDK)/lib/build.mak
  153. ifeq ($(CLEANUP_TYPE),CPPXX)
  154. CC=psp-g++
  155. pte_throw.o: pte_throw.c
  156. $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) $(TARGET_ARCH) \
  157. -c ../../pte_throw.c -o pte_throw.o
  158. pte_threadStart.o: pte_threadStart.c
  159. $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDES) $(TARGET_ARCH) \
  160. -c ../../pte_threadStart.c -o pte_threadStart.o
  161. endif
  162. install: $(TARGET_LIB)
  163. @install -d $(DESTDIR)$(PSPDIR)/lib
  164. @install -m644 $(TARGET_LIB) $(DESTDIR)$(PSPDIR)/lib
  165. @install -d $(DESTDIR)$(PSPDIR)/include
  166. @install -m644 *.h $(DESTDIR)$(PSPDIR)/include
  167. @install -m644 ../../*.h $(DESTDIR)$(PSPDIR)/include
  168. @echo "Done."