1
0

Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. PROGRAM ?= wolfcrypt
  2. # This line must be added in your freedom-e-sdk/scripts/standalone.mk
  3. # RISCV_CFLAGS += -I$(WOLFSSL_SRC_DIR) -I$(WOLFSSL_SRC_DIR)/IDE/ECLIPSE/SIFIVE -DWOLFSSL_USER_SETTINGS
  4. # WOLFSSL_SRC_DIR variable must be set in the environment when GNU make is started.
  5. # export WOLFSSL_SRC_DIR=~/freedom-e-sdk/software/wolfssl
  6. WOLFSSL_CFLAGS += -I$(WOLFSSL_SRC_DIR) \
  7. -I$(WOLFSSL_SRC_DIR)/IDE/ECLIPSE/SIFIVE \
  8. -DWOLFSSL_USER_SETTINGS
  9. SRC_FILES = $(wildcard $(WOLFSSL_SRC_DIR)/src/*.c)
  10. SRC_FILES += $(wildcard $(WOLFSSL_SRC_DIR)/wolfcrypt/src/*.c)
  11. SRC_FILES := $(filter-out %bio.c %misc.c %evp.c, $(SRC_FILES))
  12. SRC =$(WOLFSSL_SRC_DIR)/IDE/ECLIPSE/SIFIVE/main.c \
  13. $(SRC_FILES) \
  14. $(WOLFSSL_SRC_DIR)/wolfcrypt/test/test.c \
  15. $(WOLFSSL_SRC_DIR)/wolfcrypt/benchmark/benchmark.c
  16. OPT_CFLAGS = -specs=nano.specs
  17. #OPT_CFLAGS += -O3 -DTIME -DNOENUM -Wno-implicit -mexplicit-relocs -save-temps
  18. #OPT_CFLAGS += -fno-inline -fno-builtin-printf -fno-common -falign-functions=4
  19. # override the __stack_size and __heap_size default values of 0x400
  20. # SiFive HiFive1 has 16KB of data SRAM
  21. # The __stack_size and __heap_size symbols are defined in the linker metal.default.ld
  22. # script in the freedom-e-sdk.
  23. override CFLAGS += $(OPT_CFLAGS) $(WOLFSSL_CFLAGS) \
  24. -Xlinker --defsym=__stack_size=0x1200 \
  25. -Xlinker --defsym=__heap_size=0x800
  26. $(PROGRAM): $(SRC)
  27. $(CC) $(CFLAGS) $(SRC) $(LDFLAGS) $(LDLIBS) -o $@
  28. clean:
  29. rm -f $(PROGRAM) $(PROGRAM).hex