blob: fcdc6fa0c9ad965f7b0029234d46eb2e73bbd288 (
plain)
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
|
#!/bin/sh
CFILES = charf.c misc.h misc.c
CDEPS = $(CFILES) misc.h
CFLAGS = -lm -pthread -O3 -march=native -pipe -pedantic -Wextra#-Wall
# -lm: link math
# -pthread: use multithreading
# -O3: most aggressive optimization of binary
# -pipe: use RAM instead of disk for temporary files
# -pedantic:
# -Wextra: more warnings
all: charf_approx charf_exact charf_error
# use floating point computations
charf_approx: $(CDEPS) double.h double.c
gcc -o $@ -D MODE=0 $(CFILES) double.c $(CFLAGS)
# use floating point computations with error bounds
charf_error: $(CDEPS) double-error.h double-error.c
gcc -o $@ -D MODE=1 $(CFILES) double-error.c $(CFLAGS)
# use fractions
charf_exact: $(CDEPS) ratio.h ratio.c
gcc -o $@ -D MODE=2 $(CFILES) ratio.c $(CFLAGS)
|