-
Notifications
You must be signed in to change notification settings - Fork 343
/
Makefile
49 lines (40 loc) · 970 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CFLAGS = -O2 -g -std=c99 -Wall -Wextra -Werror -I include
LDFLAGS = -lsqlite3
ifeq ($(OS),Windows_NT)
LDFLAGS += -lws2_32
endif
# strtok_r is provided by POSIX.1c-1995 and POSIX.1i-1995, however, with
# the POSIX_C_SOURCE=1 on Mac OS X is corresponding to the version of
# 1988 which is too old (defined in sys/cdefs.h)
CFLAGS += -D_POSIX_C_SOURCE=199506L
OUT = bin
EXEC = $(OUT)/facebooc
OBJS = \
src/kv.o \
src/response.o \
src/template.o \
src/main.o \
src/bs.o \
src/request.o \
src/list.o \
src/models/like.o \
src/models/account.o \
src/models/connection.o \
src/models/session.o \
src/models/post.o \
src/server.o
deps := $(OBJS:%.o=%.o.d)
src/%.o: src/%.c
$(CC) $(CFLAGS) -o $@ -MMD -MF $@.d -c $<
$(EXEC): $(OBJS)
mkdir -p $(OUT)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
all: $(EXEC)
run: $(EXEC)
@echo "Starting Facebooc service..."
@./$(EXEC) $(port)
clean:
$(RM) $(OBJS) $(EXEC) $(deps)
distclean: clean
$(RM) db.sqlite3
-include $(deps)