-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
67 lines (45 loc) · 1.55 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
CC=gcc
LD=gcc
BASE_NAME=httpress
###
# Library dependencies:
# - libev 4 (http://software.schmorp.de/pkg/libev.html)
LIBS=-lrt -lev -lpthread -lgnutls -lhttp_parser -lparserutils -luchardet
CFLAGS_RELEASE=-pthread -Wno-strict-aliasing -O2 -s -DWITH_SSL
CFLAGS_DEBUG=-pthread -Wno-strict-aliasing -g -DWITH_SSL
LDFLAGS_RELEASE=$(LIBS)
LDFLAGS_DEBUG=$(LIBS)
INC_MAIN=
SRC_MAIN=httpress.c
###
# List active modules here; also include them in modules.c file
INC_MODULES=
SRC_MODULES=
OBJ_DEBUG_DIR=obj/Debug
BIN_DEBUG_DIR=bin/Debug
OBJ_RELEASE_DIR=obj/Release
BIN_RELEASE_DIR=bin/Release
OBJS_RELEASE=$(patsubst %.c,$(OBJ_RELEASE_DIR)/%.o,$(SRC_MAIN)) $(patsubst %.c,$(OBJ_RELEASE_DIR)/%.o,$(SRC_MODULES))
OBJS_DEBUG=$(patsubst %.c,$(OBJ_DEBUG_DIR)/%.o,$(SRC_MAIN)) $(patsubst %.c,$(OBJ_DEBUG_DIR)/%.o,$(SRC_MODULES))
all: Release
Release: $(BIN_RELEASE_DIR) $(OBJ_RELEASE_DIR) $(BIN_RELEASE_DIR)/$(BASE_NAME)
Debug: $(BIN_DEBUG_DIR) $(OBJ_DEBUG_DIR) $(BIN_DEBUG_DIR)/$(BASE_NAME)
$(BIN_RELEASE_DIR):
mkdir -p $(BIN_RELEASE_DIR)
$(OBJ_RELEASE_DIR):
mkdir -p $(OBJ_RELEASE_DIR)
$(BIN_DEBUG_DIR):
mkdir -p $(BIN_DEBUG_DIR)
$(OBJ_DEBUG_DIR):
mkdir -p $(OBJ_DEBUG_DIR)
$(BIN_DEBUG_DIR)/$(BASE_NAME): $(OBJS_DEBUG)
$(LD) -o $@ $^ $(LDFLAGS_DEBUG)
$(OBJ_DEBUG_DIR)/%.o: %.c $(INC_MAIN) $(INC_MODULES)
$(CC) -c -o $@ $< $(CFLAGS_DEBUG)
$(BIN_RELEASE_DIR)/$(BASE_NAME): $(OBJS_RELEASE)
$(LD) -o $@ $^ $(LDFLAGS_RELEASE)
$(OBJ_RELEASE_DIR)/%.o: %.c $(INC_MAIN) $(INC_MODULES)
$(CC) -c -o $@ $< $(CFLAGS_RELEASE)
clean:
rm -rf obj/* bin/*
.PHONY: all clean Release Debug