+BIN := spline3
+TMPDIR := /tmp
+
GHC_WARNINGS := -Wall
GHC_WARNINGS += -fwarn-hi-shadowing
GHC_WARNINGS += -fwarn-missing-signatures
GHC_WARNINGS += -fwarn-name-shadowing
GHC_WARNINGS += -fwarn-orphans
GHC_WARNINGS += -fwarn-type-defaults
+GHC_WARNINGS += -fwarn-tabs
+GHC_WARNINGS += -fwarn-incomplete-record-updates
+GHC_WARNINGS += -fwarn-monomorphism-restriction
+GHC_WARNINGS += -fwarn-unused-do-bind
+
+OPTIMIZATIONS := -O2
+OPTIMIZATIONS += -fexcess-precision
+OPTIMIZATIONS += -fno-spec-constr-count
+
+GHC_OPTS := $(OPTIMIZATIONS) \
+ $(GHC_WARNINGS) \
+ -odir $(TMPDIR) \
+ -hidir $(TMPDIR) \
+ --make \
+ -rtsopts \
+ -threaded \
+ -o bin/${BIN}
-BIN := spline3
.PHONY : test publish_doc doc src_html hlint
$(BIN): src/*.hs
- ghc -O2 $(GHC_WARNINGS) --make -o bin/${BIN} src/*.hs
+ ghc -fllvm $(GHC_OPTS) src/*.hs
+
+gcc: src/*.hs
+ ghc -optc-O2 -optc-march=native $(GHC_OPTS) src/*.hs
all: $(BIN) test_src
test_src: src/Tests/*.hs
- ghc -O2 $(GHC_WARNINGS) --make -o bin/${BIN} src/*.hs src/Tests/*.hs
+ ghc $(GHC_OPTS) src/*.hs src/Tests/*.hs
profile: src/*.hs
- ghc -O2 $(GHC_WARNINGS) -prof -auto-all --make -o bin/$(BIN) src/*.hs
+ ghc -fllvm $(GHC_OPTS) -prof -auto-all src/*.hs
+
+profile-gcc: src/*.hs
+ ghc -optc-O2 -optc-march=native $(GHC_OPTS) -prof -auto-all src/*.hs
clean:
rm -f bin/$(BIN)
- rm -f src/*.hi
- rm -f src/*.o
- rm -f src/Tests/*.hi
- rm -f src/Tests/*.o
+ rm -f $(TMPDIR)/*.hi
+ rm -f $(TMPDIR)/*.o
rm -f *.prof
rm -rf doc/html/*
SSH_USER=root@michael.orlitzky.com
PUBLIC_DOCDIR=/var/www/orlitzky.com/michael/public/spline3/
publish_doc: doc
- rsync -avz -e ssh $(SSH_USER):$(PUBLIC_DOCDIR) ./doc/html/
+ rsync -avz -e ssh ./doc/html/ $(SSH_USER):$(PUBLIC_DOCDIR)
hlint:
hlint --ignore="Use camelCase" \