summaryrefslogtreecommitdiff
path: root/lib/libpthread/tests/Makefile
blob: 5ba9f9a3927d37002ff7cc56f1f218a75102f689 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Generated automatically from Makefile.in by configure.
# === GNUmakefile ============================================================
# Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
#
#	Description: This file is for creating the test programs for libpthread.a
#
#	1.00 93/08/03 proven
#		-Initial cut for pthreads.
#

CC = ../pgcc -notinstalled
CPP = gcc -E
srctop = /dr1/my/masters/mysql/mit-pthreads
srcdir = /dr1/my/masters/mysql/mit-pthreads/tests
VPATH = /dr1/my/masters/mysql/mit-pthreads/tests
CDEBUGFLAGS = -g -O2 -Werror

INCLUDES= -I../include -I.. -I$(srctop)/include
CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(ADDL_CFLAGS) -DSRCDIR=\"$(srcdir)\"
LIBS = -lm -lgcc -L../obj/ -lpthread
#LIBS = -static 

# This list used to include test_select, but that test doesn't terminate.
TESTS = test_create test_pthread_join test_switch test_sleep test_readdir \
	test_fork test_execve test_preemption test_preemption_float \
	test_sock_1 test_sock_2 test_stdio_1 test_pthread_mutex \
	test_pthread_cond_timedwait test_netdb test_pw test_cwd
# This list used to include p_bench_semaphore, but the semaphore support isn't
# defined for all targets (or used for any).
BENCHMARKS = p_bench_read p_bench_mutex p_bench_yield \
	p_bench_getpid p_bench_pthread_create

all : $(TESTS) $(BENCHMARKS)

check : $(TESTS)
	set -e ; \
	for i in $(TESTS) ; do \
	  echo Running test $$i ... ; \
	  ./$$i ; \
	done

# More flags
ADDITIONALFLAGS = -DPTHREAD_INITIAL_PORT
################################################################################
#

clean: 
	rm -f *.o $(TESTS) $(BENCHMARKS) a.out core maketmp makeout

depend:
	sed '/\#\#\# Dependencies/q' < Makefile > maketmp
	(for i in $(CSRC);do $(CPP) -M $$i;done) >> maketmp
	cp maketmp Makefile

install:

realclean: clean
	rm -f Makefile

.c.o:
	$(CC) $(CFLAGS) -c $<

Makefile: Makefile.in
	(cd .. ; sh config.status)

test_create : test_create.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_create test_create.o $(LIBS)

test_pthread_join : test_pthread_join.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_pthread_join test_pthread_join.o $(LIBS)

test_switch : test_switch.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_switch test_switch.o $(LIBS)

test_sleep : test_sleep.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_sleep test_sleep.o $(LIBS)

test_readdir : test_readdir.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_readdir test_readdir.o $(LIBS)

test_fork : test_fork.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_fork test_fork.o $(LIBS)

test_execve : test_execve.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_execve test_execve.o $(LIBS)

test_preemption : test_preemption.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_preemption test_preemption.o $(LIBS)

test_preemption_float : test_preemption_float.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_preemption_float test_preemption_float.o $(LIBS)

test_stdio_1 : test_stdio_1.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_stdio_1 test_stdio_1.o $(LIBS)

test_sock_1 : test_sock_1.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_sock_1 test_sock_1.o $(LIBS)

test_sock_2 : test_sock_2a test_sock_2.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_sock_2 test_sock_2.o $(LIBS)

test_sock_2a : test_sock_2a.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_sock_2a test_sock_2a.o $(LIBS)

test_pthread_mutex : test_pthread_mutex.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_pthread_mutex test_pthread_mutex.o $(LIBS)

test_pthread_cond_timedwait : test_pthread_cond_timedwait.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_pthread_cond_timedwait test_pthread_cond_timedwait.o $(LIBS)

test_netdb : test_netdb.o ../libpthread.a
	$(CC) $(CFLAGS) -o test_netdb test_netdb.o $(LIBS)

test_select : test_select.o ../obj/libpthread.a
	$(CC) $(CFLAGS) -o test_select test_select.o $(LIBS)

test_pw : test_pw.o ../obj/libpthread.a
	$(CC) $(CFLAGS) -o test_pw test_pw.o $(LIBS)

test_cwd : test_cwd.o ../obj/libpthread.a
	$(CC) $(CFLAGS) -o test_cwd test_cwd.o $(LIBS)

p_bench_read : p_bench_read.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_read p_bench_read.o $(LIBS)

p_bench_semaphore : p_bench_semaphore.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_semaphore p_bench_semaphore.o $(LIBS)

p_bench_mutex : p_bench_mutex.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_mutex p_bench_mutex.o $(LIBS)

p_bench_yield : p_bench_yield.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_yield p_bench_yield.o $(LIBS)

p_bench_getpid : p_bench_getpid.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_getpid p_bench_getpid.o $(LIBS)

p_bench_pthread_create : p_bench_pthread_create.o ../libpthread.a
	$(CC) $(CFLAGS) -o p_bench_pthread_create p_bench_pthread_create.o $(LIBS)

test_create.o : test_create.c
test_pthread_join.o : test_pthread_join.c
test_switch.o : test_switch.c
test_sleep.o : test_sleep.c
test_readdir.o : test_readdir.c
test_fork.o : test_fork.c
test_execve.o : test_execve.c
test_preemption.o : test_preemption.c
test_preemption_float.o : test_preemption_float.c
test_sock_1.o : test_sock_1.c
test_sock_2.o : test_sock_2.c
test_sock_3.o : test_sock_3.c
test_stdio_1.o : test_stdio_1.c
test_pthread_mutex.o : test_pthread_mutex.c
test_pthread_cond_timedwait.o : test_pthread_cond_timedwait.c
p_bench_read.o : p_bench_read.c
p_bench_semaphore.o : p_bench_semaphore.c
p_bench_mutex.o : p_bench_mutex.c
p_bench_yield.o : p_bench_yield.c
p_bench_getpid.o : p_bench_getpid.c
p_bench_pthread_create.o : p_bench_pthread_create.c

################################################################################
### Do not remove the following line. It is for depend #########################
### Dependencies: