makefile hlint target needs cabal_macros.h
philderbeast opened this issue · comments
Phil de Joux commented
Is there a prerequisite missing from the makefile hlint target?
Line 770 in 486adef
$ git rev-parse HEAD
486adef0b8db0d93b076f855574572b4268a1a3f
$ make hlint
make: *** No rule to make target 'dist-2.6.5-ghc-9.8.2/build/autogen/cabal_macros.h', needed by 'hlint'. Stop.
$ find -name 'cabal_macros.h'
./dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5/build/agda-mode/autogen/cabal_macros.h
./dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5/build/autogen/cabal_macros.h
./dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5/build/agda/autogen/cabal_macros.h
./dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5/build/agda-tests/autogen/cabal_macros.h
...
$ BUILD_DIR='dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5' make hlint
make: *** No rule to make target 'dist-2.6.5-ghc-9.8.2/build/autogen/cabal_macros.h', needed by 'hlint'. Stop.
$ grep "BUILD_DIR" **/*.md
grep "BUILD_DIR" **/*.mk
...
mk/paths.mk:BUILD_DIR = $(TOP)/dist-$(VERSION)-ghc-$(GHC_VER)
...
I was able to force the recipe with this change;
$ git diff
diff --git a/mk/paths.mk b/mk/paths.mk
index 6e5367b15..796b773b9 100644
--- a/mk/paths.mk
+++ b/mk/paths.mk
@@ -27,7 +27,7 @@ COMPAT_SRC_DIR = $(SRC_DIR)/compat
# Andreas, 2020-10-26 further refinement:
# I often switch GHC version, so indexing v1-style build directories
# by GHC version x.y.z makes sense.
-BUILD_DIR = $(TOP)/dist-$(VERSION)-ghc-$(GHC_VER)
+BUILD_DIR ?= $(TOP)/dist-$(VERSION)-ghc-$(GHC_VER)
QUICK_BUILD_DIR = $(BUILD_DIR)-quick
FAST_BUILD_DIR = $(BUILD_DIR)-fast
DEBUG_BUILD_DIR = $(BUILD_DIR)-debug
$ BUILD_DIR=dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5 make hlint
hlint --cpp-file=dist-newstyle/build/x86_64-linux/ghc-9.8.2/Agda-2.6.5/build/autogen/cabal_macros.h \
--cpp-include=./src/full \
--report=hlint-report.html \
./src/full/Agda
Writing report to hlint-report.html ...
No hints