📄 gnumakefile
字号:
# Makefile for the pthreads test suite.# If all of the .pass files can be created, the test suite has passed.## --------------------------------------------------------------------------## Pthreads-win32 - POSIX Threads Library for Win32# Copyright(C) 1998 John E. Bossom# Copyright(C) 1999,2005 Pthreads-win32 contributors# # Contact Email: rpj@callisto.canberra.edu.au# # The current list of contributors is contained# in the file CONTRIBUTORS included with the source# code distribution. The list can also be seen at the# following World Wide Web location:# http://sources.redhat.com/pthreads-win32/contributors.html# # This library is free software; you can redistribute it and/or# modify it under the terms of the GNU Lesser General Public# License as published by the Free Software Foundation; either# version 2 of the License, or (at your option) any later version.# # This library is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# Lesser General Public License for more details.# # You should have received a copy of the GNU Lesser General Public# License along with this library in the file COPYING.LIB;# if not, write to the Free Software Foundation, Inc.,# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA#DLL_VER = 2CP = cp -fMV = mv -fRM = rm -fCAT = cat#CP = copy#MV = rename#RM = erase#CAT = typeMKDIR = mkdirTOUCH = echo Passed >ECHO = @echoMAKE = make## Mingw32#XXCFLAGS = XXLIBS = -lws2_32#CFLAGS = -O3 -UNDEBUG -Wall $(XXCFLAGS)CFLAGS = -g -UNDEBUG -Wall $(XXCFLAGS)BUILD_DIR = ..INCLUDES = -I.TEST = GC# Default lib versionGCX = $(TEST)$(DLL_VER)# Files we need to run the tests# - paths are relative to pthreads build dir.HDR = pthread.h semaphore.h sched.hLIB = libpthread$(GCX).aDLL = pthread$(GCX).dllQAPC = ../QueueUserAPCEx/User/quserex.dllCOPYFILES = $(HDR) $(LIB) $(DLL) $(QAPC)# If a test case returns a non-zero exit code to the shell, make will# stop.TESTS = sizes loadfree \ self1 mutex5 mutex1 mutex1e mutex1n mutex1r \ semaphore1 semaphore2 semaphore3 \ condvar1 condvar1_1 condvar1_2 condvar2 condvar2_1 exit1 \ create1 create2 reuse1 reuse2 equal1 \ kill1 valid1 valid2 \ exit2 exit3 exit4 exit5 \ join0 join1 detach1 join2 join3 \ mutex2 mutex2r mutex2e mutex3 mutex3r mutex3e \ mutex4 mutex6 mutex6n mutex6e mutex6r \ mutex6s mutex6es mutex6rs \ mutex7 mutex7n mutex7e mutex7r mutex8 mutex8n mutex8e mutex8r \ count1 \ once1 once2 once3 once4 self2 \ cancel1 cancel2 \ semaphore4 semaphore4t \ barrier1 barrier2 barrier3 barrier4 barrier5 \ tsd1 tsd2 delay1 delay2 eyal1 \ condvar3 condvar3_1 condvar3_2 condvar3_3 \ condvar4 condvar5 condvar6 condvar7 condvar8 condvar9 \ errno1 \ rwlock1 rwlock2 rwlock3 rwlock4 rwlock5 rwlock6 rwlock7 rwlock8 \ rwlock2_t rwlock3_t rwlock4_t rwlock5_t rwlock6_t rwlock6_t2 \ context1 cancel3 cancel4 cancel5 cancel6a cancel6d \ cancel7 cancel8 \ cleanup0 cleanup1 cleanup2 cleanup3 \ priority1 priority2 inherit1 \ spin1 spin2 spin3 spin4 \ exception1 exception2 exception3 \ cancel9 create3 stress1STRESSTESTS = \ stress1BENCHTESTS = \ benchtest1 benchtest2 benchtest3 benchtest4 benchtest5STATICTESTS = \ self1PASSES = $(TESTS:%=%.pass)BENCHRESULTS = $(BENCHTESTS:%=%.bench)STRESSRESULTS = $(STRESSTESTS:%=%.pass)STATICRESULTS = $(STATICTESTS:%=%.pass)help: @ $(ECHO) "Run one of the following command lines:" @ $(ECHO) "make clean GC (to test using GC dll with C (no EH) applications)" @ $(ECHO) "make clean GCX (to test using GC dll with C++ (EH) applications)" @ $(ECHO) "make clean GCE (to test using GCE dll with C++ (EH) applications)" @ $(ECHO) "make clean GC-bench (to benchtest using GNU C dll with C cleanup code)" @ $(ECHO) "make clean GCE-bench (to benchtest using GNU C dll with C++ exception handling)" @ $(ECHO) "make clean GC-stress (to stresstest using GNU C dll with C cleanup code)" @ $(ECHO) "make clean GCE-stress (to stresstest using GNU C dll with C++ exception handling)" @ $(ECHO) "make clean GC-static (to test using GC static lib with C (no EH) applications)"all: @ $(MAKE) clean GC @ $(MAKE) clean GCX @ $(MAKE) clean GCEGC: $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" all-passGCE: $(MAKE) TEST=GCE CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" all-passGCX: $(MAKE) TEST=GC CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_C" all-passGC-bench: $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" XXLIBS="benchlib.o" all-benchGCE-bench: $(MAKE) TEST=GCE CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="benchlib." all-benchGC-debug: $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" DLL_VER="$(DLL_VER)d" all-passGC-static: $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C -DPTW32_STATIC_LIB" DLL="" all-staticGC-stress: $(ECHO) Stress tests can take a long time since they are trying to $(ECHO) expose weaknesses that may be intermittant or statistically rare. $(ECHO) A pass does not prove correctness, but may give greater confidence. $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C" all-stressGCE-stress: $(MAKE) TEST=GCE CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" all-stressall-pass: $(PASSES) @ $(ECHO) ALL TESTS PASSED! Congratulations!all-bench: $(BENCHRESULTS) @ $(ECHO) BENCH TESTS COMPLETED.all-stress: $(STRESSRESULTS) @ $(ECHO) STRESS TESTS COMPLETED.all-static: $(STATICRESULTS) @ $(ECHO) ALL STATIC TESTS PASSED! Congratulations! @ $(ECHO) Build and test the DLL to run all tests. @ $(ECHO) This test only confirms that the static lib links correctly.benchtest1.bench:benchtest2.bench:benchtest3.bench:benchtest4.bench:benchtest5.bench:barrier1.pass: semaphore4.passbarrier2.pass: barrier1.passbarrier3.pass: barrier2.passbarrier4.pass: barrier3.passbarrier5.pass: barrier4.passcancel1.pass: create1.passcancel2.pass: cancel1.passcancel2_1.pass: cancel2.passcancel3.pass: context1.passcancel4.pass: cancel3.passcancel5.pass: cancel3.passcancel6a.pass: cancel3.passcancel6d.pass: cancel3.passcancel7.pass: kill1.passcancel8.pass: cancel7.passcancel9.pass: cancel8.passcleanup0.pass: cancel5.passcleanup1.pass: cleanup0.passcleanup2.pass: cleanup1.passcleanup3.pass: cleanup2.passcondvar1.pass:condvar1_1.pass: condvar1.passcondvar1_2.pass: join2.passcondvar2.pass: condvar1.passcondvar2_1.pass: condvar2.pass join2.passcondvar3.pass: create1.pass condvar2.passcondvar3_1.pass: condvar3.pass join2.passcondvar3_2.pass: condvar3_1.passcondvar3_3.pass: condvar3_2.passcondvar4.pass: create1.passcondvar5.pass: condvar4.passcondvar6.pass: condvar5.passcondvar7.pass: condvar6.pass cleanup1.passcondvar8.pass: condvar7.passcondvar9.pass: condvar8.passcontext1.pass: cancel2.passcount1.pass: join1.passcreate1.pass: mutex2.passcreate2.pass: create1.passcreate3.pass:delay1.pass: cancel2.passdelay2.pass: delay1.passdetach1.pass: join0.passequal1.pass: create1.passerrno1.pass: mutex3.passexception1.pass: cancel4.passexception2.pass: exception1.passexception3.pass: exception2.passexit1.pass:exit2.pass: create1.passexit3.pass: create1.passexit4.pass:exit5.pass: exit4.pass kill1.passeyal1.pass: tsd1.passinherit1.pass: join1.pass priority1.passjoin0.pass: create1.passjoin1.pass: create1.passjoin2.pass: create1.passjoin3.pass: join2.passkill1.pass:loadfree.pass: pthread.dllmutex1.pass: self1.passmutex1n.pass: mutex1.passmutex1e.pass: mutex1.passmutex1r.pass: mutex1.passmutex2.pass: mutex1.passmutex2r.pass: mutex2.passmutex2e.pass: mutex2.passmutex3.pass: create1.passmutex3r.pass: mutex3.passmutex3e.pass: mutex3.passmutex4.pass: mutex3.passmutex5.pass:mutex6.pass: mutex4.passmutex6n.pass: mutex4.passmutex6e.pass: mutex4.passmutex6r.pass: mutex4.passmutex6s.pass: mutex6.passmutex6rs.pass: mutex6r.passmutex6es.pass: mutex6e.passmutex7.pass: mutex6.passmutex7n.pass: mutex6n.passmutex7e.pass: mutex6e.passmutex7r.pass: mutex6r.passmutex8.pass: mutex7.passmutex8n.pass: mutex7n.passmutex8e.pass: mutex7e.passmutex8r.pass: mutex7r.passonce1.pass: create1.passonce2.pass: once1.passonce3.pass: once2.passonce4.pass: once3.passpriority1.pass: join1.passpriority2.pass: priority1.pass barrier3.passreuse1.pass: create2.passreuse2.pass: reuse1.passrwlock1.pass: condvar6.passrwlock2.pass: rwlock1.passrwlock3.pass: rwlock2.passrwlock4.pass: rwlock3.passrwlock5.pass: rwlock4.passrwlock6.pass: rwlock5.passrwlock7.pass: rwlock6.passrwlock8.pass: rwlock7.passrwlock2_t.pass: rwlock2.passrwlock3_t.pass: rwlock2_t.passrwlock4_t.pass: rwlock3_t.passrwlock5_t.pass: rwlock4_t.passrwlock6_t.pass: rwlock5_t.passrwlock6_t2.pass: rwlock6_t.passself1.pass:self2.pass: create1.passsemaphore1.pass:semaphore2.pass:semaphore3.pass: semaphore2.passsemaphore4.pass: semaphore3.pass cancel1.passsemaphore4t.pass: semaphore4.passsizes.pass:spin1.pass:spin2.pass: spin1.passspin3.pass: spin2.passspin4.pass: spin3.passstress1.pass:tsd1.pass: barrier5.pass join1.passtsd2.pass: tsd1.passvalid1.pass: join1.passvalid2.pass: valid1.passsizes.pass: sizes.exe @ $(ECHO) Running $* $< > SIZES.$(TEST) @ $(CAT) SIZES.$(TEST) @ $(ECHO) Passed @ $(TOUCH) $@%.pass: %.exe @ $(ECHO) Running $* $* @ $(ECHO) Passed @ $(TOUCH) $@%.bench: $(LIB) $(DLL) $(HDR) $(QAPC) $(XXLIBS) %.exe @ $(ECHO) Running $* $* @ $(ECHO) Done @ $(TOUCH) $@%.exe: %.c $(LIB) $(DLL) $(HDR) $(QAPC) @ $(ECHO) Compiling $@ @ $(ECHO) $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS) @ $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS)%.pre: %.c $(HDR) @ $(CC) -E $(CFLAGS) -o $@ $< $(INCLUDES)%.s: %.c $(HDR) @ $(CC) -S $(CFLAGS) -o $@ $< $(INCLUDES)$(COPYFILES): @ $(ECHO) Copying $@ @ $(CP) $(BUILD_DIR)/$@ .benchlib.o: benchlib.c @ $(ECHO) Compiling $@ @ $(ECHO) $(CC) -c $(CFLAGS) $< $(INCLUDES) @ $(CC) -c $(CFLAGS) $< $(INCLUDES)pthread.dll: $(DLL) @ $(CP) $(DLL) $@clean: - $(RM) *.dll - $(RM) *.lib - $(RM) pthread.h - $(RM) semaphore.h - $(RM) sched.h - $(RM) *.a - $(RM) *.e - $(RM) *.i - $(RM) *.o - $(RM) *.obj - $(RM) *.pdb - $(RM) *.exe - $(RM) *.pass - $(RM) *.bench - $(RM) *.static - $(RM) *.log
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -