You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB

  1. PLATFORM ?= murax
  2. LIBWRAP_CFLAGS += -Os -Wall -Wextra
  3. LIBWRAP_CFLAGS += $(GCC_RISCV_ARCHFLAGS) -fstrict-volatile-bitfields --specs=nosys.specs
  4. ifeq ($(PLATFORM),murax)
  5. LIBWRAP_CFLAGS += -DVEXRISCV_VOLATILE
  6. endif
  7. ifeq ($(PLATFORM),pqvexriscvup5k)
  8. LIBWRAP_CFLAGS += -DVEXRISCV_VOLATILE -DVEXRISCV_RWMTVEC
  9. endif
  10. ifeq ($(PLATFORM),pqvexriscvicoboard)
  11. LIBWRAP_CFLAGS += -DVEXRISCV_VOLATILE -DVEXRISCV_RWMTVEC
  12. endif
  13. ifeq ($(PLATFORM),pqvexriscvsim)
  14. LIBWRAP_CFLAGS += -DVEXRISCV_RWMTVEC
  15. endif
  16. LIBWRAP_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
  17. LIBWRAP_SRCS_C = init.c
  18. LIBWRAP_SRCS_ASM = start.s
  19. LIBWRAP_OBJS_ = $(LIBWRAP_SRCS_C:.c=.o) $(LIBWRAP_SRCS_ASM:.s=.o)
  20. LIBWRAP_OBJS = $(addprefix $(LIBWRAP_DIR)$(PLATFORM)_,$(LIBWRAP_OBJS_))
  21. LIBWRAP = lib$(PLATFORM)bsp.a
  22. $(LIBWRAP): $(LIBWRAP_OBJS)
  23. @$(ECHO) $(LIGHTBLUE)"building "$@""$(LIGHTGRAY)
  24. $(AR) rcs $@ $^
  25. $(LIBWRAP_DIR)$(PLATFORM)_%.o: $(LIBWRAP_DIR)%.c
  26. @$(ECHO) $(DARKBLUE)" "$(LIBWRAP_DIR)" "$(LIGHTGRAY)
  27. @$(ECHO) $(DARKBLUE)"building "$@" (.c)"$(LIGHTGRAY)
  28. $(GCC) $(LIBWRAP_CFLAGS) -c -o $@ $<
  29. $(LIBWRAP_DIR)$(PLATFORM)_%.o: $(LIBWRAP_DIR)%.S
  30. @$(ECHO) $(DARKBLUE)"building "$@" (.S)"$(LIGHTGRAY)
  31. $(GCC) $(LIBWRAP_CFLAGS) -c -o $@ $<