.PHONY: sharedobj
ghci:
ghci -Wall -i:src:x86/none src/Run.hs
ghci-cpuid:
ghci -Wall -i:src:x86/cpuid src/Run.hs
testbuild:
runhaskell Setup.lhs configure --user -fbuildExamples -fbuildTools -fcpuid
runhaskell Setup.lhs build
runhaskell Setup.lhs haddock
runhaskell Setup.lhs configure --user -f-cpuid
runhaskell Setup.lhs build
llvmversion = 2.6
sharedobj: libLLVM.so
libLLVM.so: libLLVM.so.$(llvmversion)
ln -s $< $@
libLLVM.so.%:
for src in `llvm-config --libdir`/libLLVM*.a; do ar -x $$src ; done
gcc -shared -Wl,-soname,$@ -o $@ *.o
# gcc -shared -Wl,-soname,$@ -o $@ `llvm-config --libdir`/LLVM*.o *.o
rm *.o
%.s: %.bc
llc $<
# This would lead to a cycle with llvm-as.
# %.ll: %.bc
# llvm-dis -f $<
%-dis.ll: %.bc
llvm-dis -o $@ -f $<
%.bc: %.ll
llvm-as -f $<
%-opt.bc: %.bc
opt -O3 < $< > $@