Skip to content

Commit

Permalink
Fix make build for loc-elf-id-decoder on Mac/OSX.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Gurajada committed May 2, 2024
1 parent 9942cec commit f755427
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
with:
python-version: "3.10"

#! RESOLVE: Need this on Mac/OSX: brew install libelf

#! - name: configure
#! run: ./configure

Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ else
$(error Unknown BUILD_VERBOSE mode "$(BUILD_VERBOSE)". Valid values are "0" or "1". Default is "0")
endif

# Identify the OS we are running on.
UNAME_S := $(shell uname -s)
UNAME_P := $(shell uname -p)

# Compilers to use
CC ?= gcc
CXX ?= g++
Expand Down Expand Up @@ -332,6 +336,11 @@ INCLUDE := -I ./$(UNIT_INCDIR)
INCLUDE += -I ./$(dir $<)
INCLUDE += -I ./$(INCDIR)

# So that we can find libelf.h while compiling loc-elf-id-decoder
ifeq ($(UNAME_S),Darwin)
INCLUDE += -I /usr/local/include/libelf
endif

# use += here, so that extra flags can be provided via the environment

CFLAGS += -D_GNU_SOURCE -ggdb3 -Wall -Wfatal-errors -Werror
Expand Down

0 comments on commit f755427

Please sign in to comment.