Skip to content
Browse files

Use _g for the debug build

  • Loading branch information...
1 parent 7cfa645 commit 443a6ea625fa9cc3af94465257db9e728a4d0a49 @ry ry committed
Showing with 16 additions and 9 deletions.
  1. +1 −0 .gitignore
  2. +15 −9 Makefile
View
1 .gitignore
@@ -1,3 +1,4 @@
tags
*.o
test
+test_g
View
24 Makefile
@@ -2,17 +2,23 @@ OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I.
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I.
-test: test_debug
- ./test_debug
+test: test_g
+ ./test_g
-test_debug: http_parser_debug.o test.c
- gcc $(OPT_DEBUG) http_parser.o test.c -o $@
+test_g: http_parser_g.o test_g.o
+ gcc $(OPT_DEBUG) http_parser_g.o test_g.o -o $@
-http_parser_debug.o: http_parser.c http_parser.h Makefile
- gcc $(OPT_DEBUG) -c http_parser.c
+test_g.o: test.c Makefile
+ gcc $(OPT_DEBUG) -c test.c -o $@
-test-valgrind: test_debug
- valgrind ./test_debug
+test.o: test.c Makefile
+ gcc $(OPT_FAST) -c test.c -o $@
+
+http_parser_g.o: http_parser.c http_parser.h Makefile
+ gcc $(OPT_DEBUG) -c http_parser.c -o $@
+
+test-valgrind: test_g
+ valgrind ./test_g
http_parser.o: http_parser.c http_parser.h Makefile
gcc $(OPT_FAST) -c http_parser.c
@@ -28,6 +34,6 @@ tags: http_parser.c http_parser.h test.c
ctags $^
clean:
- rm -f *.o test test_fast test_debug http_parser.tar tags
+ rm -f *.o test test_fast test_g http_parser.tar tags
.PHONY: clean package test-run test-run-timed test-valgrind

0 comments on commit 443a6ea

Please sign in to comment.
Something went wrong with that request. Please try again.