summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile56
1 files changed, 15 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index bf7ea23..d7ece7f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,47 +1,21 @@
-pname := hack
-nixpkgs := ${HOME}/src/nixpkgs
-
-configureFlags := -fdevelopment
-
-.PHONY: all build clean distclean configure run
-
-all: run
+.PHONY: _default
+_default: ghci
+.PHONY: clean
clean:
- cabal clean
-
-distclean: clean
- rm -f result
- rm -fR log
-
-ifeq (${NIX_MYENV_NAME},${pname})
-
-build:
- cabal build ${pname}
-
-configure:
- cabal configure ${configureFlags}
-
-run: build
- mkdir -p log
- dist/build/${pname}/${pname}
-
-else
-#
-# setup development environment (and rerun make)
-#
-
-ifdef nixpkgs
-export NIX_PATH := nixpkgs=${nixpkgs}
-endif
+ @find * -type f \( -name \*.o -o -name \*.hi \) -exec rm -v \{\} \;
-# XXX result is a symlink we want to check
-MAKEFLAGS += -L
+.PHONY: ghci
+ghci: shell.nix
+ nix-shell --argstr compiler ghc801 --command 'exec ghci -Wall -fobject-code -isrc'
-build configure run: result
- echo make $@ | result/bin/load-env-${pname}
+.PHONY: install
+install:
+ $(error to install run "make result && nix-env -i ./result")
-result: default.nix
- nix-build $<
+.PHONY: result
+result: shell.nix
+ nix-build ./shell.nix
-endif
+shell.nix: $(wildcard *.cabal)
+ cabal2nix --shell . > $@