Updater RAM Code
* Add Fatfs for reading from SD card * Add structure of Hex parser
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
RAM_CODE_TARGET = updater-ram-code
|
||||
target = $(RAM_CODE_TARGET)
|
||||
OBJDIR = obj
|
||||
CFILES = main.c startup.c
|
||||
CFILES = main.c startup.c hex-parser.c
|
||||
CFILES += fatfs/ff.c fatfs/diskio.c fatfs/ffsystem.c fatfs/ffunicode.c fatfs/shimatta_sdio_driver/shimatta_sdio.c
|
||||
LINKER_SCRIPT = ram-link.ld
|
||||
MAPFILE = $(RAM_CODE_TARGET)
|
||||
PREFIX = arm-none-eabi-
|
||||
@@ -29,9 +31,9 @@ CFLAGS += -Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitia
|
||||
|
||||
OBJ = $(CFILES:%.c=$(OBJDIR)/%.c.o)
|
||||
|
||||
default: $(RAM_CODE_TARGET).bin.c
|
||||
default: $(RAM_CODE_TARGET).bin.h
|
||||
|
||||
all: $(RAM_CODE_TARGET).bin.c
|
||||
all: $(RAM_CODE_TARGET).bin.h
|
||||
|
||||
%.bin.h: %.bin
|
||||
@echo "[BIN2H] $@"
|
||||
@@ -52,11 +54,29 @@ $(OBJ):
|
||||
@mkdir -p $(OUTPATH)
|
||||
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.c.o=%.c)
|
||||
|
||||
.PHONY: clean
|
||||
.PHONY: clean qtproject
|
||||
|
||||
clean:
|
||||
@echo [CLEAN]
|
||||
$(QUIET)rm -f $(OBJ) $(MAPFILE).map $(CFILES:%.c=$(OBJDIR)/%.c.d) $(RAM_CODE_TARGET).bin $(RAM_CODE_TARGET).elf $(RAM_CODE_TARGET).bin.c
|
||||
|
||||
qtproject:
|
||||
$(QUIET)rm -f $(target).files $(target).cflags $(target).config $(target).creator $(target).includes $(target).creator.user
|
||||
@echo "Generating source file list"
|
||||
$(QUIET)echo "$(CFILES)" | tr ' ' '\n' > $(target).files
|
||||
@echo -n "Appending found header files from folders "
|
||||
@echo `echo $(INCLUDEPATH) | sed "s/-I//g"`
|
||||
$(QUIET)for dir in `echo $(INCLUDEPATH) | sed "s/-I//g"`; do \
|
||||
find `echo "$${dir}"` -name "*.h" >> $(target).files; \
|
||||
done
|
||||
@echo "Generating $(target).cflags"
|
||||
$(QUIET)echo "" > $(target).cflags
|
||||
@echo "Generating $(target).includes"
|
||||
$(QUIET)echo $(INCLUDEPATH) | sed "s/-I/,/g" | tr , '\n' | sed "/^$$/d" > $(target).includes;
|
||||
@echo "Generating $(target).config"
|
||||
$(QUIET)echo $(DEFINES) | sed "s/-D/,#define /g" | tr , '\n' | sed "/^$$/d" > $(target).config
|
||||
@echo "Generating $(target).creator"
|
||||
$(QUIET)echo "[GENERAL]" > $(target).creator
|
||||
|
||||
-include $(CFILES:%.c=$(OBJDIR)/%.c.d)
|
||||
|
||||
|
Reference in New Issue
Block a user