| 1 | .PHONY: test graphs clean |
| 2 | |
| 3 | DC?=dmd |
| 4 | SRC:=$(shell find ../src/ -name "*.d") |
| 5 | |
| 6 | ifeq ($(DC), ldc2) |
| 7 | FLAGS:=-unittest -main -g -cov -I../src/ -d-debug -wi |
| 8 | hashmap_gc_test_FLAGS:=-g -O3 -d-debug -wi |
| 9 | looptest_FLAGS:=-O3 |
| 10 | else |
| 11 | FLAGS:=-unittest -main -g -cov -I../src/ -debug -wi |
| 12 | hashmap_gc_test_FLAGS:=-g -inline -O -release -debug -wi |
| 13 | looptest_FLAGS:=-inline -O -release |
| 14 | endif |
| 15 | FLAGS32:=$(FLAGS) -m32 |
| 16 | |
| 17 | all_arch:= |
| 18 | ifeq ($(OS), Windows_NT) |
| 19 | all_arch += all_32 all_64 |
| 20 | else |
| 21 | UNAME_S := $(shell uname -s) |
| 22 | ifeq ($(UNAME_S), Linux) |
| 23 | all_arch += all_32 all_64 |
| 24 | else |
| 25 | all_arch += all_64 |
| 26 | endif |
| 27 | endif |
| 28 | |
| 29 | all: $(all_arch) |
| 30 | |
| 31 | all_64: test compile_test external_allocator_test hashmap_gc_test |
| 32 | ./tests |
| 33 | ./compile_test |
| 34 | ./external_allocator_test |
| 35 | ./hashmap_gc_test |
| 36 | |
| 37 | all_32: test_32 compile_test_32 external_allocator_test_32 |
| 38 | ./tests_32 |
| 39 | ./compile_test_32 |
| 40 | ./external_allocator_test_32 |
| 41 | |
| 42 | test: $(SRC) |
| 43 | $(DC) $(FLAGS) $(SRC) -oftests |
| 44 | test_32: $(SRC) |
| 45 | $(DC) $(FLAGS32) $(SRC) -oftests_32 |
| 46 | |
| 47 | compile_test: compile_test.d $(SRC) |
| 48 | $(DC) $(FLAGS) compile_test.d $(SRC) -ofcompile_test |
| 49 | compile_test_32: compile_test.d $(SRC) |
| 50 | $(DC) $(FLAGS32) compile_test.d $(SRC) -ofcompile_test_32 |
| 51 | |
| 52 | external_allocator_test: external_allocator_test.d $(SRC) |
| 53 | $(DC) $(FLAGS) external_allocator_test.d $(SRC) -ofexternal_allocator_test |
| 54 | external_allocator_test_32: external_allocator_test.d $(SRC) |
| 55 | $(DC) $(FLAGS32) external_allocator_test.d $(SRC) -ofexternal_allocator_test_32 |
| 56 | |
| 57 | looptest: looptest.d |
| 58 | $(DC) looptest.d $(looptest_FLAGS) \ |
| 59 | ../src/memory/allocators.d \ |
| 60 | ../src/containers/ttree.d \ |
| 61 | ../src/containers/internal/node.d \ |
| 62 | -I../src/ \ |
| 63 | |
| 64 | hashmap_gc_test: hashmap_gc_test.d $(SRC) |
| 65 | $(DC) $(hashmap_gc_test_FLAGS) \ |
| 66 | -I../src/ \ |
| 67 | $(SRC) \ |
| 68 | hashmap_gc_test.d \ |
| 69 | -ofhashmap_gc_test |
| 70 | |
| 71 | clean: |
| 72 | rm -f tests |
| 73 | rm -f *.o |
| 74 | rm -f *.dot |
| 75 | rm -f *.png |
| 76 | rm -f ..*.lst |
| 77 | rm -f looptest |
| 78 | |
| 79 | graphs: clean |
| 80 | $(DC) $(FLAGS) $(SRC) -oftests -version=graphviz_debugging |
| 81 | -./tests |
| 82 | parallel "dot -Tpng {} > {.}.png" ::: graph*.dot |