diff options
author | tv <tv@krebsco.de> | 2017-08-06 22:06:11 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-08-06 22:08:10 +0200 |
commit | cba55fb3b19b1b8fd8a786ddb569e4a6866e1e63 (patch) | |
tree | ff26a5dc440764d6cffcc2362b871f47f060409f /Makefile | |
parent | caacaaa7fd18eaca30d8e8e7f43b00ca4ec5f51e (diff) |
Makefile: simplify
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 56 |
1 files changed, 15 insertions, 41 deletions
@@ -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 . > $@ |