-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (32 loc) · 1.2 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
.PHONY: default
default:
@mkdir -p build/include
@cp src/coroutine.h build/include
@cd build && cmake .. && make
release: default
@mkdir -p output/coroutine/lib
@cp build/include/coroutine.h output/coroutine
@cp build/lib/libcoroutine.a output/coroutine/lib
test:
@cd third && tar xzf googletest.tar.gz
@mkdir -p third/googletest/build
@cd third/googletest/build && cmake .. && make
@mkdir -p utest/build/include
@if [ ! -d "$(shell pwd)/utest/build/include/coroutine" ]; then \
ln -s $(shell pwd)/src $(shell pwd)/utest/build/include/coroutine; \
fi
@cd utest/build && cmake .. && make
@./utest/build/bin/coroutine_test
@cd utest && sh ./coverage.sh
clean:
@if [ -d "build" ]; then rm -rf build; fi
@if [ -d "output" ]; then rm -rf output; fi
@cd third && if [ -d "googletest" ]; then rm -rf googletest; fi
@cd utest && if [ -d "build" ]; then rm -rf build; fi
uninstall:
@cd /usr/local/include && if [ -d "coroutine" ]; then rm -rf coroutine; fi
@cd /usr/local/lib && if [ -f "libcoroutine.a" ]; then rm libcoroutine.a; fi
install:
@mkdir -p /usr/local/include/coroutine
@cp build/include/coroutine.h /usr/local/include/coroutine
@cp build/lib/libcoroutine.a /usr/local/lib/libcoroutine.a