diff --git a/source/BNFC.cabal b/source/BNFC.cabal index c5397e26..7fa96005 100644 --- a/source/BNFC.cabal +++ b/source/BNFC.cabal @@ -155,6 +155,14 @@ library -- BNFC.Lex -- -- Generated by happy -- BNFC.Par + -- 2023-11-03 We cannot add BNFC.{Lex,Par} as then the Lex.x and Par.y files + -- are not bundled by cabal dist. + -- Just make sure that there is no src/BNFC/{Lex,Par}.hs before running cabal sdist, + -- otherwise we will end up with both Lex.hs and Lex.x (resp. Par.{hs,y}) + -- which will cause alex/happy to not be run, leading to build failures. + autogen-modules: + -- Generated by cabal + Paths_BNFC other-modules: -- Generated by cabal Paths_BNFC diff --git a/source/Makefile b/source/Makefile index 4c3ae3bb..229f2a2c 100644 --- a/source/Makefile +++ b/source/Makefile @@ -62,6 +62,15 @@ TAGS : # Binary package (tgz, for linux) bdist: dist/${BDIST_TAG}.tar.gz +# Source package +# Andreas, 2023-11-03, PR #466: need to remove BNFC/{Lex,Par}.hs, +# otherwise they will be shipped in the sdist package +# and cause compilation to fail. +sdist: + make -C src clean + cabal sdist + +# OLD goal dist/%.tar.gz: cabal v1-clean cabal v1-install ${CABAL_OPTS} --only-dependencies diff --git a/source/src/Makefile b/source/src/Makefile index 043c2427..0ffaa63d 100644 --- a/source/src/Makefile +++ b/source/src/Makefile @@ -62,4 +62,8 @@ fake-cabal : rm-fake-cabal : rm inferior-haskell-find-project-root.cabal +.PHONY: clean +clean : + rm BNFC/Lex.hs BNFC/Par.hs BNFC/*.bak + #EOF