1# Makefile for the pthreads test suite. 2# If all of the .pass files can be created, the test suite has passed. 3# 4# -------------------------------------------------------------------------- 5# 6# Pthreads-win32 - POSIX Threads Library for Win32 7# Copyright(C) 1998 John E. Bossom 8# Copyright(C) 1999,2005 Pthreads-win32 contributors 9# 10# Contact Email: rpj@callisto.canberra.edu.au 11# 12# The current list of contributors is contained 13# in the file CONTRIBUTORS included with the source 14# code distribution. The list can also be seen at the 15# following World Wide Web location: 16# http://sources.redhat.com/pthreads-win32/contributors.html 17# 18# This library is free software; you can redistribute it and/or 19# modify it under the terms of the GNU Lesser General Public 20# License as published by the Free Software Foundation; either 21# version 2 of the License, or (at your option) any later version. 22# 23# This library is distributed in the hope that it will be useful, 24# but WITHOUT ANY WARRANTY; without even the implied warranty of 25# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26# Lesser General Public License for more details. 27# 28# You should have received a copy of the GNU Lesser General Public 29# License along with this library in the file COPYING.LIB; 30# if not, write to the Free Software Foundation, Inc., 31# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 32# 33 34DLL_VER = 2 35 36CP = copy 37RM = erase 38CAT = type 39MKDIR = mkdir 40TOUCH = echo Passed > 41ECHO = @echo 42 43# The next path is relative to $BUILD_DIR 44QAPC = ..\QueueUserAPCEx\User\quserex.dll 45 46CPHDR = pthread.h semaphore.h sched.h 47 48OPTIM = -O2 49 50XXLIBS = cw32mti.lib ws2_32.lib 51 52# C++ Exceptions 53BCEFLAGS = -P -DPtW32NoCatchWarn -D__CLEANUP_CXX 54BCELIB = pthreadBCE$(DLL_VER).lib 55BCEDLL = pthreadBCE$(DLL_VER).dll 56# C cleanup code 57BCFLAGS = -D__CLEANUP_C 58BCLIB = pthreadBC$(DLL_VER).lib 59BCDLL = pthreadBC$(DLL_VER).dll 60# C++ Exceptions in application - using VC version of pthreads dll 61BCXFLAGS = -D__CLEANUP_C 62 63# Defaults 64CPLIB = $(BCLIB) 65CPDLL = $(BCDLL) 66 67CFLAGS= -q $(OPTIM) /D_WIN32_WINNT=0x400 -w -tWC -tWM -4 -w-aus -w-asc -w-par 68LFLAGS= 69INCLUDES=-I. 70BUILD_DIR=.. 71 72COPYFILES = $(CPHDR) $(CPLIB) $(CPDLL) $(QAPC) 73 74EHFLAGS = 75 76# If a test case returns a non-zero exit code to the shell, make will 77# stop. 78 79PASSES= loadfree.pass \ 80 errno1.pass \ 81 self1.pass mutex5.pass \ 82 mutex1.pass mutex1n.pass mutex1e.pass mutex1r.pass \ 83 semaphore1.pass semaphore2.pass semaphore3.pass \ 84 mutex2.pass mutex3.pass \ 85 mutex2r.pass mutex2e.pass mutex3r.pass mutex3e.pass \ 86 condvar1.pass condvar1_1.pass condvar1_2.pass condvar2.pass condvar2_1.pass \ 87 exit1.pass create1.pass create2.pass reuse1.pass reuse2.pass equal1.pass \ 88 kill1.pass valid1.pass valid2.pass \ 89 exit2.pass exit3.pass exit4.pass exit5.pass \ 90 join0.pass join1.pass detach1.pass join2.pass join3.pass \ 91 mutex4.pass mutex6.pass mutex6n.pass mutex6e.pass mutex6r.pass \ 92 mutex6s.pass mutex6es.pass mutex6rs.pass \ 93 mutex7.pass mutex7n.pass mutex7e.pass mutex7r.pass \ 94 mutex8.pass mutex8n.pass mutex8e.pass mutex8r.pass \ 95 count1.pass \ 96 once1.pass once2.pass once3.pass once4.pass \ 97 self2.pass \ 98 cancel1.pass cancel2.pass \ 99 semaphore4.pass semaphore4t.pass semaphore5.pass \ 100 barrier1.pass barrier2.pass barrier3.pass barrier4.pass barrier5.pass barrier6.pass \ 101 tsd1.pass tsd2.pass delay1.pass delay2.pass eyal1.pass \ 102 condvar3.pass condvar3_1.pass condvar3_2.pass condvar3_3.pass \ 103 condvar4.pass condvar5.pass condvar6.pass \ 104 condvar7.pass condvar8.pass condvar9.pass \ 105 rwlock1.pass rwlock2.pass rwlock3.pass rwlock4.pass \ 106 rwlock5.pass rwlock6.pass rwlock7.pass rwlock8.pass \ 107 rwlock2_t.pass rwlock3_t.pass rwlock4_t.pass rwlock5_t.pass rwlock6_t.pass rwlock6_t2.pass \ 108 context1.pass \ 109 cancel3.pass cancel4.pass cancel5.pass cancel6a.pass cancel6d.pass \ 110 cancel7.pass cancel8.pass \ 111 cleanup0.pass cleanup1.pass cleanup2.pass cleanup3.pass \ 112 priority1.pass priority2.pass inherit1.pass \ 113 spin1.pass spin2.pass spin3.pass spin4.pass \ 114 exception1.pass exception2.pass exception3.pass \ 115 cancel9.pass create3.pass stress1.pass 116 117BENCHRESULTS = \ 118 benchtest1.bench benchtest2.bench benchtest3.bench benchtest4.bench benchtest5.bench \ 119 benchtest6.bench 120 121help: 122 @ $(ECHO) Run one of the following command lines: 123 @ $(ECHO) make clean BC (to test using BC dll with VC (no EH) applications) 124 @ $(ECHO) make clean BCX (to test using BC dll with VC++ (EH) applications) 125 @ $(ECHO) make clean BCE (to test using the BCE dll with VC++ EH applications) 126 @ $(ECHO) make clean BC-bench (to benchtest using BC dll with C bench app) 127 @ $(ECHO) make clean BCX-bench (to benchtest using BC dll with C++ bench app) 128 @ $(ECHO) make clean BCE-bench (to benchtest using BCE dll with C++ bench app) 129 130all: 131 @ make clean BC 132 @ make clean BCX 133 @ make clean BCE 134 @ make clean BC-bench 135 136# This allows an individual test application to be made using the default lib. 137# e.g. make clean test cancel3.exe 138test: $(CPLIB) $(CPDLL) $(CPHDR) $(QAPC) 139 140tests: $(CPLIB) $(CPDLL) $(CPHDR) $(QAPC) sizes.pass $(PASSES) 141 @ $(ECHO) ALL TESTS PASSED! Congratulations! 142 143benchtests: $(CPLIB) $(CPDLL) $(CPHDR) $(BENCHRESULTS) 144 @ $(ECHO) ALL BENCH TESTS DONE. 145 146sizes.pass: sizes.exe 147 @ $(ECHO) ... Running $(TEST) test: $*.exe 148 @ .\$*.exe > SIZES.$(TEST) 149 @ $(CAT) SIZES.$(TEST) 150 @ $(ECHO) ...... Passed 151 @ $(TOUCH) $*.pass 152 153BCE: 154 @ make -f Bmakefile TEST="$@" CPLIB="$(BCELIB)" CPDLL="$(BCEDLL)" EHFLAGS="$(BCEFLAGS)" tests 155 156BC: 157 @ make -f Bmakefile TEST="$@" CPLIB="$(BCLIB)" CPDLL="$(BCDLL)" EHFLAGS="$(BCFLAGS)" tests 158 159BCX: 160 @ make -f Bmakefile TEST="$@" CPLIB="$(BCLIB)" CPDLL="$(BCDLL)" EHFLAGS="$(BCXFLAGS)" tests 161 162BCE-bench: 163 @ make -f Bmakefile TEST="$@" CPLIB="$(BCELIB)" CPDLL="$(BCEDLL)" EHFLAGS="$(BCEFLAGS)" XXLIBS="benchlib.o" benchtests 164 165BC-bench: 166 @ make -f Bmakefile TEST="$@" CPLIB="$(BCLIB)" CPDLL="$(BCDLL)" EHFLAGS="$(BCFLAGS)" XXLIBS="benchlib.o" benchtests 167 168BCX-bench: 169 @ make -f Bmakefile TEST="$@" CPLIB="$(BCLIB)" CPDLL="$(BCDLL)" EHFLAGS="$(BCXFLAGS)" XXLIBS="benchlib.o" benchtests 170 171.exe.pass: 172 @ $(ECHO) ... Running $(TEST) test: $< 173 @ .\$< 174 @ $(ECHO) ...... Passed 175 @ $(TOUCH) $@ 176 177.exe.bench: 178 @ $(ECHO) ... Running $(TEST) benchtest: $< 179 @ .\$< 180 @ $(ECHO) ...... Done 181 @ $(TOUCH) $@ 182 183.c.exe: 184 @ $(ECHO) $(CC) $(EHFLAGS) $(CFLAGS) $(INCLUDES) $< -e$@ $(LFLAGS) $(CPLIB) $(XXLIBS) 185 @ $(CC) $(EHFLAGS) $(CFLAGS) $(INCLUDES) $< -e$@ $(LFLAGS) $(CPLIB) $(XXLIBS) 186 187.c.o: 188 @ $(ECHO) $(CC) $(EHFLAGS) -c $(CFLAGS) $(INCLUDES) $< -o$@ 189 @ $(CC) $(EHFLAGS) $(CFLAGS) -c $(INCLUDES) $< -o$@ 190 191 192.c.i: 193 @ $(CC) /P $(EHFLAGS) $(CFLAGS) $(INCLUDES) $< 194 195$(COPYFILES): 196 @ $(ECHO) Copying $(BUILD_DIR)\$@ 197 @ $(CP) $(BUILD_DIR)\$@ . 198 199pthread.dll: $(CPDLL) 200 @ $(CP) $(CPDLL) pthread.dll 201 @ $(CP) $(CPLIB) pthread.lib 202 203clean: 204 - $(RM) *.dll 205 - $(RM) *.lib 206 - $(RM) pthread.h 207 - $(RM) semaphore.h 208 - $(RM) sched.h 209 - $(RM) *.e 210 - $(RM) *.i 211 - $(RM) *.obj 212 - $(RM) *.tds 213 - $(RM) *.pdb 214 - $(RM) *.o 215 - $(RM) *.asm 216 - $(RM) *.exe 217 - $(RM) *.pass 218 - $(RM) *.bench 219 - $(RM) *.log 220 221benchtest1.bench: 222benchtest2.bench: 223benchtest3.bench: 224benchtest4.bench: 225benchtest5.bench: 226benchtest6.bench: 227barrier1.pass: semaphore4.pass 228barrier2.pass: barrier1.pass 229barrier3.pass: barrier2.pass 230barrier4.pass: barrier3.pass 231barrier5.pass: barrier4.pass 232barrier6.pass: barrier5.pass 233cancel1.pass: create1.pass 234cancel2.pass: cancel1.pass 235cancel3.pass: context1.pass 236cancel4.pass: cancel3.pass 237cancel5.pass: cancel3.pass 238cancel6a.pass: cancel3.pass 239cancel6d.pass: cancel3.pass 240cancel7.pass: kill1.pass 241cancel8.pass: cancel7.pass 242cancel9.pass: cancel8.pass 243cleanup0.pass: cancel5.pass 244cleanup1.pass: cleanup0.pass 245cleanup2.pass: cleanup1.pass 246cleanup3.pass: cleanup2.pass 247condvar1.pass: 248condvar1_1.pass: condvar1.pass 249condvar1_2.pass: join2.pass 250condvar2.pass: condvar1.pass 251condvar2_1.pass: condvar2.pass join2.pass 252condvar3.pass: create1.pass condvar2.pass 253condvar3_1.pass: condvar3.pass join2.pass 254condvar3_2.pass: condvar3_1.pass 255condvar3_3.pass: condvar3_2.pass 256condvar4.pass: create1.pass 257condvar5.pass: condvar4.pass 258condvar6.pass: condvar5.pass 259condvar7.pass: condvar6.pass cleanup1.pass 260condvar8.pass: condvar7.pass 261condvar9.pass: condvar8.pass 262context1.pass: cancel2.pass 263count1.pass: join1.pass 264create1.pass: mutex2.pass 265create2.pass: create1.pass 266create3.pass: 267delay1.pass: 268delay2.pass: delay1.pass 269detach1.pass: join0.pass 270equal1.pass: create1.pass 271errno1.pass: mutex3.pass 272exception1.pass: cancel4.pass 273exception2.pass: exception1.pass 274exception3.pass: exception2.pass 275exit1.pass: 276exit2.pass: create1.pass 277exit3.pass: create1.pass 278exit4.pass: 279exit5.pass: kill1.pass 280eyal1.pass: tsd1.pass 281inherit1.pass: join1.pass priority1.pass 282join0.pass: create1.pass 283join1.pass: create1.pass 284join2.pass: create1.pass 285join3.pass: join2.pass 286kill1.pass: 287loadfree.pass: pthread.dll 288mutex1.pass: self1.pass 289mutex1n.pass: mutex1.pass 290mutex1e.pass: mutex1.pass 291mutex1r.pass: mutex1.pass 292mutex2.pass: mutex1.pass 293mutex2r.pass: mutex2.pass 294mutex2e.pass: mutex2.pass 295mutex3.pass: create1.pass 296mutex3r.pass: mutex3.pass 297mutex3e.pass: mutex3.pass 298mutex4.pass: mutex3.pass 299mutex5.pass: 300mutex6.pass: mutex4.pass 301mutex6n.pass: mutex4.pass 302mutex6e.pass: mutex4.pass 303mutex6r.pass: mutex4.pass 304mutex6s.pass: mutex6.pass 305mutex6rs.pass: mutex6r.pass 306mutex6es.pass: mutex6e.pass 307mutex7.pass: mutex6.pass 308mutex7n.pass: mutex6n.pass 309mutex7e.pass: mutex6e.pass 310mutex7r.pass: mutex6r.pass 311mutex8.pass: mutex7.pass 312mutex8n.pass: mutex7n.pass 313mutex8e.pass: mutex7e.pass 314mutex8r.pass: mutex7r.pass 315once1.pass: create1.pass 316once2.pass: once1.pass 317once3.pass: once2.pass 318once4.pass: once3.pass 319priority1.pass: join1.pass 320priority2.pass: priority1.pass barrier3.pass 321reuse1.pass: create2.pass 322reuse2.pass: reuse1.pass 323rwlock1.pass: condvar6.pass 324rwlock2.pass: rwlock1.pass 325rwlock3.pass: rwlock2.pass 326rwlock4.pass: rwlock3.pass 327rwlock5.pass: rwlock4.pass 328rwlock6.pass: rwlock5.pass 329rwlock7.pass: rwlock6.pass 330rwlock8.pass: rwlock7.pass 331rwlock2_t.pass: rwlock2.pass 332rwlock3_t.pass: rwlock2_t.pass 333rwlock4_t.pass: rwlock3_t.pass 334rwlock5_t.pass: rwlock4_t.pass 335rwlock6_t.pass: rwlock5_t.pass 336rwlock6_t2.pass: rwlock6_t.pass 337self1.pass: 338self2.pass: create1.pass 339semaphore1.pass: 340semaphore2.pass: 341semaphore3.pass: semaphore2.pass 342semaphore4.pass: semaphore3.pass cancel1.pass 343semaphore4t.pass: semaphore4.pass 344semaphore5.pass: semaphore4.pass 345sizes.pass: 346spin1.pass: 347spin2.pass: spin1.pass 348spin3.pass: spin2.pass 349spin4.pass: spin3.pass 350stress1.pass: 351tsd1.pass: barrier5.pass join1.pass 352tsd2.pass: tsd1.pass 353valid1.pass: join1.pass 354valid2.pass: valid1.pass 355