From f691115868f669e831f06ff28ffca25033e311d4 Mon Sep 17 00:00:00 2001 From: crumbtoo Date: Thu, 22 Feb 2024 10:51:43 -0700 Subject: [PATCH] fix hardcoded builddir --- Makefile_happysrcs | 3 ++- find-build.cl | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 find-build.cl diff --git a/Makefile_happysrcs b/Makefile_happysrcs index f4041ee..2f464a1 100644 --- a/Makefile_happysrcs +++ b/Makefile_happysrcs @@ -1,10 +1,11 @@ +GHC_VERSION = $(shell ghc --numeric-version) HAPPY = happy HAPPY_OPTS = -a -g -c -i/tmp/t.info ALEX = alex ALEX_OPTS = -g SRC = src -CABAL_BUILD = dist-newstyle/build/x86_64-osx/ghc-9.6.2/rlp-0.1.0.0/build +CABAL_BUILD = $(shell clisp find-build.cl) all: parsers lexers diff --git a/find-build.cl b/find-build.cl new file mode 100755 index 0000000..f445199 --- /dev/null +++ b/find-build.cl @@ -0,0 +1,8 @@ +#!/usr/bin/env clisp + +(let* ((paths (directory "dist-newstyle/build/*/*/rlp-*/build/")) + (n (length paths))) + (cond ((< 1 n) (error ">1 build directories found. run `cabal clean`.")) + ((< n 1) (error "no build directories found. this shouldn't happen lol")) + (t (format t "~A" (car paths))))) +