-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (41 loc) · 1.33 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
CC = gcc -I ./include
CFLAGS = -std=gnu99 -Wall -g #-DDEBUG
INC = ./include
SRC = ./src
OBJ = ./obj
DOC = ./doc
BIN = ./bin
vpath %.h ./include
vpath %.c ./src
OBJ_SITE_LIST = $(OBJ)/site_list.o $(OBJ)/site_node.o
OBJ_WORD_LIST = $(OBJ)/word_list.o $(OBJ)/word_node.o $(OBJ_SITE_LIST)
OBJ_INV_LIST = $(OBJ)/inv_list.o $(OBJ_WORD_LIST)
OBJ_PY_INT = $(OBJ)/python_interface.o $(OBJ)/tcplib.o
OBJ_CRAWLER = $(OBJ)/http_interface.o $(OBJ)/stop_list_reader.o $(OBJ)/initial_page_reader.o $(OBJ)/string_ops.o $(OBJ_PY_INT) $(OBJ_INV_LIST) $(OBJ)/crawler.o
OBJ_TEST_CRAWLER = $(OBJ_CRAWLER) $(OBJ)/test_crawler.o
SERVEROBJS = $(OBJ_CRAWLER) $(OBJ)/query.o $(OBJ)/webserver.o $(OBJ)/send_eof.o
OBJ_CRAWL_PROGRAM = $(OBJ_CRAWLER) $(OBJ)/crawl_program.o
EXECS = webserver crawl_program
all: mkdirs $(EXECS)
doc:
doxygen
# build all object files
$(OBJ)/%.o: %.c
$(CC) $< $(CFLAGS) -c -o $@
mkdirs:
mkdir -p $(OBJ)
mkdir -p $(DOC)
mkdir -p $(BIN)
#test_crawler: $(OBJ_TEST_CRAWLER)
#$(CC) -o $(BIN)/$@ $(LFLAGS) $(OBJ_TEST_CRAWLER)
crawl_program: $(OBJ_CRAWL_PROGRAM)
$(CC) -o $(BIN)/$@ $(LFLAGS) $(OBJ_CRAWL_PROGRAM)
webserver: $(SERVEROBJS)
$(CC) -o $(BIN)/$@ $(SRC)/readln.c $(LFLAGS) $(SERVEROBJS)
.PHONY: clean
clean:
/bin/rm -rf $(BIN) $(OBJ) core* *~
cleanswap:
/bin/rm -f \.*swp */\.*swp
/bin/rm -f /$(SRC)/\.*swp
/bin/rm -f /$(INC)/\.*swp