diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-09-04 18:37:42 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-09-04 18:37:42 +0200 |
commit | fc98d3809e0db36d634f290417b9152f87f83e3e (patch) | |
tree | d7c0cbb883571dccfcd4028d8b7b2a2144fc2d2b /fw/fe310/phone/Makefile | |
parent | 07e6abe5d5a1813298805bea2bf9d62ad895aaaa (diff) |
new phone firmware
Diffstat (limited to 'fw/fe310/phone/Makefile')
-rw-r--r-- | fw/fe310/phone/Makefile | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/fw/fe310/phone/Makefile b/fw/fe310/phone/Makefile new file mode 100644 index 0000000..8624962 --- /dev/null +++ b/fw/fe310/phone/Makefile @@ -0,0 +1,32 @@ +include ../common.mk +DEPS = main.o mem.o wifi.o cell.o phone.o modem.o timer.o test.o + +lib_eos = eve eos eos-soc eos-dev eos-net eos-ext eos-bsp +lib_ecp = + +CFLAGS += -I$(bsp_dir)/include -I$(bsp_dir)/drivers -I$(ext_dir)/crypto -I$(ext_dir)/fsfat -I$(ecp_dir)/src -I$(ecp_dir)/src/platform/fe310 -I.. +LDFLAGS = app/*.o $(CFLAGS) -L.. -L$(ecp_dir)/build-fe310 -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc $(addprefix -l,$(lib_eos)) $(addprefix -l,$(lib_ecp)) -Wl,--end-group -T../bsp/default.lds +TARGET = phone + + +all: $(TARGET) + +app_: + (cd app && $(MAKE)) || exit; + +%.o: %.c + $(CC) $(CFLAGS) -c $< + +$(TARGET): app_ $(DEPS) + $(CC) $(DEPS) $(LDFLAGS) -o $@ + +clean: + (cd app && $(MAKE) clean) || exit; + rm -f *.o *.a $(TARGET) $(TARGET).bin + +upload: $(TARGET) + ../bsp/upload --elf ./$(TARGET) --openocd $(RISCV_OPENOCD_HOME)/bin/openocd --gdb $(RISCV_HOME)/bin/riscv64-unknown-elf-gdb --openocd-config ../bsp/openocd_jlink.cfg + +upload_jlink: $(TARGET) + $(OBJCOPY) $(TARGET) -O binary $(TARGET).bin + ../bsp/upload --bin ./$(TARGET).bin --addr 0x20000000 --jlink JLinkExe |