File: makefile

package info (click to toggle)
dcontainers 0.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 344 kB
  • sloc: makefile: 74
file content (82 lines) | stat: -rw-r--r-- 1,979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.PHONY: test graphs clean

DC?=dmd
SRC:=$(shell find ../src/ -name "*.d")

ifeq ($(DC), ldc2)
  FLAGS:=-unittest -main -g -cov -I../src/ -d-debug -wi
  hashmap_gc_test_FLAGS:=-g -O3 -d-debug -wi
  looptest_FLAGS:=-O3
else
  FLAGS:=-unittest -main -g -cov -I../src/ -debug -wi
  hashmap_gc_test_FLAGS:=-g -inline -O -release -debug -wi
  looptest_FLAGS:=-inline -O -release
endif
FLAGS32:=$(FLAGS) -m32

all_arch:=
ifeq ($(OS), Windows_NT)
	all_arch += all_32 all_64
else
	UNAME_S := $(shell uname -s)
	ifeq ($(UNAME_S), Linux)
		all_arch += all_32 all_64
	else
		all_arch += all_64
	endif
endif

all: $(all_arch)

all_64: test compile_test external_allocator_test hashmap_gc_test
	./tests
	./compile_test
	./external_allocator_test
	./hashmap_gc_test

all_32: test_32 compile_test_32 external_allocator_test_32
	./tests_32
	./compile_test_32
	./external_allocator_test_32

test: $(SRC)
	$(DC) $(FLAGS) $(SRC) -oftests
test_32: $(SRC)
	$(DC) $(FLAGS32) $(SRC) -oftests_32

compile_test: compile_test.d $(SRC)
	$(DC) $(FLAGS) compile_test.d $(SRC) -ofcompile_test
compile_test_32: compile_test.d $(SRC)
	$(DC) $(FLAGS32) compile_test.d $(SRC) -ofcompile_test_32

external_allocator_test: external_allocator_test.d $(SRC)
	$(DC) $(FLAGS) external_allocator_test.d $(SRC) -ofexternal_allocator_test
external_allocator_test_32: external_allocator_test.d $(SRC)
	$(DC) $(FLAGS32) external_allocator_test.d $(SRC) -ofexternal_allocator_test_32

looptest: looptest.d
	$(DC) looptest.d $(looptest_FLAGS) \
		../src/memory/allocators.d \
		../src/containers/ttree.d \
		../src/containers/internal/node.d \
		-I../src/ \

hashmap_gc_test: hashmap_gc_test.d $(SRC)
	$(DC) $(hashmap_gc_test_FLAGS) \
		-I../src/ \
		$(SRC) \
		hashmap_gc_test.d \
		-ofhashmap_gc_test

clean:
	rm -f tests
	rm -f *.o
	rm -f *.dot
	rm -f *.png
	rm -f ..*.lst
	rm -f looptest

graphs: clean
	$(DC) $(FLAGS) $(SRC) -oftests -version=graphviz_debugging
	-./tests
	parallel "dot -Tpng {} > {.}.png" ::: graph*.dot