Skip to content

Patch to pandaPIparser makefile for easier compilation on Mac #10

Description

@rpgoldman

As you point out in the readme, the versions of bison and flex on the Mac are unsuitable for building pandaPIparser.

I modified the makefile to make BISON and FLEX variables, so that on the Mac one can build like this (for example):

BISON=/opt/homebrew/opt/bison/bin/bison FLEX=/opt/homebrew/opt/flex/bin/flex make -j

Here's a patch from git format-patch:


These make it easier to override the default versions of these
programs, which is particularly helpful on Mac, because the versions
there are so old.
---
 makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/makefile b/makefile
index fbb2ecd..c159ce8 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,6 @@
 CXX=g++
+BISON ?= bison
+FLEX ?= flex

 CWARN=-Wno-unused-parameter
 CERROR=
@@ -31,11 +33,11 @@ all: src/hddl-token.o src/hddl.o src/main.o src/sortexpansion.o src/parsetree.o
        ${CXX} ${COMPILEFLAGS} -o $@ -c $<

 src/hddl-token.cpp: src/hddl.cpp src/hddl-token.l
-       flex --yylineno -o src/hddl-token.cpp src/hddl-token.l
+       $(FLEX) --yylineno -o src/hddl-token.cpp src/hddl-token.l


 src/hddl.cpp: src/hddl.y
-       bison -v -d -o src/hddl.cpp src/hddl.y
+       $(BISON) -v -d -o src/hddl.cpp src/hddl.y

 src/hddl.hpp: src/hddl.cpp

--
2.40.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions