-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
28 lines (21 loc) · 875 Bytes
/
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
CFLAGS=-Werror -Wno-format-truncation -Wno-missing-field-initializers -Wextra -Wall -O0 -g3
INCLUDES=-pthread -I./include/ `pkg-config --cflags libpq`
LIBS=-l38moths -lcurl -lm -lrt `pkg-config --libs libpq`
NAME=mzbh_server
COMMON_OBJ=benchmark.o blue_midnight_wish.o http.o models.o db.o parson.o utils.o
all: bin downloader test $(NAME)
clean:
rm -f *.o
rm -f downloader
rm -f unit_test
rm -f $(NAME)
test: unit_test
unit_test: $(COMMON_OBJ) server.o stack.o parse.o utests.o
$(CC) $(CLAGS) $(LIB_INCLUDES) $(INCLUDES) -o unit_test $^ $(LIBS)
%.o: ./src/%.c
$(CC) $(CFLAGS) $(LIB_INCLUDES) $(INCLUDES) -c $<
bin: $(NAME)
$(NAME): $(COMMON_OBJ) server.o main.o parson.o
$(CC) $(CLAGS) $(LIB_INCLUDES) $(INCLUDES) -o $(NAME) $^ $(LIBS)
downloader: $(COMMON_OBJ) parse.o stack.o downloader.o
$(CC) $(CLAGS) $(LIB_INCLUDES) $(INCLUDES) -o downloader $^ $(LIBS)