Makefile 1.09 KB
Newer Older
Andy Wingo's avatar
Andy Wingo committed
1 2 3 4 5 6 7

SOURCES=$(wildcard *.S)
TARGETS=$(basename $(SOURCES))

all: $(TARGETS)

test: all
8
	@for i in $(TARGETS); do echo "Testing $$i:"; time ./$$i 40; done
Andy Wingo's avatar
Andy Wingo committed
9 10

%: %.S
11
	$(CC) -o $@ $<
Andy Wingo's avatar
Andy Wingo committed
12 13 14 15

clean:
	rm -f $(TARGETS)

Andy Wingo's avatar
Andy Wingo committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
hs-fib: fib.hs
	guix environment --ad-hoc ghc -- ghc -o hs-fib fib.hs

hs-fib-opt: fib.hs
	guix environment --ad-hoc ghc -- ghc -O -o hs-fib-opt fib.hs

gcc-fib-O0: fib.c
	guix environment --ad-hoc gcc-toolchain -- gcc -o $@ -O0 $<

gcc-fib-O1: fib.c
	guix environment --ad-hoc gcc-toolchain -- gcc -o $@ -O1 $<

gcc-fib-O3: fib.c
	guix environment --ad-hoc gcc-toolchain -- gcc -o $@ -O3 $<

clang-fib-O0: fib.c
	guix environment --ad-hoc clang -- clang -o $@ -O0 $<

clang-fib-O1: fib.c
	guix environment --ad-hoc clang -- clang -o $@ -O1 $<

clang-fib-O3: fib.c
	guix environment --ad-hoc clang -- clang -o $@ -O3 $<

chez-fib: fib.scm
	echo '(compile-file "fib.scm")' | guix environment --ad-hoc chez-scheme -- scheme -q

chez-fib2: fib2.scm
	echo '(compile-file "fib2.scm")' | guix environment --ad-hoc chez-scheme -- scheme -q


# Run as "echo '(exit)' | scheme -q fib.so"

# guile

Andy Wingo's avatar
Andy Wingo committed
51
.PHONY: test clean all