Skip to content

Commit

Permalink
target: Add dependency of apps on libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Nov 8, 2023
1 parent f20ace0 commit 552121d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions target/snitch_cluster/sw/apps/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ INCDIRS += $(ROOT)/sw/blas
INCDIRS += $(ROOT)/sw/deps/riscv-opcodes
INCDIRS += $(ROOT)/sw/math/include

LIBS = $(MATH_DIR)/build/libmath.a
LIBS += $(RUNTIME_DIR)/build/libsnRuntime.a

LIBDIRS = $(dir $(LIBS))
LIBNAMES = $(patsubst lib%,%,$(notdir $(basename $(LIBS))))

RISCV_LDFLAGS += -L$(abspath $(RUNTIME_DIR))
RISCV_LDFLAGS += -T$(abspath $(SNRT_DIR)/base.ld)
RISCV_LDFLAGS += -L$(abspath $(RUNTIME_DIR)/build/)
RISCV_LDFLAGS += -L$(abspath $(MATH_DIR)/build/)
RISCV_LDFLAGS += -lmath
RISCV_LDFLAGS += -lsnRuntime
RISCV_LDFLAGS += $(addprefix -L,$(LIBDIRS))
RISCV_LDFLAGS += $(addprefix -l,$(LIBNAMES))

###########
# Outputs #
Expand Down Expand Up @@ -75,7 +79,7 @@ $(BUILDDIR):
$(DEP): $(SRCS) | $(BUILDDIR)
$(RISCV_CC) $(RISCV_CFLAGS) -MM -MT '$(ELF)' $< > $@

$(ELF): $(SRCS) $(DEP) | $(BUILDDIR)
$(ELF): $(SRCS) $(DEP) $(LIBS) | $(BUILDDIR)
$(RISCV_CC) $(RISCV_CFLAGS) $(RISCV_LDFLAGS) $(SRCS) -o $@

$(DUMP): $(ELF) | $(BUILDDIR)
Expand Down

0 comments on commit 552121d

Please sign in to comment.