From cba55fb3b19b1b8fd8a786ddb569e4a6866e1e63 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 6 Aug 2017 22:06:11 +0200 Subject: Makefile: simplify --- Makefile | 56 +++++++++++++++----------------------------------------- 1 file 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 . > $@ -- cgit v1.2.3