Bmakefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # This makefile is compatible with BCB make. Use "make -fBMakefile" to compile.
  2. #
  3. # The variables $DLLDEST and $LIBDEST hold the destination directories for the
  4. # dll and the lib, respectively. Probably all that needs to change is $DEVROOT.
  5. #
  6. # Currently only the recommended pthreadBC.dll is built by this makefile.
  7. #
  8. DLL_VER = 2
  9. DEVROOT = .
  10. DLLDEST = $(DEVROOT)\DLL
  11. LIBDEST = $(DEVROOT)\DLL
  12. DLLS = pthreadBC$(DLL_VER).dll
  13. OPTIM = /O2
  14. RC = brcc32
  15. RCFLAGS = -i.
  16. CFLAGS = /q /I. /D_WIN32_WINNT=0x400 /DHAVE_PTW32_CONFIG_H=1 /4 /tWD /tWM \
  17. /w-aus /w-asc /w-par
  18. #C cleanup code
  19. BCFLAGS = $(PTW32_FLAGS) $(CFLAGS)
  20. # Agregate modules for inlinability
  21. DLL_OBJS = \
  22. attr.obj \
  23. barrier.obj \
  24. cancel.obj \
  25. cleanup.obj \
  26. condvar.obj \
  27. create.obj \
  28. dll.obj \
  29. errno.obj \
  30. exit.obj \
  31. fork.obj \
  32. global.obj \
  33. misc.obj \
  34. mutex.obj \
  35. nonportable.obj \
  36. private.obj \
  37. rwlock.obj \
  38. sched.obj \
  39. semaphore.obj \
  40. signal.obj \
  41. spin.obj \
  42. sync.obj \
  43. tsd.obj
  44. INCL = config.h implement.h semaphore.h pthread.h need_errno.h
  45. ATTR_SRCS = \
  46. pthread_attr_init.c \
  47. pthread_attr_destroy.c \
  48. pthread_attr_getdetachstate.c \
  49. pthread_attr_setdetachstate.c \
  50. pthread_attr_getstackaddr.c \
  51. pthread_attr_setstackaddr.c \
  52. pthread_attr_getstacksize.c \
  53. pthread_attr_setstacksize.c \
  54. pthread_attr_getscope.c \
  55. pthread_attr_setscope.c
  56. BARRIER_SRCS = \
  57. pthread_barrier_init.c \
  58. pthread_barrier_destroy.c \
  59. pthread_barrier_wait.c \
  60. pthread_barrierattr_init.c \
  61. pthread_barrierattr_destroy.c \
  62. pthread_barrierattr_setpshared.c \
  63. pthread_barrierattr_getpshared.c
  64. CANCEL_SRCS = \
  65. pthread_setcancelstate.c \
  66. pthread_setcanceltype.c \
  67. pthread_testcancel.c \
  68. pthread_cancel.c
  69. CONDVAR_SRCS = \
  70. ptw32_cond_check_need_init.c \
  71. pthread_condattr_destroy.c \
  72. pthread_condattr_getpshared.c \
  73. pthread_condattr_init.c \
  74. pthread_condattr_setpshared.c \
  75. pthread_cond_destroy.c \
  76. pthread_cond_init.c \
  77. pthread_cond_signal.c \
  78. pthread_cond_wait.c
  79. EXIT_SRCS = \
  80. pthread_exit.c
  81. MISC_SRCS = \
  82. pthread_equal.c \
  83. pthread_getconcurrency.c \
  84. pthread_once.c \
  85. pthread_self.c \
  86. pthread_setconcurrency.c \
  87. ptw32_calloc.c \
  88. ptw32_MCS_lock.c \
  89. ptw32_new.c \
  90. w32_CancelableWait.c
  91. MUTEX_SRCS = \
  92. ptw32_mutex_check_need_init.c \
  93. pthread_mutex_init.c \
  94. pthread_mutex_destroy.c \
  95. pthread_mutexattr_init.c \
  96. pthread_mutexattr_destroy.c \
  97. pthread_mutexattr_getpshared.c \
  98. pthread_mutexattr_setpshared.c \
  99. pthread_mutexattr_settype.c \
  100. pthread_mutexattr_gettype.c \
  101. pthread_mutexattr_setrobust.c \
  102. pthread_mutexattr_getrobust.c \
  103. pthread_mutex_lock.c \
  104. pthread_mutex_timedlock.c \
  105. pthread_mutex_unlock.c \
  106. pthread_mutex_trylock.c \
  107. pthread_mutex_consistent.c
  108. NONPORTABLE_SRCS = \
  109. pthread_mutexattr_setkind_np.c \
  110. pthread_mutexattr_getkind_np.c \
  111. pthread_getw32threadhandle_np.c \
  112. pthread_delay_np.c \
  113. pthread_num_processors_np.c \
  114. pthread_win32_attach_detach_np.c \
  115. pthread_timechange_handler_np.c
  116. PRIVATE_SRCS = \
  117. ptw32_is_attr.c \
  118. ptw32_processInitialize.c \
  119. ptw32_processTerminate.c \
  120. ptw32_threadStart.c \
  121. ptw32_threadDestroy.c \
  122. ptw32_tkAssocCreate.c \
  123. ptw32_tkAssocDestroy.c \
  124. ptw32_callUserDestroyRoutines.c \
  125. ptw32_timespec.c \
  126. ptw32_relmillisecs.c \
  127. ptw32_throw.c \
  128. ptw32_getprocessors.c
  129. RWLOCK_SRCS = \
  130. ptw32_rwlock_check_need_init.c \
  131. ptw32_rwlock_cancelwrwait.c \
  132. pthread_rwlock_init.c \
  133. pthread_rwlock_destroy.c \
  134. pthread_rwlockattr_init.c \
  135. pthread_rwlockattr_destroy.c \
  136. pthread_rwlockattr_getpshared.c \
  137. pthread_rwlockattr_setpshared.c \
  138. pthread_rwlock_rdlock.c \
  139. pthread_rwlock_timedrdlock.c \
  140. pthread_rwlock_wrlock.c \
  141. pthread_rwlock_timedwrlock.c \
  142. pthread_rwlock_unlock.c \
  143. pthread_rwlock_tryrdlock.c \
  144. pthread_rwlock_trywrlock.c
  145. SCHED_SRCS = \
  146. pthread_attr_setschedpolicy.c \
  147. pthread_attr_getschedpolicy.c \
  148. pthread_attr_setschedparam.c \
  149. pthread_attr_getschedparam.c \
  150. pthread_attr_setinheritsched.c \
  151. pthread_attr_getinheritsched.c \
  152. pthread_setschedparam.c \
  153. pthread_getschedparam.c \
  154. sched_get_priority_max.c \
  155. sched_get_priority_min.c \
  156. sched_setscheduler.c \
  157. sched_getscheduler.c \
  158. sched_yield.c
  159. SEMAPHORE_SRCS = \
  160. sem_init.c \
  161. sem_destroy.c \
  162. sem_trywait.c \
  163. sem_timedwait.c \
  164. sem_wait.c \
  165. sem_post.c \
  166. sem_post_multiple.c \
  167. sem_getvalue.c \
  168. sem_open.c \
  169. sem_close.c \
  170. sem_unlink.c
  171. SPIN_SRCS = \
  172. ptw32_spinlock_check_need_init.c \
  173. pthread_spin_init.c \
  174. pthread_spin_destroy.c \
  175. pthread_spin_lock.c \
  176. pthread_spin_unlock.c \
  177. pthread_spin_trylock.c
  178. SYNC_SRCS = \
  179. pthread_detach.c \
  180. pthread_join.c
  181. TSD_SRCS = \
  182. pthread_key_create.c \
  183. pthread_key_delete.c \
  184. pthread_setspecific.c \
  185. pthread_getspecific.c
  186. all: clean $(DLLS)
  187. realclean: clean
  188. if exist pthread*.dll del pthread*.dll
  189. if exist pthread*.lib del pthread*.lib
  190. if exist *.stamp del *.stamp
  191. clean:
  192. if exist *.obj del *.obj
  193. if exist *.ilk del *.ilk
  194. if exist *.ilc del *.ilc
  195. if exist *.ild del *.ild
  196. if exist *.ilf del *.ilf
  197. if exist *.ils del *.ils
  198. if exist *.tds del *.tds
  199. if exist *.pdb del *.pdb
  200. if exist *.exp del *.exp
  201. if exist *.map del *.map
  202. if exist *.o del *.o
  203. if exist *.i del *.i
  204. if exist *.res del *.res
  205. install: $(DLLS)
  206. copy pthread*.dll $(DLLDEST)
  207. copy pthread*.lib $(LIBDEST)
  208. $(DLLS): $(DLL_OBJS) version.res
  209. ilink32 /Tpd /Gi c0d32x.obj $(DLL_OBJS), \
  210. $@, ,\
  211. cw32mti.lib import32.lib, ,\
  212. version.res
  213. .c.obj:
  214. $(CC) $(OPTIM) $(BCFLAGS) -c $<
  215. .rc.res:
  216. $(RC) $(RCFLAGS) $<
  217. attr.obj: attr.c $(ATTR_SRCS) $(INCL)
  218. barrier.obj: barrier.c $(BARRIER_SRCS) $(INCL)
  219. cancel.obj: cancel.c $(CANCEL_SRCS) $(INCL)
  220. condvar.obj: condvar.c $(CONDVAR_SRCS) $(INCL)
  221. exit.obj: exit.c $(EXIT_SRCS) $(INCL)
  222. misc.obj: misc.c $(MISC_SRCS) $(INCL)
  223. mutex.obj: mutex.c $(MUTEX_SRCS) $(INCL)
  224. nonportable.obj: nonportable.c $(NONPORTABLE_SRCS) $(INCL)
  225. private.obj: private.c $(PRIVATE_SRCS) $(INCL)
  226. rwlock.obj: rwlock.c $(RWLOCK_SRCS) $(INCL)
  227. sched.obj: sched.c $(SCHED_SRCS) $(INCL)
  228. semaphore.obj: semaphore.c $(SEMAPHORE_SRCS) $(INCL)
  229. spin.obj: spin.c $(SPIN_SRCS) $(INCL)
  230. sync.obj: sync.c $(SYNC_SRCS) $(INCL)
  231. tsd.obj: tsd.c $(TSD_SRCS) $(INCL)
  232. version.res: version.rc $(INCL)