Makefile revision 59667
159612Sjasone# 250476Speter# $FreeBSD: head/lib/libkse/test/Makefile 59667 2000-04-26 23:25:58Z jasone $ 338540Sjb# 459612Sjasone# Automated test suite for libc_r (pthreads). 538540Sjb# 638540Sjb 759612Sjasone# File lists. 838540Sjb 959612Sjasone# Diff mode tests written in C. 1059612SjasoneCDTESTS := hello_d.c mutex_d.c sem_d.c sigsuspend_d.c sigwait_d.c 1159612Sjasone 1259612Sjasone# Sequence mode tests written in C. 1359612SjasoneCSTESTS := hello_s.c 1459612Sjasone 1559612Sjasone# C programs that are used internally by the perl-based tests. The build 1659612Sjasone# system merely compiles these. 1759612SjasoneBTESTS := hello_b.c 1859612Sjasone 1959612Sjasone# Diff mode tests written in perl. 2059612SjasonePDTESTS := 2159612Sjasone 2259612Sjasone# Sequence mode tests written in perl. 2359667SjasonePSTESTS := propagate_s.pl 2459612Sjasone 2559612Sjasone# Munge the file lists to their final executable names (strip the .c). 2659612SjasoneCDTESTS := $(CDTESTS:R) 2759612SjasoneCSTESTS := $(CSTESTS:R) 2859612SjasoneBTESTS := $(BTESTS:R) 2959612Sjasone 3059612SjasoneCPPFLAGS := -D_LIBC_R_ 3159612SjasoneCFLAGS := -Wall -pipe -g3 3259612SjasoneLDFLAGS_A := -static 3359612SjasoneLDFLAGS_P := -pg 3459612SjasoneLDFLAGS_S := 3559612SjasoneLIBS := -pthread 3659612Sjasone 3759612Sjasone# Flags passed to verify. "-v" or "-u" may be useful. 3859612SjasoneVFLAGS := 3959612Sjasone 4059612Sjasoneall : default 4159612Sjasone 4259612Sjasone# Only use the following suffixes, in order to avoid any strange built-in rules. 4359612Sjasone.SUFFIXES : 4459612Sjasone.SUFFIXES : .c .o .d .pl 4559612Sjasone 4659612Sjasone# Clear out all paths, then set just one (default path) for the main build 4759612Sjasone# directory. 4859612Sjasone.PATH : 4959612Sjasone.PATH : . 5059612Sjasone 5159612Sjasone# Build the C programs. 5259612Sjasone.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 5359612Sjasone$(bin)_a : $(bin:S/$/&.c/) 5459612Sjasone $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 5559612Sjasone $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_A) $(LIBS) 5659612Sjasone @$(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/)" 5759612Sjasone 5859612Sjasone$(bin)_p : $(bin:S/$/&.c/) 5959612Sjasone $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 6059612Sjasone $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_P) $(LIBS) 6159612Sjasone @$(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/)" 6259612Sjasone 6359612Sjasone$(bin)_s : $(bin:S/$/&.c/) 6459612Sjasone $(CC) $(CFLAGS) $(CPPFLAGS) -c $(bin:S/$/&.c/) -o $(@:S/$/&.o/) 6559612Sjasone $(CC) -o $@ $(@:S/$/&.o/) $(LDFLAGS_S) $(LIBS) 6659612Sjasone @$(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/)" 6759612Sjasone.endfor 6859612Sjasone 6959612Sjasone# Dependency file inclusion. 7059612Sjasone.for depfile in $(CDTESTS:R:S/$/&_a.d/) $(CSTESTS:R:S/$/&_a.d/) \ 7159612Sjasone $(BTESTS:R:S/$/&_a.d/) $(CDTESTS:R:S/$/&_p.d/) \ 7259612Sjasone $(CSTESTS:R:S/$/&_p.d/) $(BTESTS:R:S/$/&_p.d/) \ 7359612Sjasone $(CDTESTS:R:S/$/&_s.d/) $(CSTESTS:R:S/$/&_s.d/) \ 7459612Sjasone $(BTESTS:R:S/$/&_s.d/) 7559612Sjasone.if exists($(depfile)) 7659612Sjasone.include "$(depfile)" 7759612Sjasone.endif 7859612Sjasone.endfor 7959612Sjasone 8059612Sjasonedefault : check 8159612Sjasone 8259612Sjasonetests_a : $(CDTESTS:S/$/&_a/) $(CSTESTS:S/$/&_a/) $(BTESTS:S/$/&_a/) 8359612Sjasonetests_p : $(CDTESTS:S/$/&_p/) $(CSTESTS:S/$/&_p/) $(BTESTS:S/$/&_p/) 8459612Sjasonetests_s : $(CDTESTS:S/$/&_s/) $(CSTESTS:S/$/&_s/) $(BTESTS:S/$/&_s/) 8559612Sjasone 8659612Sjasonetests : tests_a tests_p tests_s 8759612Sjasone 8859612Sjasonecheck_a : tests_a 8959612Sjasone.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 9059612Sjasone @cp $(bin)_a $(bin) 9159612Sjasone.endfor 9259612Sjasone @echo "Test static library:" 9359612Sjasone @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 9459612Sjasone 9559612Sjasonecheck_p : tests_p 9659612Sjasone.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 9759612Sjasone @cp $(bin)_p $(bin) 9859612Sjasone.endfor 9959612Sjasone @echo "Test profile library:" 10059612Sjasone @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 10159612Sjasone 10259612Sjasonecheck_s : tests_s 10359612Sjasone.for bin in $(CDTESTS) $(CSTESTS) $(BTESTS) 10459612Sjasone @cp $(bin)_s $(bin) 10559612Sjasone.endfor 10659612Sjasone @echo "Test shared library:" 10759612Sjasone @./verify $(VFLAGS) -- -d $(CDTESTS) $(PDTESTS) -s $(CSTESTS) $(PSTESTS) 10859612Sjasone 10959612Sjasonecheck : check_a check_p check_s 11059612Sjasone 11159612Sjasoneclean : 11259612Sjasone rm -f *~ 11359612Sjasone rm -f *.core 11459612Sjasone rm -f *.out 11559612Sjasone rm -f *.perf 11659612Sjasone rm -f *.diff 11759612Sjasone rm -f *.gmon 11859612Sjasone rm -f $(CDTESTS) $(CSTESTS) $(BTESTS) 11959612Sjasone rm -f $(CDTESTS:S/$/&_a/) $(CSTESTS:S/$/&_a/) $(BTESTS:S/$/&_a/) 12059612Sjasone rm -f $(CDTESTS:S/$/&_p/) $(CSTESTS:S/$/&_p/) $(BTESTS:S/$/&_p/) 12159612Sjasone rm -f $(CDTESTS:S/$/&_s/) $(CSTESTS:S/$/&_s/) $(BTESTS:S/$/&_s/) 12259612Sjasone rm -f *.d 12359612Sjasone rm -f *.o 124