Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ objects ?= $(sources:.c=.o)
ivc_demo_object ?= ivc_demo.o
rpmsg_demo_object ?= rpmsg_demo.o
hvisor_objects ?= $(filter-out $(ivc_demo_object) $(rpmsg_demo_object), $(objects))
ROOT ?= /
ROOT ?=
# gnu or musl
LIBC ?= gnu

Expand Down Expand Up @@ -31,15 +31,21 @@ else
toolchain := $(CCARCH)-linux-$(LIBC)
endif

CFLAGS := -Wall -Wextra -DLOG_USE_COLOR -DHLOG=$(LOG) --sysroot=$(ROOT)
CFLAGS := -Wall -Wextra -DLOG_USE_COLOR -DHLOG=$(LOG) -pthread

# Conditionally add sysroot if ROOT is set
# Otherwise use default flags from cross-compiler
ifneq ($(ROOT),)
CFLAGS += --sysroot=$(ROOT)
endif

include_dirs := -I../include -I./include -I../cJSON

ifeq ($(LIBC), musl)
include_dirs += -I./compat/
endif

LDFLAGS := -lpthread
LDFLAGS := -lpthread -static

# LIBS := -L$(ROOT)/usr/lib/$(toolchain) -L$(ROOT)/lib
# LIBS := -L/opt/aarch64-linux-musl-cross/aarch64-linux-musl -L/opt/aarch64-linux-musl-cross/lib
Expand Down