]> pd.if.org Git - nbds/blobdiff - makefile
separate tests out into their own files
[nbds] / makefile
index 1e4c1ec19a698680f3b6f0acfb1433d9ea0246ec..1e4072f9ffecced78de38fb4f5fd1367e044fa34 100644 (file)
--- a/makefile
+++ b/makefile
@@ -3,20 +3,23 @@
 # http://creativecommons.org/licenses/publicdomain
 #
 ###################################################################################################
-# Makefile for building programs with whole-program interfile optimization 
+# Makefile for building programs with whole-program interfile optimization
 ###################################################################################################
-OPT       := -fwhole-program -combine -03 #-DNDEBUG
-CFLAGS := -g -Wall -Werror -std=c99 -m64 -fnested-functions $(OPT) #-DENABLE_TRACE 
+OPT       := -fwhole-program -combine -03-DNDEBUG
+CFLAGS := -g -Wall -Werror -std=c99 -m64 -fnested-functions $(OPT)# -DENABLE_TRACE
 INCS   := $(addprefix -I, include)
-TESTS  := output/rcu_test output/list_test output/ht_test
+TESTS  := output/ll_test output/sl_test output/ht_test output/rcu_test
 EXES   := $(TESTS)
 
-RUNTIME_SRCS   := runtime/runtime.c runtime/rcu.c runtime/lwt.c runtime/mem.c runtime/CuTest.c
-rcu_test_SRCS  := $(RUNTIME_SRCS)
-list_test_SRCS := $(RUNTIME_SRCS) struct/list.c
-ht_test_SRCS   := $(RUNTIME_SRCS) struct/ht.c struct/ht_test.c
+RUNTIME_SRCS  := runtime/runtime.c runtime/rcu.c runtime/lwt.c runtime/mem.c
+TEST_SRCS     := $(RUNTIME_SRCS)
+rcu_test_SRCS := $(TEST_SRCS) test/rcu_test.c
+txn_test_SRCS := $(TEST_SRCS) struct/hashtable.c txn/txn.c
+ll_test_SRCS  := $(TEST_SRCS) struct/list.c test/ll_test.c
+sl_test_SRCS  := $(TEST_SRCS) struct/skiplist.c test/sl_test.c
+ht_test_SRCS  := $(TEST_SRCS) struct/hashtable.c test/ht_test.c test/CuTest.c
 
-tests: $(TESTS) 
+tests: $(TESTS)
 
 ###################################################################################################
 # Run the tests
@@ -24,18 +27,18 @@ tests: $(TESTS)
 test: $(addsuffix .log, $(TESTS))
        @echo > /dev/null
 
-$(addsuffix .log, $(TESTS)) : %.log : % 
+$(addsuffix .log, $(TESTS)) : %.log : %
        @echo "Running $*" && $* | tee $*.log
 
 ###################################################################################################
-# Rebuild an executable if any of it's source files need to be recompiled 
+# Rebuild an executable if any of it's source files need to be recompiled
 #
-# Note: Calculating dependancies as a side-effect of compilation is disabled. There is a bug in 
+# Note: Calculating dependancies as a side-effect of compilation is disabled. There is a bug in
 #              gcc. Compilation fails when -MM -MF is used and there is more than one source file.
 #              -MM -MT $@.d -MF $@.d
 ###################################################################################################
 $(EXES): output/% : output/%.d makefile
-       gcc $(CFLAGS) $(INCS) -DMAKE_$* -o $@ $($*_SRCS)
+       gcc $(CFLAGS) $(INCS) -o $@ $($*_SRCS)
 
 ###################################################################################################
 # Build tags file for vi
@@ -44,7 +47,7 @@ tags:
        ctags -R .
 
 ###################################################################################################
-# 
+#
 ###################################################################################################
 clean:
        rm -rfv output/*
@@ -58,6 +61,6 @@ clean:
 #              -MM is used with -combine.
 ###################################################################################################
 $(addsuffix .d, $(EXES)) : output/%.d :
-       gcc $(CFLAGS:-combine:) $(INCS) -DMAKE_$* -MM -MT $@ $($*_SRCS) > $@
+       gcc $(CFLAGS:-combine:) $(INCS) -MM -MT $@ $($*_SRCS) > $@
 
 -include $(addsuffix .d, $(EXES))