forked from nodejs/http-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (27 loc) · 1018 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
OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I.
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I.
CC?=gcc
CCFLAGS?=-fsigned-char
test: test_g
./test_g
test_g: http_parser_g.o test_g.o
$(CC) $(CCFLAGS) $(OPT_DEBUG) http_parser_g.o test_g.o -o $@
test_g.o: test.c http_parser.h Makefile
$(CC) $(CCFLAGS) $(OPT_DEBUG) -c test.c -o $@
test.o: test.c http_parser.h Makefile
$(CC) $(CCFLAGS) $(OPT_FAST) -c test.c -o $@
http_parser_g.o: http_parser.c http_parser.h Makefile
$(CC) $(CCFLAGS) $(OPT_DEBUG) -c http_parser.c -o $@
test-valgrind: test_g
valgrind ./test_g
http_parser.o: http_parser.c http_parser.h Makefile
$(CC) $(CCFLAGS) $(OPT_FAST) -c http_parser.c
test_fast: http_parser.o test.c http_parser.h
$(CC) $(CCFLAGS) $(OPT_FAST) http_parser.o test.c -o $@
test-run-timed: test_fast
while(true) do time ./test_fast > /dev/null; done
tags: http_parser.c http_parser.h test.c
ctags $^
clean:
rm -f *.o test test_fast test_g http_parser.tar tags
.PHONY: clean package test-run test-run-timed test-valgrind