Skip to content
Browse files

Decreased the level of WTF in Makefile: now 'make tests' actually bui…

…lds and runs tests instead of just building the tests
  • Loading branch information...
1 parent e8ad5ff commit 6a5af439c5fe95f11f151f8d068b86aa4cc071a3 @valyala committed
Showing with 17 additions and 3 deletions.
  1. +17 −3 Makefile
View
20 Makefile
@@ -12,20 +12,34 @@ CPP11_CFLAGS=$(COMMON_CFLAGS) -std=c++0x -DGHEAP_CPP11
all: tests perftests ops_count_test
-tests:
+build-tests:
$(C_COMPILER) tests.c $(C_CFLAGS) $(DEBUG_CFLAGS) -o tests_c
$(CPP_COMPILER) tests.cpp $(CPP03_CFLAGS) $(DEBUG_CFLAGS) -o tests_cpp03
$(CPP_COMPILER) tests.cpp $(CPP11_CFLAGS) $(DEBUG_CFLAGS) -o tests_cpp11
-perftests:
+tests: build-tests
+ ./tests_c
+ ./tests_cpp03
+ ./tests_cpp11
+
+build-perftests:
$(C_COMPILER) perftests.c $(C_CFLAGS) $(OPT_CFLAGS) -o perftests_c
$(CPP_COMPILER) perftests.cpp $(CPP03_CFLAGS) $(OPT_CFLAGS) -o perftests_cpp03
$(CPP_COMPILER) perftests.cpp $(CPP11_CFLAGS) $(OPT_CFLAGS) -o perftests_cpp11
-ops_count_test:
+perftests:
+ ./perftests_c
+ ./perftests_cpp03
+ ./perftests_cpp11
+
+build-ops_count_test:
$(CPP_COMPILER) ops_count_test.cpp $(CPP03_CFLAGS) $(OPT_CFLAGS) -o ops_count_test_cpp03
$(CPP_COMPILER) ops_count_test.cpp $(CPP11_CFLAGS) $(OPT_CFLAGS) -o ops_count_test_cpp11
+ops_count_test:
+ ./ops_count_test_cpp03
+ ./ops_count_test_cpp11
+
clean:
rm -f ./tests_c
rm -f ./tests_cpp03

0 comments on commit 6a5af43

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