#!/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)