vinix-ports / tests / toolchain / Makefile
39 lines · 31 sloc · 1.15 KB · e9d38658eac1f6ccabeafd3cc560020b098402c7
Raw
1.PHONY: check
2check: 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
16arithmetic: arithmetic.c
17 $(CC) -std=c17 -Wall -Wextra -o $@ $< -lmpc -lmpfr -lgmp
18
19exceptions: exceptions.cc
20 $(CXX) -std=c++17 -Wall -Wextra -o $@ $<
21
22parallel: parallel.c
23 $(CC) -std=gnu17 -Wall -Wextra -fopenmp -o $@ $< -latomic
24
25transaction: transaction.c
26 $(CC) -std=gnu17 -Wall -Wextra -fgnu-tm -pthread -o $@ $<
27
28graphite.o: graphite.c
29 $(CC) -O2 -fgraphite-identity -fdump-tree-graphite-details=graphite.dump -c -o $@ $<
30
31graphite: optimizers.c graphite.o
32 $(CC) -O2 -o $@ $^
33
34libgraphite.a: graphite.c
35 $(CC) -O2 -flto -fno-fat-lto-objects -c -o graphite-lto.o $<
36 $(AR) rcs $@ graphite-lto.o
37
38optimizers: optimizers.c libgraphite.a
39 $(CC) -O2 -flto -o $@ $^
40