Compare commits

..

No commits in common. "master" and "v2.2" have entirely different histories.
master ... v2.2

View File

@ -1,5 +1,5 @@
################################Shimatta Makefile#################################### ################################Shimatta Makefile####################################
#CPU: STM32F030F4P6 #CPU: STM32F030
#Compiler: arm-none-eabi #Compiler: arm-none-eabi
##################################################################################### #####################################################################################
@ -31,11 +31,10 @@ mapfile = memmap
################################################################################### ###################################################################################
CROSS_COMPILE ?= arm-none-eabi- CC=arm-none-eabi-gcc
CC := $(CROSS_COMPILE)gcc OBJCOPY=arm-none-eabi-objcopy
OBJCOPY := $(CROSS_COMPILE)objcopy OBJDUMP=arm-none-eabi-objdump
OBJDUMP := $(CROSS_COMPILE)objdump SIZE=arm-none-eabi-size
SIZE := $(CROSS_COMPILE)size
LFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m0 -mthumb-interwork LFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m0 -mthumb-interwork
LFLAGS += -mfloat-abi=soft --disable-newlib-supplied-syscalls -nostartfiles LFLAGS += -mfloat-abi=soft --disable-newlib-supplied-syscalls -nostartfiles
@ -51,6 +50,8 @@ ASOBJ = $(ASFILES:%.S=$(OBJDIR)/%.S.o)
default: $(target).elf default: $(target).elf
binary: $(target).bin $(target).hex
%.bin: %.elf %.bin: %.elf
$(OBJCOPY) -O binary $^ $@ $(OBJCOPY) -O binary $^ $@
%.hex: %.elf %.hex: %.elf
@ -64,16 +65,18 @@ $(target).elf: $(OBJ) $(ASOBJ)
#Compiling #Compiling
$(OBJ): $(OBJ):
@echo [CC] $@ @echo Compiling $@
@mkdir -p $(@D) $(eval OUTPATH=$(dir $@))
@mkdir -p $(OUTPATH)
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.c.o=%.c) $(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.c.o=%.c)
$(ASOBJ): $(ASOBJ):
@echo [AS] $@ @echo Compiling $@
@mkdir -p $(@D) $(eval OUTPATH=$(dir $@))
@mkdir -p $(OUTPATH)
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.S.o=%.S) $(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.S.o=%.S)
.PHONY: clean mrproper objcopy disassemble binary .PHONY: qtproject clean mrproper objcopy disassemble
disassemble: $(target).elf disassemble: $(target).elf
$(OBJDUMP) -D -s $< > $(target).lss $(OBJDUMP) -D -s $< > $(target).lss
@ -83,12 +86,19 @@ objcopy: $(target).bin $(target).hex
mrproper: mrproper:
rm -f $(target).pro rm -f $(target).pro
binary: $(target).bin $(target).hex
clean: clean:
@echo [CLEAN] $(OBJDIR) rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss
@rm -f $(target).elf $(target).bin $(target).hex $(OBJ) $(ASOBJ) $(mapfile).map $(target).lss rm -rfv $(OBJDIR)
@rm -rf $(OBJDIR)/*
qtproject:
echo -e "TEMPLATE = app\nCONFIG -= console app_bundle qt" > $(target).pro
echo -e "SOURCES += $(CFILES) $(ASFILES)" >> $(target).pro
echo -ne "INCLUDEPATH += " >> $(target).pro
echo "$(INCLUDEPATH)" | sed "s!-I!./!g" >> $(target).pro
echo -ne "HEADERS += " >> $(target).pro
find -name "*.h" | tr "\\n" " " >> $(target).pro
echo -ne "\nDEFINES += " >> $(target).pro
echo "$(DEFINES)" | sed "s/-D//g" >> $(target).pro
-include $(CFILES:%.c=$(OBJDIR)/%.c.d) $(ASFILES:%.S=$(OBJDIR)/%.S.d) -include $(CFILES:%.c=$(OBJDIR)/%.c.d) $(ASFILES:%.S=$(OBJDIR)/%.S.d)