make: fix linting
[majurity.git] / GNUmakefile
index 39354a3f0d5b80f38553023a100eaa1b55938ab7..b899b88cce32ae9f40d752c9b8c1280221c4b0ec 100644 (file)
@@ -3,7 +3,7 @@ PKGS := \
  hjugement-protocol
 hjugement-protocol/test: TEST_FLAGS:=
 
-HS = $(shell find . -name '*.hs' -not -name 'HLint.hs')
+HS = $(shell find $(PKGS) -name '*.hs' -not -name 'HLint.hs')
 cabal := $(shell find . -name '*.cabal' -print -quit)
 QUICKCHECK_TESTS = 1000
 QUICKCHECK_MAXSIZE = 100
@@ -87,7 +87,7 @@ doc: $(PKGS:=/doc)
 HLint.hs: $(HS)
        sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
        echo '-- BEGIN: generated hints' >> HLint.hs
-       hlint $(foreach p,$(PKGS),--find $p) | grep '^'infix | sort -u >> HLint.hs
+       hlint $(foreach p,$(PKGS),--find $p) | sed -ne 's/^- infix: \(.*\)/\1/p' | sort -u >>HLint.hs
        echo '-- END: generated hints' >> HLint.hs
 
 lint: $(PKGS:=/lint) $(HS)