-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (20 loc) · 700 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (20 loc) · 700 Bytes
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
all:lib/libnet.a examples
LIBNET_OBJS:=$(patsubst %.cpp, %.o, $(wildcard src/*.cpp))
$(shell mkdir -p lib)
lib/libnet.a:${LIBNET_OBJS}
ar rcs $@ $^
examples:bin/echo/client bin/echo/server bin/http/httptest
bin/echo/client:examples/echo/client.o lib/libnet.a
@mkdir -p bin/echo
g++ -o $@ $< -L ./lib -lnet -pthread
bin/echo/server:examples/echo/server.o lib/libnet.a
@mkdir -p bin/echo
g++ -o $@ $< -L ./lib -lnet -pthread
bin/http/httptest:examples/http/httptest.o lib/libnet.a
@mkdir -p bin/http
g++ -o $@ $< -L ./lib -lnet -pthread
%.o:%.cpp
g++ -c -o $@ $< -std=c++0x -I ./include -I ./include
.PHONY:clean
clean:
rm src/*.o examples/echo/*.o examples/http/*.o ./lib ./bin -rf