Fix mac build more generically and cleaner.
This commit is contained in:
@@ -12,7 +12,7 @@ CFLAGS = -g -o elf_to_hex elf_to_hex.c -lelf
|
||||
|
||||
ifeq ($(uname_S), Darwin)
|
||||
CC = clang++
|
||||
APPLE_FLAGS = -I /opt/homebrew/lib -I /opt/homebrew/Cellar/libelf/0.8.13_1/include/
|
||||
APPLE_FLAGS = -L /opt/homebrew/lib -I /opt/homebrew/include/libelf -I /opt/homebrew/include
|
||||
endif
|
||||
|
||||
elf_to_hex: elf_to_hex.c
|
||||
@@ -26,4 +26,4 @@ clean:
|
||||
|
||||
.PHONY: full_clean
|
||||
full_clean:
|
||||
rm -f *~ elf_to_hex
|
||||
rm -f *~ elf_to_hex
|
||||
|
||||
@@ -43,15 +43,12 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <gelf.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <libelf/gelf.h>
|
||||
#include <vector>
|
||||
#else
|
||||
#include <gelf.h>
|
||||
#endif
|
||||
|
||||
|
||||
// ================================================================
|
||||
// Memory buffer into which we load the ELF file before
|
||||
// writing it back out to the output file.
|
||||
|
||||
Reference in New Issue
Block a user