forked from mlkazar/lwt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
115 lines (79 loc) · 3.31 KB
/
makefile
File metadata and controls
115 lines (79 loc) · 3.31 KB
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
all: libthread.a ttest mtest eptest timertest pipetest ptest locktest iftest threadpooltest
ifndef RANLIB
RANLIB=ranlib
endif
DESTDIR=../export
INCLS=thread.h threadmutex.h threadpipe.h osp.h dqueue.h epoll.h threadtimer.h spinlock.h ospnew.h ospnet.h threadpool.h
CXXFLAGS=-g -Wall
install: all
-mkdir $(DESTDIR)/include $(DESTDIR)/lib $(DESTDIR)/bin
cp -up $(INCLS) $(DESTDIR)/include
cp -up libthread.a $(DESTDIR)/lib
clean:
-rm -f iftest ptest ttest mtest eptest timertest pipetest locktest threadpooltest *.o *.a *temp.s
(cd alternatives; make clean)
ospnet.o: ospnet.cc ospnet.h
$(CXX) -c $(CXXFLAGS) ospnet.cc
iftest.o: iftest.cc
$(CXX) -c $(CXXFLAGS) -o iftest.o iftest.cc
iftest: iftest.o ospnet.o
$(CXX) -o iftest iftest.o ospnet.o -pthread
getcontext.o: getcontext.s
cpp getcontext.s >getcontext-temp.s
as -o getcontext.o getcontext-temp.s
-rm getcontext-temp.s
setcontext.o: setcontext.s
cpp setcontext.s >setcontext-temp.s
as -o setcontext.o setcontext-temp.s
-rm setcontext-temp.s
osp.o: osp.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) osp.cc -pthread
ospnew.o: ospnew.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) ospnew.cc -pthread
threadtimer.o: threadtimer.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) threadtimer.cc -pthread
threadmutex.o: threadmutex.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) threadmutex.cc -pthread
threadpipe.o: threadpipe.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) threadpipe.cc -pthread
libthread.a: epoll.o thread.o getcontext.o setcontext.o threadmutex.o threadpipe.o osp.o ospnew.o ospnet.o threadtimer.o threadpool.o
$(AR) cr libthread.a epoll.o thread.o getcontext.o setcontext.o threadmutex.o threadpipe.o osp.o ospnew.o ospnet.o threadtimer.o threadpool.o
$(RANLIB) libthread.a
thread.o: thread.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o thread.o thread.cc -pthread
epoll.o: epoll.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o epoll.o epoll.cc -pthread
threadpool.o: threadpool.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o threadpool.o threadpool.cc
threadpooltest.o: threadpooltest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o threadpooltest.o threadpooltest.cc
threadpooltest: threadpooltest.o libthread.a
$(CXX) $(CXXFLAGS) -o threadpooltest threadpooltest.o libthread.a -pthread
ttest.o: ttest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o ttest.o ttest.cc -pthread
ttest: ttest.o libthread.a
$(CXX) -g -o ttest ttest.o libthread.a -pthread
timertest.o: timertest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o timertest.o timertest.cc -pthread
pipetest.o: pipetest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o pipetest.o pipetest.cc -pthread
mtest.o: mtest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o mtest.o mtest.cc -pthread
ptest.o: ptest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o ptest.o ptest.cc -pthread
eptest.o: eptest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o eptest.o eptest.cc -pthread
locktest.o: locktest.cc $(INCLS)
$(CXX) -c $(CXXFLAGS) -o locktest.o locktest.cc -pthread
mtest: mtest.o libthread.a
$(CXX) -g -o mtest mtest.o libthread.a -pthread
ptest: ptest.o libthread.a
$(CXX) -g -o ptest ptest.o libthread.a -pthread
eptest: eptest.o libthread.a
$(CXX) -g -o eptest eptest.o libthread.a -pthread
timertest: timertest.o libthread.a
$(CXX) -g -o timertest timertest.o libthread.a -pthread
pipetest: pipetest.o libthread.a
$(CXX) -g -o pipetest pipetest.o libthread.a -pthread
locktest: locktest.o libthread.a
$(CXX) -g -o locktest locktest.o libthread.a -pthread