X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=makefile;h=1e4072f9ffecced78de38fb4f5fd1367e044fa34;hp=0a14c0ec7c3a9a0bcfc35e03f9d71b166a42fb70;hb=b21e1c182a2e469240d2b1cbbda37f2dfeb880d9;hpb=269f52d6f8cd031692c83afaa05c389115d05bd0 diff --git a/makefile b/makefile index 0a14c0e..1e4072f 100644 --- a/makefile +++ b/makefile @@ -3,23 +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/skiplist_test output/ht_test output/txn_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 -TEST_SRCS := $(RUNTIME_SRCS) -rcu_test_SRCS := $(TEST_SRCS) -list_test_SRCS := $(TEST_SRCS) struct/list.c -#skiplist_test_SRCS := $(TEST_SRCS) struct/skiplist.c -ht_test_SRCS := $(TEST_SRCS) struct/ht.c test/ht_test.c test/CuTest.c -txn_test_SRCS := $(TEST_SRCS) struct/ht.c txn/txn.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 @@ -27,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 @@ -47,7 +47,7 @@ tags: ctags -R . ################################################################################################### -# +# ################################################################################################### clean: rm -rfv output/* @@ -61,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))