source: doc/theses/mike_brooks_MMath/programs/ar-bchk/Makefile

Last change on this file was eb0d9b7, checked in by Michael Brooks <mlbrooks@…>, 6 days ago

Improve libcfa-array's bound-check removal and write that thesis section.

The libcfa change adds a more performant alternative for a subset of multidimensional indexing cases that were already functionally correct.
That the new alternative is more performant is not shown in the test suite.
There is an associated new high-performance option for passing an array-or-slice to a function.
The added test cases cover those options.

The added in-thesis demos rely on the new more-performant alternative for multidimensional indexing.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1CFA?=cfa
2
3DEMOS?=control treatment
4LANGS?=cfa c cc
5
6CFLAGS=-O3 #-DNDEBUG
7
8SOURCES=$(foreach demo,$(DEMOS),$(foreach lang,$(LANGS),$(demo).$(lang)))
9TGT_SLUGS=$(call BOUND_ALTS,$(SOURCES))
10EXES=$(addsuffix .runme,$(TGT_SLUGS))
11ASMS=$(addsuffix .s,$(TGT_SLUGS))
12TGTS=$(EXES) $(ASMS)
13define BOUND_ALTS
14$(1) $(addsuffix .unsound,$(1))
15endef
16define COMPILER_FOR
17$(strip
18 $(if $(findstring .cfa,$(1)),$(CFA),
19 $(if $(findstring .cc,$(1)),$(CXX),
20 $(if $(findstring .c,$(1)),$(CC),
21 unknown$(1)))))
22endef
23
24
25.SUFFIXES: # disable make built-in rules, notably `% : %.s`, which introduces circularity
26.SECONDEXPANSION: # evaluate prereq dynamically
27
28all: $(TGTS)
29exes: $(EXES)
30asms: $(ASMS)
31
32.PHONY: all exes asms echo_% clean
33
34$(TGTS): tgt_slug=$(basename $@)
35$(TGTS): unsound_flag=$(if $(findstring .unsound,$(tgt_slug)),-DUNSOUND_BOUND)
36$(TGTS): source=$(subst .unsound,,$(tgt_slug))
37$(TGTS): compiler=$(call COMPILER_FOR,$(suffix $(source)))
38
39$(EXES): out_type_flag=-DRUNIT
40$(ASMS): out_type_flag=-S
41
42$(TGTS): Makefile
43$(TGTS): $$(source)
44 $(compiler) $< $(unsound_flag) $(out_type_flag) $(CFLAGS) -MMD -MF $@.d -o $@
45
46echo_%:
47 @echo '$($(@:echo_%=%))'
48
49clean:
50 rm -f *.s *.runme *.d
51
52-include *.d
Note: See TracBrowser for help on using the repository browser.