-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 930 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
MAKE_DIR = $(PWD)
SRC_DIR = $(MAKE_DIR)/src
LIB_DIR = $(MAKE_DIR)/libs
BUILD_DIR = $(MAKE_DIR)/build
TARGET_DIR = $(MAKE_DIR)/bin
INC_SRCH_PATH = -I$(SRC_DIR)
LIB_SRCH_PATH :=
LIB_SRCH_PATH += -L$(LIB_DIR)
CC = gcc
LIBS := -lhttp -lthpool -lcache -lpthread
CFLAGS :=
CFLAGS += $(INC_SRCH_PATH) $(LIB_SRCH_PATH)
CFLAGS += -Wall
.PHONY: all clean dir debug test
debug: CFLAGS += -g
export MAKE_DIR SRC_DIR LIB_DIR BUILD_DIR TARGET_DIR CC CFLAGS LIBS INC_SRCH_PATH
all: dir
@$(MAKE) -C src/http -f http.mk
@$(MAKE) -C src/thpool -f thpool.mk
@$(MAKE) -C src/cache -f cache.mk
@$(MAKE) -C src/root -f root.mk
debug: all
test:
@chmod -R 755 $(MAKE_DIR)/test/**/*.sh
@$(MAKE_DIR)/test/all_test.sh
dir:
@mkdir -p $(LIB_DIR)
@mkdir -p $(BUILD_DIR)
clean:
@$(MAKE) -C src/http -f http.mk clean
@$(MAKE) -C src/thpool -f thpool.mk clean
@$(MAKE) -C src/cache -f cache.mk clean
@$(MAKE) -C src/root -f root.mk clean