Fix sim module build on MacOS arm64

This commit is contained in:
Jevin Sweval 2022-12-15 11:27:32 -05:00
parent f007f812df
commit e393f84799
4 changed files with 21 additions and 6 deletions

View File

@ -1,9 +1,15 @@
include variables.mak
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Darwin)
CFLAGS += -I/usr/local/include/
ifeq ($(UNAME_M),x86_64)
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
else
CFLAGS += -I/opt/homebrew/include
LDFLAGS += -L/opt/homebrew/lib
endif
LDFLAGS += -lpthread -ljson-c -lz -lm -lstdc++ -ldl -levent
else
CC ?= gcc

View File

@ -4,6 +4,7 @@ UNAME_S := $(shell uname -s)
include $(SRC_DIR)/modules/rules.mak
CFLAGS += -I$(TAPCFG_DIRECTORY)/src/include
LDFLAGS += -lz
OBJS = $(MOD).o tapcfg.o taplog.o
$(MOD).so: $(OBJS)

View File

@ -1,9 +1,16 @@
CC ?= gcc
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Darwin)
CFLAGS += -I/usr/local/include/
LDFLAGS += -L/usr/local/lib -ljson-c
ifeq ($(UNAME_M),x86_64)
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
else
CFLAGS += -I/opt/homebrew/include
LDFLAGS += -L/opt/homebrew/lib
endif
LDFLAGS += -ljson-c
CFLAGS += -Wall -O3 -ggdb -fPIC
else
CFLAGS += -Wall -O3 -ggdb -fPIC -Werror

View File

@ -4,6 +4,7 @@ UNAME_S := $(shell uname -s)
include $(SRC_DIR)/modules/rules.mak
CFLAGS += -I$(TAPCFG_DIRECTORY)/src/include
LDFLAGS += -lz
OBJS = $(MOD).o tapcfg.o taplog.o
$(MOD).so: $(OBJS)