-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 713 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 713 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
CFLAGS := -fPIC -O3 -g -Wall -DLOG_LEVEL=0
CC := gcc
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
MAJOR := 1
MINOR := 0
NAME := conn_stats
VERSION := $(MAJOR).$(MINOR)
INC = -I/usr/include/x86_64-linux-gnu/curl -I.
lib: lib$(NAME).so.$(VERSION)
test: $(NAME)_test
LD_LIBRARY_PATH=. ./$(NAME)_test -n 5
$(NAME)_test: lib$(NAME).so
$(CC) test/$(NAME)_test.c -I./src -L. -l$(NAME) -lcurl -o $@
lib$(NAME).so: lib$(NAME).so.$(VERSION)
ldconfig -v -n .
ln -sf lib$(NAME).so.$(VERSION) lib$(NAME).so
lib$(NAME).so.$(VERSION): src/median.c src/connect_manager.c src/connect_manager_curl.c src/connect_statistics.c
$(CC) $(LDFLAGS) $(CFLAGS) $(INC) $^ -o $@
clean:
$(RM) $(NAME)_test *.o *.so*