1# $FreeBSD: head/lib/libkse/test/Makefile 50476 1999-08-28 00:22:10Z peter $
| |
2#
| 1#
|
3# Tests for libc_r functionality.
| 2# $FreeBSD: head/lib/libkse/test/Makefile 59612 2000-04-24 21:07:45Z jasone $
|
4#
| 3#
|
| 4# Automated test suite for libc_r (pthreads). 5#
|
5
| 6
|
6SUBDIR= mutex sigsuspend sigwait
| 7# File lists.
|
7
| 8
|
8.include <bsd.subdir.mk>
| 9# Diff mode tests written in C. 10CDTESTS := hello_d.c mutex_d.c sem_d.c sigsuspend_d.c sigwait_d.c 11 12# Sequence mode tests written in C. 13CSTESTS := hello_s.c 14 15# C programs that are used internally by the perl-based tests. The build 16# system merely compiles these. 17BTESTS := hello_b.c 18 19# Diff mode tests written in perl. 20PDTESTS := 21 22# Sequence mode tests written in perl. 23PSTESTS := 24 25# Munge the file lists to their final executable names (strip the .c). 26CDTESTS := $(CDTESTS:R) 27CSTESTS := $(CSTESTS:R) 28BTESTS := $(BTESTS:R) 29 30CPPFLAGS := -D_LIBC_R_ 31CFLAGS := -Wall -pipe -g3 32LDFLAGS_A := -static 33LDFLAGS_P := -pg 34LDFLAGS_S := 35LIBS := -pthread 36 37# Flags passed to verify. "-v" or "-u" may be useful. 38VFLAGS := 39 40all : default 41 42# Only use the following suffixes, in order to avoid any strange built-in rules. 43.SUFFIXES : 44.SUFFIXES : .c .o .d .pl 45 46# Clear out all paths, then set just one (default path) for the main build 47# directory. 48.PATH : 49.PATH : . 50 51# Build the C programs. 52.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 53$(bin)_a : $(bin:S/$/&.c/) 54 $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 55 $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_A) $(LIBS) 56 @$(SHELL) -ec "$(CC) -M $(CPPFLAGS) $(bin:S/$/&.c/) | sed \"s/\($(bin:T)\)\.o\([ :]*\)/$(bin:H:S!/!\\/!g)\/\1_a.o \2/g\" > $(@:R:S/$/&.d/)" 57 58$(bin)_p : $(bin:S/$/&.c/) 59 $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 60 $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_P) $(LIBS) 61 @$(SHELL) -ec "$(CC) -M $(CPPFLAGS) $(bin:S/$/&.c/) | sed \"s/\($(bin:T)\)\.o\([ :]*\)/$(bin:H:S!/!\\/!g)\/\1_p.o \2/g\" > $(@:R:S/$/&.d/)" 62 63$(bin)_s : $(bin:S/$/&.c/) 64 $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 65 $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_S) $(LIBS) 66 @$(SHELL) -ec "$(CC) -M $(CPPFLAGS) $(bin:S/$/&.c/) | sed \"s/\($(bin:T)\)\.o\([ :]*\)/$(bin:H:S!/!\\/!g)\/\1_s.o \2/g\" > $(@:R:S/$/&.d/)" 67.endfor 68 69# Dependency file inclusion. 70.for depfile in $(CDTESTS:R:S/$/&_a.d/) $(CSTESTS:R:S/$/&_a.d/) \ 71 $(BTESTS:R:S/$/&_a.d/) $(CDTESTS:R:S/$/&_p.d/) \ 72 $(CSTESTS:R:S/$/&_p.d/) $(BTESTS:R:S/$/&_p.d/) \ 73 $(CDTESTS:R:S/$/&_s.d/) $(CSTESTS:R:S/$/&_s.d/) \ 74 $(BTESTS:R:S/$/&_s.d/) 75.if exists($(depfile)) 76.include "$(depfile)" 77.endif 78.endfor 79 80default : check 81 82tests_a : $(CDTESTS:S/$/&_a/) $(CSTESTS:S/$/&_a/) $(BTESTS:S/$/&_a/) 83tests_p : $(CDTESTS:S/$/&_p/) $(CSTESTS:S/$/&_p/) $(BTESTS:S/$/&_p/) 84tests_s : $(CDTESTS:S/$/&_s/) $(CSTESTS:S/$/&_s/) $(BTESTS:S/$/&_s/) 85 86tests : tests_a tests_p tests_s 87 88check_a : tests_a 89.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 90 @cp $(bin)_a $(bin) 91.endfor 92 @echo "Test static library:" 93 @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 94 95check_p : tests_p 96.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 97 @cp $(bin)_p $(bin) 98.endfor 99 @echo "Test profile library:" 100 @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 101 102check_s : tests_s 103.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 104 @cp $(bin)_s $(bin) 105.endfor 106 @echo "Test shared library:" 107 @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 108 109check : check_a check_p check_s 110 111clean : 112 rm -f *~ 113 rm -f *.core 114 rm -f *.out 115 rm -f *.perf 116 rm -f *.diff 117 rm -f *.gmon 118 rm -f $(CDTESTS) $(CSTESTS) $(BTESTS) 119 rm -f $(CDTESTS:S/$/&_a/) $(CSTESTS:S/$/&_a/) $(BTESTS:S/$/&_a/) 120 rm -f $(CDTESTS:S/$/&_p/) $(CSTESTS:S/$/&_p/) $(BTESTS:S/$/&_p/) 121 rm -f $(CDTESTS:S/$/&_s/) $(CSTESTS:S/$/&_s/) $(BTESTS:S/$/&_s/) 122 rm -f *.d 123 rm -f *.o
|
| |