diff options
author | tv <tv@krebsco.de> | 2017-05-09 20:25:33 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-05-09 21:05:57 +0200 |
commit | d6718ef28ee2ad12e1e2943c1f0beb1d0820ba6b (patch) | |
tree | 76510f989917e795de6925bf5ca10ce2b9645e78 /Makefile |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bad1a64 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +define newline + + +endef + +shell-quote = '$(subst $(newline),'\$(newline)',$(subst ','\'',$(1)))' + + +ifdef nixpkgs + override nixpkgs := $(call shell-quote,$(nixpkgs)) +else + nixpkgs = 'import <stockholm>' +endif + +.PHONY: _default +_default: ghci + +.PHONY: ghci +ghci: shell.nix + nix-shell --arg nixpkgs $(nixpkgs) --command 'exec ghci -Wall' $< + +.PHONY: result +result: shell.nix + nix-build --arg nixpkgs $(nixpkgs) $< + +shell.nix: $(wildcard *.cabal) + cabal2nix --shell . > $@ + +.PHONY: update +update: + git -C .hstool fetch origin + git -C .hstool reset --hard origin/master + git -C .hstool clean -dfx |