| 1 | .PHONY: check |
| 2 | check: arithmetic exceptions parallel graphite optimizers transaction |
| 3 | printf '\n' | c99 -dM -E - | grep -Fx '#define __STDC_VERSION__ 199901L' |
| 4 | printf '\n' | c89 -dM -E - >c89-macros |
| 5 | if grep -q __STDC_VERSION__ c89-macros; then exit 1; fi |
| 6 | if c89 -std=c99 -v >/dev/null 2>&1; then exit 1; fi |
| 7 | ./arithmetic |
| 8 | ./exceptions |
| 9 | ./parallel |
| 10 | ./graphite |
| 11 | ./optimizers |
| 12 | ./transaction |
| 13 | readelf -d transaction | grep -F '[libitm.so.1]' |
| 14 | grep -Eq 'number of SCoPs: [1-9]|SCoP statistics' graphite.dump |
| 15 | |
| 16 | arithmetic: arithmetic.c |
| 17 | $(CC) -std=c17 -Wall -Wextra -o $@ $< -lmpc -lmpfr -lgmp |
| 18 | |
| 19 | exceptions: exceptions.cc |
| 20 | $(CXX) -std=c++17 -Wall -Wextra -o $@ $< |
| 21 | |
| 22 | parallel: parallel.c |
| 23 | $(CC) -std=gnu17 -Wall -Wextra -fopenmp -o $@ $< -latomic |
| 24 | |
| 25 | transaction: transaction.c |
| 26 | $(CC) -std=gnu17 -Wall -Wextra -fgnu-tm -pthread -o $@ $< |
| 27 | |
| 28 | graphite.o: graphite.c |
| 29 | $(CC) -O2 -fgraphite-identity -fdump-tree-graphite-details=graphite.dump -c -o $@ $< |
| 30 | |
| 31 | graphite: optimizers.c graphite.o |
| 32 | $(CC) -O2 -o $@ $^ |
| 33 | |
| 34 | libgraphite.a: graphite.c |
| 35 | $(CC) -O2 -flto -fno-fat-lto-objects -c -o graphite-lto.o $< |
| 36 | $(AR) rcs $@ graphite-lto.o |
| 37 | gcc-ar t $@ | grep -Fx graphite-lto.o |
| 38 | gcc-ranlib $@ |
| 39 | gcc-nm --defined-only $@ | grep -E '[[:space:]]T[[:space:]]fill_rows$$' |
| 40 | |
| 41 | optimizers: optimizers.c libgraphite.a |
| 42 | $(CC) -O2 -flto -o $@ $^ |
| 43 | |