-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (43 loc) · 2.22 KB
/
makefile
File metadata and controls
61 lines (43 loc) · 2.22 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
OPT = -g3 -Og
LIB_SOURCES1 = udpc.c udp.c ssl.c service_descriptor.c udpc_utils.c udpc_stream_check.c udpc_send_file.c udpc_dir_scan.c udpc_seq.c udpc_share_log.c udpc_share_delete.c
LIB_SOURCES = $(addprefix src/, $(LIB_SOURCES1))
CC = gcc
TARGET = libudpc.so
LIB_OBJECTS =$(LIB_SOURCES:src/%.c=obj/%.o)
LDFLAGS= -L. $(OPT) -Wextra #-lmcheck #-ftlo #setrlimit on linux
LIBS= -ldl -lm -lssl -lcrypto -lpthread -liron
ALL= $(TARGET) server rpc speed file share test share_log_reader share_manager libudpc_net #web dir_scanner
CFLAGS = -Iinclude -Isrc -std=c11 -c $(OPT) -D_GNU_SOURCE -Wall -Wextra -Werror=implicit-function-declaration -Wformat=0 -fdiagnostics-color -Wextra -Werror -Wwrite-strings -fbounds-check #-DDEBUG
$(TARGET): directories $(LIB_OBJECTS)
$(CC) $(LDFLAGS) $(LIB_OBJECTS) $(LIBS) --shared -o $@
all: $(ALL)
obj/%.o : src/%.c
$(CC) $(CFLAGS) -fPIC $< -o $@ -MMD -MF $@.depends
directories:
mkdir -p obj
depend: h-depend
clean:
rm -f $(LIB_OBJECTS) $(ALL) obj/*.o.depends obj/*.o.depends
-include $(LIB_OBJECTS:.o=.o.depends)
libudpc_net: $(LIB_OBJECTS) udpc_net.o
$(CC) $(LDFLAGS) $(LIB_OBJECTS) udpc_net.o $(LIBS) -liron --shared -o libudpc_net.so
server: $(TARGET) obj/main.o
$(CC) $(LDFLAGS) $(LIBS) obj/main.o -ludpc -Wl,-rpath,. -o server
rpc: $(TARGET) udpc_get.o
$(CC) $(LDFLAGS) $(LIBS) udpc_get.o -ludpc -Wl,-rpath,. -o rpc
speed: $(TARGET) udpc_speed_test.o
$(CC) $(LDFLAGS) $(LIBS) udpc_speed_test.o -ludpc -Wl,-rpath,. -o speed
file: $(TARGET) udpc_file.o
$(CC) $(LDFLAGS) $(LIBS) udpc_file.o -ludpc -Wl,-rpath,. -o file
share: $(TARGET) udpc_share.o
$(CC) $(LDFLAGS) udpc_share.o $(LIBS) -ludpc -Wl,-rpath,. -o share
share2: $(TARGET) udpc_share2.o
$(CC) $(LDFLAGS) udpc_share2.o $(LIBS) -ludpc -Wl,-rpath,. -o share2 -lgit2
share_log_reader: $(TARGET) udpc_share_log_reader.o
$(CC) $(LDFLAGS) udpc_share_log_reader.o $(LIBS) -ludpc -Wl,-rpath,. -o share_log_reader
share_manager: $(TARGET) udpc_share_manager.o
$(CC) $(LDFLAGS) udpc_share_manager.o $(LIBS) -ludpc -Wl,-rpath,. -o share_manager
test: $(TARGET) src/udpc_test.o
$(CC) $(LDFLAGS) src/udpc_test.o $(LIBS) -ludpc -Wl,-rpath,. -o test
#web: $(TARGET) share_web.o
# $(CC) $(LDFLAGS) share_web.o $(LIBS) -lmicrohttpd -ludpc -Wl,-rpath,. -o #web