-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
39 lines (27 loc) · 1.06 KB
/
Makefile
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
#GNU make
CXX=g++
CXXFLAGS=-std=c++17
LDLIBS=-lpthread
VPATH=header:src:tutorial
MY_LIB=../lib
obj=CThreadPool.o CThreadPoolItem.o IThreadPoolItemBase.o IThreadPoolItemExecutor.o example.o example_ret.o
obj_for_example=CThreadPool.o CThreadPoolItem.o IThreadPoolItemBase.o IThreadPoolItemExecutor.o example.o $(MY_LIB)/Scope_guard.o
obj_for_example_ret=IThreadPoolItemBase.o example_ret.o $(MY_LIB)/Scope_guard.o
all:example example_ret
example:$(obj_for_example)
$(CXX) -o $@ $^ $(LDLIBS)
example_ret:$(obj_for_example_ret)
$(CXX) -o $@ $^ $(LDLIBS)
.PHONY:clean
clean:
-rm -f example example_ret $(obj)
$(MAKE) -C $(MY_LIB) clean
CThreadPool.o:CThreadPoolItem.hpp IThreadPoolItemExecutor.hpp \
$(MY_LIB)/header/thread/CWait_bounded_queue.hpp \
$(MY_LIB)/header/thread/tag.hpp
CThreadPoolItem.o:IThreadPoolItemExecutor.hpp
IThreadPoolItemBase.o:$(MY_LIB)/header/thread/CSemaphore.hpp
IThreadPoolItemExecutor.o:$(MY_LIB)/header/thread/CSemaphore.hpp \
$(MY_LIB)/header/thread/CWait_bounded_queue.hpp
$(MY_LIB)/Scope_guard.o:
$(MAKE) -C $(MY_LIB) Scope_guard.o